| File: | var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h |
| Warning: | line 322, column 11 Assigned value is garbage or undefined |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 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 | |||||
| 53 | namespace mozilla { | ||||
| 54 | |||||
| 55 | namespace dom { | ||||
| 56 | |||||
| 57 | namespace binding_detail {}; // Just to make sure it's known as a namespace | ||||
| 58 | using namespace mozilla::dom::binding_detail; | ||||
| 59 | |||||
| 60 | |||||
| 61 | namespace binding_detail { | ||||
| 62 | constexpr nsLiteralCString EnumStrings<MyTestEnum>::Values[2]; | ||||
| 63 | } // namespace binding_detail | ||||
| 64 | |||||
| 65 | bool | ||||
| 66 | ToJSValue(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 { *((volatile int*)__null) = 68; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 69 | JSString* resultStr = | ||||
| 70 | JS_NewStringCopyN(aCx, binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].BeginReading(), | ||||
| 71 | binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].Length()); | ||||
| 72 | if (!resultStr) { | ||||
| 73 | return false; | ||||
| 74 | } | ||||
| 75 | aValue.setString(resultStr); | ||||
| 76 | return true; | ||||
| 77 | } | ||||
| 78 | |||||
| 79 | |||||
| 80 | MOZ_CAN_RUN_SCRIPT void | ||||
| 81 | MyTestCallback::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 | |||||
| 95 | namespace TestCImplementedInterface_Binding { | ||||
| 96 | |||||
| 97 | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<TestJSImplInterface_Binding::NativeType>::value, | ||||
| 98 | "Can't inherit from an interface with a different ownership model."); | ||||
| 99 | |||||
| 100 | bool sNativePropertiesInited = false; | ||||
| 101 | const NativePropertyHooks sNativePropertyHooks = { | ||||
| 102 | nullptr, | ||||
| 103 | { nullptr, nullptr, &sNativePropertiesInited }, | ||||
| 104 | prototypes::id::TestCImplementedInterface, | ||||
| 105 | constructors::id::TestCImplementedInterface, | ||||
| 106 | &DefaultXrayExpandoObjectClass | ||||
| 107 | }; | ||||
| 108 | |||||
| 109 | static 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 | |||||
| 119 | static 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 | |||||
| 135 | void | ||||
| 136 | CreateInterfaceObjects(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 | |||||
| 164 | JS::Handle<JSObject*> | ||||
| 165 | GetProtoObjectHandle(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 | |||||
| 175 | JSObject* | ||||
| 176 | GetProtoObject(JSContext* aCx) | ||||
| 177 | { | ||||
| 178 | return GetProtoObjectHandle(aCx); | ||||
| 179 | } | ||||
| 180 | |||||
| 181 | JS::Handle<JSObject*> | ||||
| 182 | GetConstructorObjectHandle(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 | |||||
| 196 | namespace TestCImplementedInterface2_Binding { | ||||
| 197 | |||||
| 198 | bool sNativePropertiesInited = false; | ||||
| 199 | const NativePropertyHooks sNativePropertyHooks = { | ||||
| 200 | nullptr, | ||||
| 201 | { nullptr, nullptr, &sNativePropertiesInited }, | ||||
| 202 | prototypes::id::TestCImplementedInterface2, | ||||
| 203 | constructors::id::TestCImplementedInterface2, | ||||
| 204 | &DefaultXrayExpandoObjectClass | ||||
| 205 | }; | ||||
| 206 | |||||
| 207 | static 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 | |||||
| 217 | static 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 | |||||
| 233 | void | ||||
| 234 | CreateInterfaceObjects(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 | |||||
| 262 | JS::Handle<JSObject*> | ||||
| 263 | GetProtoObjectHandle(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 | |||||
| 273 | JSObject* | ||||
| 274 | GetProtoObject(JSContext* aCx) | ||||
| 275 | { | ||||
| 276 | return GetProtoObjectHandle(aCx); | ||||
| 277 | } | ||||
| 278 | |||||
| 279 | JS::Handle<JSObject*> | ||||
| 280 | GetConstructorObjectHandle(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 | |||||
| 294 | namespace TestJSImplInterface_Binding { | ||||
| 295 | |||||
| 296 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 297 | get_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 { *(( volatile int*)__null) = 323; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 324 | args.rval().setInt32(int32_t(result)); | ||||
| 325 | return true; | ||||
| 326 | } | ||||
| 327 | |||||
| 328 | static 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 | |||||
| 344 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 345 | get_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 { *(( volatile int*)__null) = 371; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 372 | args.rval().setInt32(int32_t(result)); | ||||
| 373 | return true; | ||||
| 374 | } | ||||
| 375 | |||||
| 376 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 377 | set_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 { *(( volatile int*)__null) = 409; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 410 | |||||
| 411 | return true; | ||||
| 412 | } | ||||
| 413 | |||||
| 414 | static 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 | }; | ||||
| 429 | static 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 | |||||
| 445 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 446 | passByte(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 { *(( volatile int*)__null) = 481; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 482 | args.rval().setUndefined(); | ||||
| 483 | return true; | ||||
| 484 | } | ||||
| 485 | |||||
| 486 | static 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 | |||||
| 502 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 503 | receiveByte(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 { *(( volatile int*)__null) = 529; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 530 | args.rval().setInt32(int32_t(result)); | ||||
| 531 | return true; | ||||
| 532 | } | ||||
| 533 | |||||
| 534 | static 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 | |||||
| 550 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 551 | passOptionalByte(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 { *(( volatile int*)__null) = 586; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 587 | args.rval().setUndefined(); | ||||
| 588 | return true; | ||||
| 589 | } | ||||
| 590 | |||||
| 591 | static 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 | |||||
| 607 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 608 | passOptionalByteBeforeRequired(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 { *(( volatile int*)__null) = 650; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 651 | args.rval().setUndefined(); | ||||
| 652 | return true; | ||||
| 653 | } | ||||
| 654 | |||||
| 655 | static 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 | |||||
| 671 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 672 | passOptionalByteWithDefault(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 { *(( volatile int*)__null) = 708; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 709 | args.rval().setUndefined(); | ||||
| 710 | return true; | ||||
| 711 | } | ||||
| 712 | |||||
| 713 | static 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 | |||||
| 729 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 730 | passOptionalByteWithDefaultBeforeRequired(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 { *(( volatile int*)__null) = 773; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 774 | args.rval().setUndefined(); | ||||
| 775 | return true; | ||||
| 776 | } | ||||
| 777 | |||||
| 778 | static 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 | |||||
| 794 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 795 | passNullableByte(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 { *(( volatile int*)__null) = 832; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 833 | args.rval().setUndefined(); | ||||
| 834 | return true; | ||||
| 835 | } | ||||
| 836 | |||||
| 837 | static 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 | |||||
| 853 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 854 | passOptionalNullableByte(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 { *(( volatile int*)__null) = 891; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 892 | args.rval().setUndefined(); | ||||
| 893 | return true; | ||||
| 894 | } | ||||
| 895 | |||||
| 896 | static 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 | |||||
| 912 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 913 | passVariadicByte(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 { *(( volatile int*)__null) = 955; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 956 | args.rval().setUndefined(); | ||||
| 957 | return true; | ||||
| 958 | } | ||||
| 959 | |||||
| 960 | static 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 | |||||
| 976 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 977 | get_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 { *(( volatile int*)__null) = 1003; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1004 | args.rval().setInt32(int32_t(result)); | ||||
| 1005 | return true; | ||||
| 1006 | } | ||||
| 1007 | |||||
| 1008 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1009 | set_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 { *(( volatile int*)__null) = 1041; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1042 | |||||
| 1043 | return true; | ||||
| 1044 | } | ||||
| 1045 | |||||
| 1046 | static 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 | }; | ||||
| 1061 | static 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 | |||||
| 1077 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1078 | get_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 { *(( volatile int*)__null) = 1104; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1105 | args.rval().setInt32(int32_t(result)); | ||||
| 1106 | return true; | ||||
| 1107 | } | ||||
| 1108 | |||||
| 1109 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1110 | set_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 { *(( volatile int*)__null) = 1142; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1143 | |||||
| 1144 | return true; | ||||
| 1145 | } | ||||
| 1146 | |||||
| 1147 | static 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 | }; | ||||
| 1162 | static 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 | |||||
| 1178 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1179 | get_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 { *(( volatile int*)__null) = 1205; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1206 | args.rval().setInt32(int32_t(result)); | ||||
| 1207 | return true; | ||||
| 1208 | } | ||||
| 1209 | |||||
| 1210 | static 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 | |||||
| 1226 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1227 | get_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 { *(( volatile int*)__null) = 1253; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1254 | args.rval().setInt32(int32_t(result)); | ||||
| 1255 | return true; | ||||
| 1256 | } | ||||
| 1257 | |||||
| 1258 | static 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 | |||||
| 1274 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1275 | returnByteSideEffectFree(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 { *(( volatile int*)__null) = 1301; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1302 | args.rval().setInt32(int32_t(result)); | ||||
| 1303 | return true; | ||||
| 1304 | } | ||||
| 1305 | |||||
| 1306 | static const JSJitInfo::ArgType returnByteSideEffectFree_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | ||||
| 1307 | static 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 | |||||
| 1326 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1327 | returnDOMDependentByte(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 { *(( volatile int*)__null) = 1353; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1354 | args.rval().setInt32(int32_t(result)); | ||||
| 1355 | return true; | ||||
| 1356 | } | ||||
| 1357 | |||||
| 1358 | static const JSJitInfo::ArgType returnDOMDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | ||||
| 1359 | static 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 | |||||
| 1378 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1379 | returnConstantByte(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 { *(( volatile int*)__null) = 1405; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1406 | args.rval().setInt32(int32_t(result)); | ||||
| 1407 | return true; | ||||
| 1408 | } | ||||
| 1409 | |||||
| 1410 | static const JSJitInfo::ArgType returnConstantByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | ||||
| 1411 | static 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 | |||||
| 1430 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1431 | returnDeviceStateDependentByte(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 { *(( volatile int*)__null) = 1457; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1458 | args.rval().setInt32(int32_t(result)); | ||||
| 1459 | return true; | ||||
| 1460 | } | ||||
| 1461 | |||||
| 1462 | static const JSJitInfo::ArgType returnDeviceStateDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | ||||
| 1463 | static 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 | |||||
| 1482 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1483 | get_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 { *(( volatile int*)__null) = 1509; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1510 | args.rval().setInt32(int32_t(result)); | ||||
| 1511 | return true; | ||||
| 1512 | } | ||||
| 1513 | |||||
| 1514 | static 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 | |||||
| 1530 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1531 | get_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 { *(( volatile int*)__null) = 1557; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1558 | args.rval().setInt32(int32_t(result)); | ||||
| 1559 | return true; | ||||
| 1560 | } | ||||
| 1561 | |||||
| 1562 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1563 | set_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 { *(( volatile int*)__null) = 1595; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1596 | |||||
| 1597 | return true; | ||||
| 1598 | } | ||||
| 1599 | |||||
| 1600 | static 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 | }; | ||||
| 1615 | static 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 | |||||
| 1631 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1632 | passShort(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 { *(( volatile int*)__null) = 1667; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1668 | args.rval().setUndefined(); | ||||
| 1669 | return true; | ||||
| 1670 | } | ||||
| 1671 | |||||
| 1672 | static 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 | |||||
| 1688 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1689 | receiveShort(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 { *(( volatile int*)__null) = 1715; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1716 | args.rval().setInt32(int32_t(result)); | ||||
| 1717 | return true; | ||||
| 1718 | } | ||||
| 1719 | |||||
| 1720 | static 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 | |||||
| 1736 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1737 | passOptionalShort(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 { *(( volatile int*)__null) = 1772; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1773 | args.rval().setUndefined(); | ||||
| 1774 | return true; | ||||
| 1775 | } | ||||
| 1776 | |||||
| 1777 | static 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 | |||||
| 1793 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1794 | passOptionalShortWithDefault(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 { *(( volatile int*)__null) = 1830; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1831 | args.rval().setUndefined(); | ||||
| 1832 | return true; | ||||
| 1833 | } | ||||
| 1834 | |||||
| 1835 | static 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 | |||||
| 1851 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1852 | get_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 { *(( volatile int*)__null) = 1878; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1879 | args.rval().setInt32(int32_t(result)); | ||||
| 1880 | return true; | ||||
| 1881 | } | ||||
| 1882 | |||||
| 1883 | static 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 | |||||
| 1899 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1900 | get_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 { *(( volatile int*)__null) = 1926; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1927 | args.rval().setInt32(int32_t(result)); | ||||
| 1928 | return true; | ||||
| 1929 | } | ||||
| 1930 | |||||
| 1931 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 1932 | set_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 { *(( volatile int*)__null) = 1964; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 1965 | |||||
| 1966 | return true; | ||||
| 1967 | } | ||||
| 1968 | |||||
| 1969 | static 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 | }; | ||||
| 1984 | static 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 | |||||
| 2000 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2001 | passLong(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 { *(( volatile int*)__null) = 2036; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2037 | args.rval().setUndefined(); | ||||
| 2038 | return true; | ||||
| 2039 | } | ||||
| 2040 | |||||
| 2041 | static 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 | |||||
| 2057 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2058 | receiveLong(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 { *(( volatile int*)__null) = 2084; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2085 | args.rval().setInt32(int32_t(result)); | ||||
| 2086 | return true; | ||||
| 2087 | } | ||||
| 2088 | |||||
| 2089 | static 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 | |||||
| 2105 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2106 | passOptionalLong(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 { *(( volatile int*)__null) = 2141; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2142 | args.rval().setUndefined(); | ||||
| 2143 | return true; | ||||
| 2144 | } | ||||
| 2145 | |||||
| 2146 | static 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 | |||||
| 2162 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2163 | passOptionalLongWithDefault(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 { *(( volatile int*)__null) = 2199; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2200 | args.rval().setUndefined(); | ||||
| 2201 | return true; | ||||
| 2202 | } | ||||
| 2203 | |||||
| 2204 | static 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 | |||||
| 2220 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2221 | get_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 { *(( volatile int*)__null) = 2247; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2248 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 2249 | return true; | ||||
| 2250 | } | ||||
| 2251 | |||||
| 2252 | static 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 | |||||
| 2268 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2269 | get_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 { *(( volatile int*)__null) = 2295; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2296 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 2297 | return true; | ||||
| 2298 | } | ||||
| 2299 | |||||
| 2300 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2301 | set_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 { *(( volatile int*)__null) = 2333; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2334 | |||||
| 2335 | return true; | ||||
| 2336 | } | ||||
| 2337 | |||||
| 2338 | static 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 | }; | ||||
| 2353 | static 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 | |||||
| 2369 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2370 | passLongLong(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 { *(( volatile int*)__null) = 2405; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2406 | args.rval().setUndefined(); | ||||
| 2407 | return true; | ||||
| 2408 | } | ||||
| 2409 | |||||
| 2410 | static 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 | |||||
| 2426 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2427 | receiveLongLong(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 { *(( volatile int*)__null) = 2453; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2454 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 2455 | return true; | ||||
| 2456 | } | ||||
| 2457 | |||||
| 2458 | static 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 | |||||
| 2474 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2475 | passOptionalLongLong(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 { *(( volatile int*)__null) = 2510; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2511 | args.rval().setUndefined(); | ||||
| 2512 | return true; | ||||
| 2513 | } | ||||
| 2514 | |||||
| 2515 | static 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 | |||||
| 2531 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2532 | passOptionalLongLongWithDefault(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 { *(( volatile int*)__null) = 2568; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2569 | args.rval().setUndefined(); | ||||
| 2570 | return true; | ||||
| 2571 | } | ||||
| 2572 | |||||
| 2573 | static 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 | |||||
| 2589 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2590 | get_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 { *(( volatile int*)__null) = 2616; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2617 | args.rval().setInt32(int32_t(result)); | ||||
| 2618 | return true; | ||||
| 2619 | } | ||||
| 2620 | |||||
| 2621 | static 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 | |||||
| 2637 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2638 | get_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 { *(( volatile int*)__null) = 2664; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2665 | args.rval().setInt32(int32_t(result)); | ||||
| 2666 | return true; | ||||
| 2667 | } | ||||
| 2668 | |||||
| 2669 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2670 | set_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 { *(( volatile int*)__null) = 2702; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2703 | |||||
| 2704 | return true; | ||||
| 2705 | } | ||||
| 2706 | |||||
| 2707 | static 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 | }; | ||||
| 2722 | static 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 | |||||
| 2738 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2739 | passOctet(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 { *(( volatile int*)__null) = 2774; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2775 | args.rval().setUndefined(); | ||||
| 2776 | return true; | ||||
| 2777 | } | ||||
| 2778 | |||||
| 2779 | static 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 | |||||
| 2795 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2796 | receiveOctet(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 { *(( volatile int*)__null) = 2822; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2823 | args.rval().setInt32(int32_t(result)); | ||||
| 2824 | return true; | ||||
| 2825 | } | ||||
| 2826 | |||||
| 2827 | static 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 | |||||
| 2843 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2844 | passOptionalOctet(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 { *(( volatile int*)__null) = 2879; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2880 | args.rval().setUndefined(); | ||||
| 2881 | return true; | ||||
| 2882 | } | ||||
| 2883 | |||||
| 2884 | static 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 | |||||
| 2900 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2901 | passOptionalOctetWithDefault(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 { *(( volatile int*)__null) = 2937; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2938 | args.rval().setUndefined(); | ||||
| 2939 | return true; | ||||
| 2940 | } | ||||
| 2941 | |||||
| 2942 | static 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 | |||||
| 2958 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 2959 | get_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 { *(( volatile int*)__null) = 2985; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 2986 | args.rval().setInt32(int32_t(result)); | ||||
| 2987 | return true; | ||||
| 2988 | } | ||||
| 2989 | |||||
| 2990 | static 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 | |||||
| 3006 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3007 | get_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 { *(( volatile int*)__null) = 3033; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3034 | args.rval().setInt32(int32_t(result)); | ||||
| 3035 | return true; | ||||
| 3036 | } | ||||
| 3037 | |||||
| 3038 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3039 | set_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 { *(( volatile int*)__null) = 3071; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3072 | |||||
| 3073 | return true; | ||||
| 3074 | } | ||||
| 3075 | |||||
| 3076 | static 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 | }; | ||||
| 3091 | static 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 | |||||
| 3107 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3108 | passUnsignedShort(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 { *(( volatile int*)__null) = 3143; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3144 | args.rval().setUndefined(); | ||||
| 3145 | return true; | ||||
| 3146 | } | ||||
| 3147 | |||||
| 3148 | static 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 | |||||
| 3164 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3165 | receiveUnsignedShort(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 { *(( volatile int*)__null) = 3191; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3192 | args.rval().setInt32(int32_t(result)); | ||||
| 3193 | return true; | ||||
| 3194 | } | ||||
| 3195 | |||||
| 3196 | static 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 | |||||
| 3212 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3213 | passOptionalUnsignedShort(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 { *(( volatile int*)__null) = 3248; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3249 | args.rval().setUndefined(); | ||||
| 3250 | return true; | ||||
| 3251 | } | ||||
| 3252 | |||||
| 3253 | static 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 | |||||
| 3269 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3270 | passOptionalUnsignedShortWithDefault(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 { *(( volatile int*)__null) = 3306; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3307 | args.rval().setUndefined(); | ||||
| 3308 | return true; | ||||
| 3309 | } | ||||
| 3310 | |||||
| 3311 | static 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 | |||||
| 3327 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3328 | get_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 { *(( volatile int*)__null) = 3354; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3355 | args.rval().setNumber(result); | ||||
| 3356 | return true; | ||||
| 3357 | } | ||||
| 3358 | |||||
| 3359 | static 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 | |||||
| 3375 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3376 | get_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 { *(( volatile int*)__null) = 3402; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3403 | args.rval().setNumber(result); | ||||
| 3404 | return true; | ||||
| 3405 | } | ||||
| 3406 | |||||
| 3407 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3408 | set_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 { *(( volatile int*)__null) = 3440; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3441 | |||||
| 3442 | return true; | ||||
| 3443 | } | ||||
| 3444 | |||||
| 3445 | static 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 | }; | ||||
| 3460 | static 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 | |||||
| 3476 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3477 | passUnsignedLong(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 { *(( volatile int*)__null) = 3512; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3513 | args.rval().setUndefined(); | ||||
| 3514 | return true; | ||||
| 3515 | } | ||||
| 3516 | |||||
| 3517 | static 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 | |||||
| 3533 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3534 | receiveUnsignedLong(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 { *(( volatile int*)__null) = 3560; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3561 | args.rval().setNumber(result); | ||||
| 3562 | return true; | ||||
| 3563 | } | ||||
| 3564 | |||||
| 3565 | static 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 | |||||
| 3581 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3582 | passOptionalUnsignedLong(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 { *(( volatile int*)__null) = 3617; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3618 | args.rval().setUndefined(); | ||||
| 3619 | return true; | ||||
| 3620 | } | ||||
| 3621 | |||||
| 3622 | static 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 | |||||
| 3638 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3639 | passOptionalUnsignedLongWithDefault(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 { *(( volatile int*)__null) = 3675; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3676 | args.rval().setUndefined(); | ||||
| 3677 | return true; | ||||
| 3678 | } | ||||
| 3679 | |||||
| 3680 | static 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 | |||||
| 3696 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3697 | get_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 { *(( volatile int*)__null) = 3723; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3724 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 3725 | return true; | ||||
| 3726 | } | ||||
| 3727 | |||||
| 3728 | static 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 | |||||
| 3744 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3745 | get_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 { *(( volatile int*)__null) = 3771; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3772 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 3773 | return true; | ||||
| 3774 | } | ||||
| 3775 | |||||
| 3776 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3777 | set_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 { *(( volatile int*)__null) = 3809; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3810 | |||||
| 3811 | return true; | ||||
| 3812 | } | ||||
| 3813 | |||||
| 3814 | static 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 | }; | ||||
| 3829 | static 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 | |||||
| 3845 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3846 | passUnsignedLongLong(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 { *(( volatile int*)__null) = 3881; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3882 | args.rval().setUndefined(); | ||||
| 3883 | return true; | ||||
| 3884 | } | ||||
| 3885 | |||||
| 3886 | static 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 | |||||
| 3902 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3903 | receiveUnsignedLongLong(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 { *(( volatile int*)__null) = 3929; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3930 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 3931 | return true; | ||||
| 3932 | } | ||||
| 3933 | |||||
| 3934 | static 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 | |||||
| 3950 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 3951 | passOptionalUnsignedLongLong(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 { *(( volatile int*)__null) = 3986; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 3987 | args.rval().setUndefined(); | ||||
| 3988 | return true; | ||||
| 3989 | } | ||||
| 3990 | |||||
| 3991 | static 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 | |||||
| 4007 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4008 | passOptionalUnsignedLongLongWithDefault(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 { *(( volatile int*)__null) = 4044; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4045 | args.rval().setUndefined(); | ||||
| 4046 | return true; | ||||
| 4047 | } | ||||
| 4048 | |||||
| 4049 | static 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 | |||||
| 4065 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4066 | get_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 { *(( volatile int*)__null) = 4092; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4093 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 4094 | return true; | ||||
| 4095 | } | ||||
| 4096 | |||||
| 4097 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4098 | set_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 { *(( volatile int*)__null) = 4134; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4135 | |||||
| 4136 | return true; | ||||
| 4137 | } | ||||
| 4138 | |||||
| 4139 | static 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 | }; | ||||
| 4154 | static 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 | |||||
| 4170 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4171 | get_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 { *(( volatile int*)__null) = 4197; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4198 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 4199 | return true; | ||||
| 4200 | } | ||||
| 4201 | |||||
| 4202 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4203 | set_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 { *(( volatile int*)__null) = 4235; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4236 | |||||
| 4237 | return true; | ||||
| 4238 | } | ||||
| 4239 | |||||
| 4240 | static 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 | }; | ||||
| 4255 | static 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 | |||||
| 4271 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4272 | get_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 { *(( volatile int*)__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 | |||||
| 4307 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4308 | set_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 { *(( volatile int*)__null) = 4346; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4347 | |||||
| 4348 | return true; | ||||
| 4349 | } | ||||
| 4350 | |||||
| 4351 | static 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 | }; | ||||
| 4366 | static 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 | |||||
| 4382 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4383 | get_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 { *(( volatile int*)__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 | |||||
| 4418 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4419 | set_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 { *(( volatile int*)__null) = 4453; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4454 | |||||
| 4455 | return true; | ||||
| 4456 | } | ||||
| 4457 | |||||
| 4458 | static 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 | }; | ||||
| 4473 | static 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 | |||||
| 4489 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4490 | get_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 { *(( volatile int*)__null) = 4516; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4517 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 4518 | return true; | ||||
| 4519 | } | ||||
| 4520 | |||||
| 4521 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4522 | set_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 { *(( volatile int*)__null) = 4558; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4559 | |||||
| 4560 | return true; | ||||
| 4561 | } | ||||
| 4562 | |||||
| 4563 | static 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 | }; | ||||
| 4578 | static 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 | |||||
| 4594 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4595 | get_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 { *(( volatile int*)__null) = 4621; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4622 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 4623 | return true; | ||||
| 4624 | } | ||||
| 4625 | |||||
| 4626 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4627 | set_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 { *(( volatile int*)__null) = 4659; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4660 | |||||
| 4661 | return true; | ||||
| 4662 | } | ||||
| 4663 | |||||
| 4664 | static 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 | }; | ||||
| 4679 | static 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 | |||||
| 4695 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4696 | get_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 { *(( volatile int*)__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 | |||||
| 4731 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4732 | set_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 { *(( volatile int*)__null) = 4770; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4771 | |||||
| 4772 | return true; | ||||
| 4773 | } | ||||
| 4774 | |||||
| 4775 | static 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 | }; | ||||
| 4790 | static 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 | |||||
| 4806 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4807 | get_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 { *(( volatile int*)__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 | |||||
| 4842 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4843 | set_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 { *(( volatile int*)__null) = 4877; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 4878 | |||||
| 4879 | return true; | ||||
| 4880 | } | ||||
| 4881 | |||||
| 4882 | static 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 | }; | ||||
| 4897 | static 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 | |||||
| 4913 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 4914 | passFloat(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 { *(( volatile int*)__null) = 5290; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5291 | args.rval().setUndefined(); | ||||
| 5292 | return true; | ||||
| 5293 | } | ||||
| 5294 | |||||
| 5295 | static 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 | |||||
| 5311 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5312 | passLenientFloat(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 { *(( volatile int*)__null) = 5685; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5686 | args.rval().setUndefined(); | ||||
| 5687 | return true; | ||||
| 5688 | } | ||||
| 5689 | |||||
| 5690 | static 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 | |||||
| 5706 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5707 | get_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 { *(( volatile int*)__null) = 5733; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5734 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 5735 | return true; | ||||
| 5736 | } | ||||
| 5737 | |||||
| 5738 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5739 | set_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 { *(( volatile int*)__null) = 5778; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5779 | |||||
| 5780 | return true; | ||||
| 5781 | } | ||||
| 5782 | |||||
| 5783 | static 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 | }; | ||||
| 5798 | static 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 | |||||
| 5814 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5815 | get_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 { *(( volatile int*)__null) = 5841; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5842 | args.rval().set(JS_NumberValue(double(result))); | ||||
| 5843 | return true; | ||||
| 5844 | } | ||||
| 5845 | |||||
| 5846 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5847 | set_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 { *(( volatile int*)__null) = 5886; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 5887 | |||||
| 5888 | return true; | ||||
| 5889 | } | ||||
| 5890 | |||||
| 5891 | static 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 | }; | ||||
| 5906 | static 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 | |||||
| 5922 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5923 | receiveSelf(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 5951; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 5952 | return false; | ||||
| 5953 | } | ||||
| 5954 | return true; | ||||
| 5955 | } | ||||
| 5956 | |||||
| 5957 | static 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 | |||||
| 5973 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 5974 | receiveNullableSelf(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6006; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6007 | return false; | ||||
| 6008 | } | ||||
| 6009 | return true; | ||||
| 6010 | } | ||||
| 6011 | |||||
| 6012 | static 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 | |||||
| 6028 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6029 | receiveWeakSelf(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6057; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6058 | return false; | ||||
| 6059 | } | ||||
| 6060 | return true; | ||||
| 6061 | } | ||||
| 6062 | |||||
| 6063 | static 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 | |||||
| 6079 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6080 | receiveWeakNullableSelf(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6112; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6113 | return false; | ||||
| 6114 | } | ||||
| 6115 | return true; | ||||
| 6116 | } | ||||
| 6117 | |||||
| 6118 | static 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 | |||||
| 6134 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6135 | passSelf(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 { *(( volatile int*)__null) = 6181; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6182 | args.rval().setUndefined(); | ||||
| 6183 | return true; | ||||
| 6184 | } | ||||
| 6185 | |||||
| 6186 | static 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 | |||||
| 6202 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6203 | passNullableSelf(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 { *(( volatile int*)__null) = 6251; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6252 | args.rval().setUndefined(); | ||||
| 6253 | return true; | ||||
| 6254 | } | ||||
| 6255 | |||||
| 6256 | static 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 | |||||
| 6272 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6273 | get_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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6301; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6302 | return false; | ||||
| 6303 | } | ||||
| 6304 | return true; | ||||
| 6305 | } | ||||
| 6306 | |||||
| 6307 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6308 | set_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 { *(( volatile int*)__null) = 6351; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6352 | |||||
| 6353 | return true; | ||||
| 6354 | } | ||||
| 6355 | |||||
| 6356 | static 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 | }; | ||||
| 6371 | static 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 | |||||
| 6387 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6388 | get_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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6420; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6421 | return false; | ||||
| 6422 | } | ||||
| 6423 | return true; | ||||
| 6424 | } | ||||
| 6425 | |||||
| 6426 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6427 | set_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 { *(( volatile int*)__null) = 6472; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6473 | |||||
| 6474 | return true; | ||||
| 6475 | } | ||||
| 6476 | |||||
| 6477 | static 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 | }; | ||||
| 6492 | static 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 | |||||
| 6508 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6509 | passOptionalSelf(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 { *(( volatile int*)__null) = 6557; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6558 | args.rval().setUndefined(); | ||||
| 6559 | return true; | ||||
| 6560 | } | ||||
| 6561 | |||||
| 6562 | static 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 | |||||
| 6578 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6579 | passOptionalNonNullSelf(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 { *(( volatile int*)__null) = 6625; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6626 | args.rval().setUndefined(); | ||||
| 6627 | return true; | ||||
| 6628 | } | ||||
| 6629 | |||||
| 6630 | static 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 | |||||
| 6646 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6647 | passOptionalSelfWithDefault(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 { *(( volatile int*)__null) = 6696; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 6697 | args.rval().setUndefined(); | ||||
| 6698 | return true; | ||||
| 6699 | } | ||||
| 6700 | |||||
| 6701 | static 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 | |||||
| 6717 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6718 | receiveNonWrapperCacheInterface(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6748; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6749 | return false; | ||||
| 6750 | } | ||||
| 6751 | return true; | ||||
| 6752 | } | ||||
| 6753 | |||||
| 6754 | static 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 | |||||
| 6770 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6771 | receiveNullableNonWrapperCacheInterface(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 { *(( volatile int*)__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 { *((volatile int*)__null) = 6805; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 6806 | return false; | ||||
| 6807 | } | ||||
| 6808 | return true; | ||||
| 6809 | } | ||||
| 6810 | |||||
| 6811 | static 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 | |||||
| 6827 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6828 | receiveNonWrapperCacheInterfaceSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 6887 | static 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 | |||||
| 6903 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6904 | receiveNullableNonWrapperCacheInterfaceSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 6967 | static 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 | |||||
| 6983 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 6984 | receiveNonWrapperCacheInterfaceNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 7048 | static 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 | |||||
| 7064 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7065 | receiveNullableNonWrapperCacheInterfaceNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 7133 | static 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 | |||||
| 7149 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7150 | receiveExternal(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 { *(( volatile int*)__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 | |||||
| 7183 | static 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 | |||||
| 7199 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7200 | receiveNullableExternal(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 { *(( volatile int*)__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 | |||||
| 7237 | static 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 | |||||
| 7253 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7254 | receiveWeakExternal(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 { *(( volatile int*)__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 | |||||
| 7287 | static 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 | |||||
| 7303 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7304 | receiveWeakNullableExternal(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 { *(( volatile int*)__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 | |||||
| 7341 | static 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 | |||||
| 7357 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7358 | passExternal(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 { *((volatile int*)__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 { *(( volatile int*)__null) = 7404; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7405 | args.rval().setUndefined(); | ||||
| 7406 | return true; | ||||
| 7407 | } | ||||
| 7408 | |||||
| 7409 | static 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 | |||||
| 7425 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7426 | passNullableExternal(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 { *((volatile int*)__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 { *(( volatile int*)__null) = 7474; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7475 | args.rval().setUndefined(); | ||||
| 7476 | return true; | ||||
| 7477 | } | ||||
| 7478 | |||||
| 7479 | static 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 | |||||
| 7495 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7496 | get_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 { *(( volatile int*)__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 | |||||
| 7529 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7530 | set_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 { *((volatile int*)__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 { *(( volatile int*)__null) = 7573; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7574 | |||||
| 7575 | return true; | ||||
| 7576 | } | ||||
| 7577 | |||||
| 7578 | static 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 | }; | ||||
| 7593 | static 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 | |||||
| 7609 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7610 | get_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 { *(( volatile int*)__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 | |||||
| 7647 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7648 | set_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 { *((volatile int*)__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 { *(( volatile int*)__null) = 7693; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7694 | |||||
| 7695 | return true; | ||||
| 7696 | } | ||||
| 7697 | |||||
| 7698 | static 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 | }; | ||||
| 7713 | static 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 | |||||
| 7729 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7730 | passOptionalExternal(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 { *((volatile int *)__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 { *(( volatile int*)__null) = 7779; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7780 | args.rval().setUndefined(); | ||||
| 7781 | return true; | ||||
| 7782 | } | ||||
| 7783 | |||||
| 7784 | static 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 | |||||
| 7800 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7801 | passOptionalNonNullExternal(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 { *((volatile int *)__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 { *(( volatile int*)__null) = 7848; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7849 | args.rval().setUndefined(); | ||||
| 7850 | return true; | ||||
| 7851 | } | ||||
| 7852 | |||||
| 7853 | static 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 | |||||
| 7869 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7870 | passOptionalExternalWithDefault(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 { *((volatile int*)__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 { *(( volatile int*)__null) = 7919; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 7920 | args.rval().setUndefined(); | ||||
| 7921 | return true; | ||||
| 7922 | } | ||||
| 7923 | |||||
| 7924 | static 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 | |||||
| 7940 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7941 | receiveCallbackInterface(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 { *(( volatile int*)__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 | |||||
| 7975 | static 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 | |||||
| 7991 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 7992 | receiveNullableCallbackInterface(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 { *(( volatile int*)__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 | |||||
| 8031 | static 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 | |||||
| 8047 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8048 | receiveWeakCallbackInterface(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 { *(( volatile int*)__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 | |||||
| 8082 | static 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 | |||||
| 8098 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8099 | receiveWeakNullableCallbackInterface(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 { *(( volatile int*)__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 | |||||
| 8138 | static 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 | |||||
| 8154 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8155 | passCallbackInterface(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 { *(( volatile int*)__null) = 8196; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8197 | args.rval().setUndefined(); | ||||
| 8198 | return true; | ||||
| 8199 | } | ||||
| 8200 | |||||
| 8201 | static 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 | |||||
| 8217 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8218 | passNullableCallbackInterface(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 { *(( volatile int*)__null) = 8261; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8262 | args.rval().setUndefined(); | ||||
| 8263 | return true; | ||||
| 8264 | } | ||||
| 8265 | |||||
| 8266 | static 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 | |||||
| 8282 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8283 | get_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 { *(( volatile int*)__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 | |||||
| 8317 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8318 | set_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 { *(( volatile int*)__null) = 8356; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8357 | |||||
| 8358 | return true; | ||||
| 8359 | } | ||||
| 8360 | |||||
| 8361 | static 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 | }; | ||||
| 8376 | static 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 | |||||
| 8392 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8393 | get_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 { *(( volatile int*)__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 | |||||
| 8432 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8433 | set_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 { *(( volatile int*)__null) = 8473; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8474 | |||||
| 8475 | return true; | ||||
| 8476 | } | ||||
| 8477 | |||||
| 8478 | static 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 | }; | ||||
| 8493 | static 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 | |||||
| 8509 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8510 | passOptionalCallbackInterface(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 { *(( volatile int*)__null) = 8555; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8556 | args.rval().setUndefined(); | ||||
| 8557 | return true; | ||||
| 8558 | } | ||||
| 8559 | |||||
| 8560 | static 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 | |||||
| 8576 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8577 | passOptionalNonNullCallbackInterface(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 { *(( volatile int*)__null) = 8620; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8621 | args.rval().setUndefined(); | ||||
| 8622 | return true; | ||||
| 8623 | } | ||||
| 8624 | |||||
| 8625 | static 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 | |||||
| 8641 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8642 | passOptionalCallbackInterfaceWithDefault(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 { *(( volatile int*)__null) = 8686; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 8687 | args.rval().setUndefined(); | ||||
| 8688 | return true; | ||||
| 8689 | } | ||||
| 8690 | |||||
| 8691 | static 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 | |||||
| 8707 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8708 | receiveSequence(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 { *(( volatile int*)__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 | |||||
| 8764 | static 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 | |||||
| 8780 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8781 | receiveNullableSequence(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 { *(( volatile int*)__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 | |||||
| 8842 | static 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 | |||||
| 8858 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8859 | receiveSequenceOfNullableInts(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 { *(( volatile int*)__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 | |||||
| 8919 | static 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 | |||||
| 8935 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 8936 | receiveNullableSequenceOfNullableInts(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 { *(( volatile int*)__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 | |||||
| 9001 | static 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 | |||||
| 9017 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9018 | passSequence(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 { *(( volatile int*)__null) = 9084; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 9085 | args.rval().setUndefined(); | ||||
| 9086 | return true; | ||||
| 9087 | } | ||||
| 9088 | |||||
| 9089 | static 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 | |||||
| 9105 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9106 | passNullableSequence(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 { *(( volatile int*)__null) = 9174; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 9175 | args.rval().setUndefined(); | ||||
| 9176 | return true; | ||||
| 9177 | } | ||||
| 9178 | |||||
| 9179 | static 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 | |||||
| 9195 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9196 | passSequenceOfNullableInts(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 { *(( volatile int*)__null) = 9264; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 9265 | args.rval().setUndefined(); | ||||
| 9266 | return true; | ||||
| 9267 | } | ||||
| 9268 | |||||
| 9269 | static 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 | |||||
| 9285 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9286 | passOptionalSequenceOfNullableInts(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 { *(( volatile int*)__null) = 9354; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 9355 | args.rval().setUndefined(); | ||||
| 9356 | return true; | ||||
| 9357 | } | ||||
| 9358 | |||||
| 9359 | static 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 | |||||
| 9375 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9376 | passOptionalNullableSequenceOfNullableInts(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 { *(( volatile int*)__null) = 9446; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 9447 | args.rval().setUndefined(); | ||||
| 9448 | return true; | ||||
| 9449 | } | ||||
| 9450 | |||||
| 9451 | static 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 | |||||
| 9467 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9468 | receiveCastableObjectSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 9527 | static 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 | |||||
| 9543 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9544 | receiveCallbackObjectSequence(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 { *(( volatile int*)__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 | |||||
| 9603 | static 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 | |||||
| 9619 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9620 | receiveNullableCastableObjectSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 9683 | static 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 | |||||
| 9699 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9700 | receiveNullableCallbackObjectSequence(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 { *(( volatile int*)__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 | |||||
| 9764 | static 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 | |||||
| 9780 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9781 | receiveCastableObjectNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 9845 | static 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 | |||||
| 9861 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9862 | receiveNullableCastableObjectNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 9930 | static 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 | |||||
| 9946 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 9947 | receiveWeakCastableObjectSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 10006 | static 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 | |||||
| 10022 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10023 | receiveWeakNullableCastableObjectSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 10086 | static 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 | |||||
| 10102 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10103 | receiveWeakCastableObjectNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 10167 | static 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 | |||||
| 10183 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10184 | receiveWeakNullableCastableObjectNullableSequence(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 { *(( volatile int*)__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 { *((volatile int*)__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 | |||||
| 10252 | static 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 | |||||
| 10268 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10269 | passCastableObjectSequence(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 { *(( volatile int*)__null) = 10346; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10347 | args.rval().setUndefined(); | ||||
| 10348 | return true; | ||||
| 10349 | } | ||||
| 10350 | |||||
| 10351 | static 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 | |||||
| 10367 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10368 | passNullableCastableObjectSequence(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 { *(( volatile int*)__null) = 10447; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10448 | args.rval().setUndefined(); | ||||
| 10449 | return true; | ||||
| 10450 | } | ||||
| 10451 | |||||
| 10452 | static 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 | |||||
| 10468 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10469 | passCastableObjectNullableSequence(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 { *(( volatile int*)__null) = 10548; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10549 | args.rval().setUndefined(); | ||||
| 10550 | return true; | ||||
| 10551 | } | ||||
| 10552 | |||||
| 10553 | static 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 | |||||
| 10569 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10570 | passNullableCastableObjectNullableSequence(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 { *(( volatile int*)__null) = 10651; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10652 | args.rval().setUndefined(); | ||||
| 10653 | return true; | ||||
| 10654 | } | ||||
| 10655 | |||||
| 10656 | static 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 | |||||
| 10672 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10673 | passOptionalSequence(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 { *(( volatile int*)__null) = 10739; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10740 | args.rval().setUndefined(); | ||||
| 10741 | return true; | ||||
| 10742 | } | ||||
| 10743 | |||||
| 10744 | static 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 | |||||
| 10760 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10761 | passOptionalSequenceWithDefaultValue(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 { *(( volatile int*)__null) = 10828; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10829 | args.rval().setUndefined(); | ||||
| 10830 | return true; | ||||
| 10831 | } | ||||
| 10832 | |||||
| 10833 | static 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 | |||||
| 10849 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10850 | passOptionalNullableSequence(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 { *(( volatile int*)__null) = 10918; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 10919 | args.rval().setUndefined(); | ||||
| 10920 | return true; | ||||
| 10921 | } | ||||
| 10922 | |||||
| 10923 | static 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 | |||||
| 10939 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 10940 | passOptionalNullableSequenceWithDefaultValue(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 { *(( volatile int*)__null) = 11009; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 11010 | args.rval().setUndefined(); | ||||
| 11011 | return true; | ||||
| 11012 | } | ||||
| 11013 | |||||
| 11014 | static 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 | |||||
| 11030 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11031 | passOptionalNullableSequenceWithDefaultValue2(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 { *(( volatile int*)__null) = 11100; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 11101 | args.rval().setUndefined(); | ||||
| 11102 | return true; | ||||
| 11103 | } | ||||
| 11104 | |||||
| 11105 | static 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 | |||||
| 11121 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11122 | passOptionalObjectSequence(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 { *(( volatile int*)__null) = 11199; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 11200 | args.rval().setUndefined(); | ||||
| 11201 | return true; | ||||
| 11202 | } | ||||
| 11203 | |||||
| 11204 | static 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 | |||||
| 11220 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11221 | passExternalInterfaceSequence(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 { *((volatile int*)__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 { *(( volatile int*)__null) = 11298; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 11299 | args.rval().setUndefined(); | ||||
| 11300 | return true; | ||||
| 11301 | } | ||||
| 11302 | |||||
| 11303 | static 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 | |||||
| 11319 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11320 | passNullableExternalInterfaceSequence(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 { *((volatile int*)__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 { *(( volatile int*)__null) = 11399; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 11400 | args.rval().setUndefined(); | ||||
| 11401 | return true; | ||||
| 11402 | } | ||||
| 11403 | |||||
| 11404 | static 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 | |||||
| 11420 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11421 | receiveStringSequence(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 { *(( volatile int*)__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 | |||||
| 11479 | static 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 | |||||
| 11495 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11496 | receiveByteStringSequence(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 { *(( volatile int*)__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 | |||||
| 11554 | static 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 | |||||
| 11570 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11571 | receiveUTF8StringSequence(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 { *(( volatile int*)__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 | |||||
| 11629 | static 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 | |||||
| 11645 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11646 | receiveAnySequence(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 { *(( volatile int*)__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 | |||||
| 11707 | static 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 | |||||
| 11723 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11724 | receiveNullableAnySequence(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 { *(( volatile int*)__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 | |||||
| 11790 | static 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 | |||||
| 11806 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11807 | receiveObjectSequence(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 { *(( volatile int*)__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 | |||||
| 11868 | static 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 | |||||
| 11884 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11885 | receiveNullableObjectSequence(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 { *(( volatile int*)__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 | |||||
| 11948 | static 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 | |||||
| 11964 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 11965 | passSequenceOfSequences(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 { *(( volatile int*)__null) = 12061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12062 | args.rval().setUndefined(); | ||||
| 12063 | return true; | ||||
| 12064 | } | ||||
| 12065 | |||||
| 12066 | static 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 | |||||
| 12082 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12083 | passSequenceOfSequencesOfSequences(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 { *(( volatile int*)__null) = 12209; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12210 | args.rval().setUndefined(); | ||||
| 12211 | return true; | ||||
| 12212 | } | ||||
| 12213 | |||||
| 12214 | static 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 | |||||
| 12230 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12231 | passRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 12340; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12341 | args.rval().setUndefined(); | ||||
| 12342 | return true; | ||||
| 12343 | } | ||||
| 12344 | |||||
| 12345 | static 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 | |||||
| 12361 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12362 | passNullableRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 12473; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12474 | args.rval().setUndefined(); | ||||
| 12475 | return true; | ||||
| 12476 | } | ||||
| 12477 | |||||
| 12478 | static 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 | |||||
| 12494 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12495 | passRecordOfNullableInts(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 12606; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12607 | args.rval().setUndefined(); | ||||
| 12608 | return true; | ||||
| 12609 | } | ||||
| 12610 | |||||
| 12611 | static 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 | |||||
| 12627 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12628 | passOptionalRecordOfNullableInts(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 12739; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12740 | args.rval().setUndefined(); | ||||
| 12741 | return true; | ||||
| 12742 | } | ||||
| 12743 | |||||
| 12744 | static 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 | |||||
| 12760 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12761 | passOptionalNullableRecordOfNullableInts(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 12874; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 12875 | args.rval().setUndefined(); | ||||
| 12876 | return true; | ||||
| 12877 | } | ||||
| 12878 | |||||
| 12879 | static 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 | |||||
| 12895 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 12896 | passCastableObjectRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13016; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13017 | args.rval().setUndefined(); | ||||
| 13018 | return true; | ||||
| 13019 | } | ||||
| 13020 | |||||
| 13021 | static 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 | |||||
| 13037 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13038 | passNullableCastableObjectRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13160; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13161 | args.rval().setUndefined(); | ||||
| 13162 | return true; | ||||
| 13163 | } | ||||
| 13164 | |||||
| 13165 | static 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 | |||||
| 13181 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13182 | passCastableObjectNullableRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13304; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13305 | args.rval().setUndefined(); | ||||
| 13306 | return true; | ||||
| 13307 | } | ||||
| 13308 | |||||
| 13309 | static 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 | |||||
| 13325 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13326 | passNullableCastableObjectNullableRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13450; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13451 | args.rval().setUndefined(); | ||||
| 13452 | return true; | ||||
| 13453 | } | ||||
| 13454 | |||||
| 13455 | static 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 | |||||
| 13471 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13472 | passOptionalRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13581; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13582 | args.rval().setUndefined(); | ||||
| 13583 | return true; | ||||
| 13584 | } | ||||
| 13585 | |||||
| 13586 | static 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 | |||||
| 13602 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13603 | passOptionalNullableRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13714; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13715 | args.rval().setUndefined(); | ||||
| 13716 | return true; | ||||
| 13717 | } | ||||
| 13718 | |||||
| 13719 | static 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 | |||||
| 13735 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13736 | passOptionalNullableRecordWithDefaultValue(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13848; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13849 | args.rval().setUndefined(); | ||||
| 13850 | return true; | ||||
| 13851 | } | ||||
| 13852 | |||||
| 13853 | static 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 | |||||
| 13869 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 13870 | passOptionalObjectRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 13990; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 13991 | args.rval().setUndefined(); | ||||
| 13992 | return true; | ||||
| 13993 | } | ||||
| 13994 | |||||
| 13995 | static 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 | |||||
| 14011 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14012 | passExternalInterfaceRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14132; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14133 | args.rval().setUndefined(); | ||||
| 14134 | return true; | ||||
| 14135 | } | ||||
| 14136 | |||||
| 14137 | static 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 | |||||
| 14153 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14154 | passNullableExternalInterfaceRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14276; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14277 | args.rval().setUndefined(); | ||||
| 14278 | return true; | ||||
| 14279 | } | ||||
| 14280 | |||||
| 14281 | static 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 | |||||
| 14297 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14298 | passStringRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14407; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14408 | args.rval().setUndefined(); | ||||
| 14409 | return true; | ||||
| 14410 | } | ||||
| 14411 | |||||
| 14412 | static 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 | |||||
| 14428 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14429 | passByteStringRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14538; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14539 | args.rval().setUndefined(); | ||||
| 14540 | return true; | ||||
| 14541 | } | ||||
| 14542 | |||||
| 14543 | static 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 | |||||
| 14559 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14560 | passUTF8StringRecord(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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14669; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14670 | args.rval().setUndefined(); | ||||
| 14671 | return true; | ||||
| 14672 | } | ||||
| 14673 | |||||
| 14674 | static 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 | |||||
| 14690 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14691 | passRecordOfRecords(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 { *((volatile int*)__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 { *((volatile int*)__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 { *((volatile int*)__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 { *((volatile int*)__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 { *(( volatile int*)__null) = 14873; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 14874 | args.rval().setUndefined(); | ||||
| 14875 | return true; | ||||
| 14876 | } | ||||
| 14877 | |||||
| 14878 | static 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 | |||||
| 14894 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14895 | receiveRecord(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 { *(( volatile int*)__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 | |||||
| 14953 | static 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 | |||||
| 14969 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 14970 | receiveNullableRecord(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 { *(( volatile int*)__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 | |||||
| 15033 | static 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 | |||||
| 15049 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15050 | receiveRecordOfNullableInts(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 { *(( volatile int*)__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 | |||||
| 15112 | static 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 | |||||
| 15128 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15129 | receiveNullableRecordOfNullableInts(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 { *(( volatile int*)__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 | |||||
| 15196 | static 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 | |||||
| 15212 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15213 | receiveAnyRecord(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 { *(( volatile int*)__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 | |||||
| 15276 | static 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 | |||||
| 15292 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15293 | passArrayBuffer(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 | } else { | ||||
| 15329 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15330 | return false; | ||||
| 15331 | } | ||||
| 15332 | if (objIsXray) { | ||||
| 15333 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15334 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15335 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15336 | if (!unwrappedObj.ref()) { | ||||
| 15337 | return false; | ||||
| 15338 | } | ||||
| 15339 | } | ||||
| 15340 | FastErrorResult rv; | ||||
| 15341 | // NOTE: This assert does NOT call the function. | ||||
| 15342 | 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"); | ||||
| 15343 | MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15344 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer" )), 0))) { | ||||
| 15345 | return false; | ||||
| 15346 | } | ||||
| 15347 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15347); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15347; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15348 | args.rval().setUndefined(); | ||||
| 15349 | return true; | ||||
| 15350 | } | ||||
| 15351 | |||||
| 15352 | static const JSJitInfo passArrayBuffer_methodinfo = { | ||||
| 15353 | { (JSJitGetterOp)passArrayBuffer }, | ||||
| 15354 | { prototypes::id::TestJSImplInterface }, | ||||
| 15355 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15356 | JSJitInfo::Method, | ||||
| 15357 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15358 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15359 | false, /* isInfallible. False in setters. */ | ||||
| 15360 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15361 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15362 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15363 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15364 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15365 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15366 | }; | ||||
| 15367 | |||||
| 15368 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15369 | passNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15370 | { | ||||
| 15371 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableArrayBuffer"); | ||||
| 15372 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15375( cx, "TestJSImplInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15373 | "TestJSImplInterface", "passNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15375( cx, "TestJSImplInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15374 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15375( cx, "TestJSImplInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15375 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15375( cx, "TestJSImplInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15376 | |||||
| 15377 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15378 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableArrayBuffer", 1)) { | ||||
| 15379 | return false; | ||||
| 15380 | } | ||||
| 15381 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15382 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15383 | if (objIsXray) { | ||||
| 15384 | unwrappedObj.emplace(cx, obj); | ||||
| 15385 | } | ||||
| 15386 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | ||||
| 15387 | if (args[0].isObject()) { | ||||
| 15388 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 15389 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | ||||
| 15390 | return false; | ||||
| 15391 | } | ||||
| 15392 | if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) { | ||||
| 15393 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15394 | return false; | ||||
| 15395 | } | ||||
| 15396 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 15397 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15398 | return false; | ||||
| 15399 | } | ||||
| 15400 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 15401 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15402 | return false; | ||||
| 15403 | } | ||||
| 15404 | } else if (args[0].isNullOrUndefined()) { | ||||
| 15405 | arg0.SetNull(); | ||||
| 15406 | } else { | ||||
| 15407 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15408 | return false; | ||||
| 15409 | } | ||||
| 15410 | if (objIsXray) { | ||||
| 15411 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15412 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15413 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15414 | if (!unwrappedObj.ref()) { | ||||
| 15415 | return false; | ||||
| 15416 | } | ||||
| 15417 | } | ||||
| 15418 | FastErrorResult rv; | ||||
| 15419 | // NOTE: This assert does NOT call the function. | ||||
| 15420 | 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"); | ||||
| 15421 | MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15422 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer" )), 0))) { | ||||
| 15423 | return false; | ||||
| 15424 | } | ||||
| 15425 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15425); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15425; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15426 | args.rval().setUndefined(); | ||||
| 15427 | return true; | ||||
| 15428 | } | ||||
| 15429 | |||||
| 15430 | static const JSJitInfo passNullableArrayBuffer_methodinfo = { | ||||
| 15431 | { (JSJitGetterOp)passNullableArrayBuffer }, | ||||
| 15432 | { prototypes::id::TestJSImplInterface }, | ||||
| 15433 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15434 | JSJitInfo::Method, | ||||
| 15435 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15436 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15437 | false, /* isInfallible. False in setters. */ | ||||
| 15438 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15439 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15440 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15441 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15442 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15443 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15444 | }; | ||||
| 15445 | |||||
| 15446 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15447 | passOptionalArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15448 | { | ||||
| 15449 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalArrayBuffer"); | ||||
| 15450 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15453( cx, "TestJSImplInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15451 | "TestJSImplInterface", "passOptionalArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15453( cx, "TestJSImplInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15452 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15453( cx, "TestJSImplInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15453 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15453( cx, "TestJSImplInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15454 | |||||
| 15455 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15456 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15457 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15458 | if (objIsXray) { | ||||
| 15459 | unwrappedObj.emplace(cx, obj); | ||||
| 15460 | } | ||||
| 15461 | Optional<ArrayBuffer> arg0; | ||||
| 15462 | Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder; | ||||
| 15463 | if (args.hasDefined(0)) { | ||||
| 15464 | arg0.Construct(); | ||||
| 15465 | arg0_holder.emplace(cx, &arg0.Value()); | ||||
| 15466 | if (args[0].isObject()) { | ||||
| 15467 | if (!arg0.Value().Init(&args[0].toObject())) { | ||||
| 15468 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer"); | ||||
| 15469 | return false; | ||||
| 15470 | } | ||||
| 15471 | if (JS::IsSharedArrayBufferObject(arg0.Value().Obj())) { | ||||
| 15472 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15473 | return false; | ||||
| 15474 | } | ||||
| 15475 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().Obj())) { | ||||
| 15476 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15477 | return false; | ||||
| 15478 | } | ||||
| 15479 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().Obj())) { | ||||
| 15480 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15481 | return false; | ||||
| 15482 | } | ||||
| 15483 | } else { | ||||
| 15484 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15485 | return false; | ||||
| 15486 | } | ||||
| 15487 | } | ||||
| 15488 | if (objIsXray) { | ||||
| 15489 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15490 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15491 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15492 | if (!unwrappedObj.ref()) { | ||||
| 15493 | return false; | ||||
| 15494 | } | ||||
| 15495 | } | ||||
| 15496 | FastErrorResult rv; | ||||
| 15497 | // NOTE: This assert does NOT call the function. | ||||
| 15498 | 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"); | ||||
| 15499 | MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15500 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer" )), 0))) { | ||||
| 15501 | return false; | ||||
| 15502 | } | ||||
| 15503 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15503); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15503; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15504 | args.rval().setUndefined(); | ||||
| 15505 | return true; | ||||
| 15506 | } | ||||
| 15507 | |||||
| 15508 | static const JSJitInfo passOptionalArrayBuffer_methodinfo = { | ||||
| 15509 | { (JSJitGetterOp)passOptionalArrayBuffer }, | ||||
| 15510 | { prototypes::id::TestJSImplInterface }, | ||||
| 15511 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15512 | JSJitInfo::Method, | ||||
| 15513 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15514 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15515 | false, /* isInfallible. False in setters. */ | ||||
| 15516 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15517 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15518 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15519 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15520 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15521 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15522 | }; | ||||
| 15523 | |||||
| 15524 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15525 | passOptionalNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15526 | { | ||||
| 15527 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBuffer"); | ||||
| 15528 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15531( cx, "TestJSImplInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15529 | "TestJSImplInterface", "passOptionalNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15531( cx, "TestJSImplInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15530 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15531( cx, "TestJSImplInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15531 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15531( cx, "TestJSImplInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 15532 | |||||
| 15533 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15534 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15535 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15536 | if (objIsXray) { | ||||
| 15537 | unwrappedObj.emplace(cx, obj); | ||||
| 15538 | } | ||||
| 15539 | Optional<Nullable<ArrayBuffer>> arg0; | ||||
| 15540 | Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder; | ||||
| 15541 | if (args.hasDefined(0)) { | ||||
| 15542 | arg0.Construct(); | ||||
| 15543 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 15544 | if (args[0].isObject()) { | ||||
| 15545 | if (!arg0.Value().SetValue().Init(&args[0].toObject())) { | ||||
| 15546 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | ||||
| 15547 | return false; | ||||
| 15548 | } | ||||
| 15549 | if (JS::IsSharedArrayBufferObject(arg0.Value().SetValue().Obj())) { | ||||
| 15550 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15551 | return false; | ||||
| 15552 | } | ||||
| 15553 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) { | ||||
| 15554 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15555 | return false; | ||||
| 15556 | } | ||||
| 15557 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) { | ||||
| 15558 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15559 | return false; | ||||
| 15560 | } | ||||
| 15561 | } else if (args[0].isNullOrUndefined()) { | ||||
| 15562 | arg0.Value().SetNull(); | ||||
| 15563 | } else { | ||||
| 15564 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15565 | return false; | ||||
| 15566 | } | ||||
| 15567 | } | ||||
| 15568 | if (objIsXray) { | ||||
| 15569 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15570 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15571 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15572 | if (!unwrappedObj.ref()) { | ||||
| 15573 | return false; | ||||
| 15574 | } | ||||
| 15575 | } | ||||
| 15576 | FastErrorResult rv; | ||||
| 15577 | // NOTE: This assert does NOT call the function. | ||||
| 15578 | 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"); | ||||
| 15579 | MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15580 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer" )), 0))) { | ||||
| 15581 | return false; | ||||
| 15582 | } | ||||
| 15583 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15583); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15583; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15584 | args.rval().setUndefined(); | ||||
| 15585 | return true; | ||||
| 15586 | } | ||||
| 15587 | |||||
| 15588 | static const JSJitInfo passOptionalNullableArrayBuffer_methodinfo = { | ||||
| 15589 | { (JSJitGetterOp)passOptionalNullableArrayBuffer }, | ||||
| 15590 | { prototypes::id::TestJSImplInterface }, | ||||
| 15591 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15592 | JSJitInfo::Method, | ||||
| 15593 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15594 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15595 | false, /* isInfallible. False in setters. */ | ||||
| 15596 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15597 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15598 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15599 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15600 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15601 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15602 | }; | ||||
| 15603 | |||||
| 15604 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15605 | passOptionalNullableArrayBufferWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15606 | { | ||||
| 15607 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"); | ||||
| 15608 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15611( cx, "TestJSImplInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15609 | "TestJSImplInterface", "passOptionalNullableArrayBufferWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15611( cx, "TestJSImplInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15610 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15611( cx, "TestJSImplInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 15611 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15611( cx, "TestJSImplInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 15612 | |||||
| 15613 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15614 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15615 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15616 | if (objIsXray) { | ||||
| 15617 | unwrappedObj.emplace(cx, obj); | ||||
| 15618 | } | ||||
| 15619 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | ||||
| 15620 | if (args.hasDefined(0)) { | ||||
| 15621 | if (args[0].isObject()) { | ||||
| 15622 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 15623 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | ||||
| 15624 | return false; | ||||
| 15625 | } | ||||
| 15626 | if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) { | ||||
| 15627 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15628 | return false; | ||||
| 15629 | } | ||||
| 15630 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 15631 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15632 | return false; | ||||
| 15633 | } | ||||
| 15634 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 15635 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15636 | return false; | ||||
| 15637 | } | ||||
| 15638 | } else if (args[0].isNullOrUndefined()) { | ||||
| 15639 | arg0.SetNull(); | ||||
| 15640 | } else { | ||||
| 15641 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15642 | return false; | ||||
| 15643 | } | ||||
| 15644 | } else { | ||||
| 15645 | arg0.SetNull(); | ||||
| 15646 | } | ||||
| 15647 | if (objIsXray) { | ||||
| 15648 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15649 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15650 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15651 | if (!unwrappedObj.ref()) { | ||||
| 15652 | return false; | ||||
| 15653 | } | ||||
| 15654 | } | ||||
| 15655 | FastErrorResult rv; | ||||
| 15656 | // NOTE: This assert does NOT call the function. | ||||
| 15657 | 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"); | ||||
| 15658 | MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15659 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue" )), 0))) { | ||||
| 15660 | return false; | ||||
| 15661 | } | ||||
| 15662 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15662); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15662; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15663 | args.rval().setUndefined(); | ||||
| 15664 | return true; | ||||
| 15665 | } | ||||
| 15666 | |||||
| 15667 | static const JSJitInfo passOptionalNullableArrayBufferWithDefaultValue_methodinfo = { | ||||
| 15668 | { (JSJitGetterOp)passOptionalNullableArrayBufferWithDefaultValue }, | ||||
| 15669 | { prototypes::id::TestJSImplInterface }, | ||||
| 15670 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15671 | JSJitInfo::Method, | ||||
| 15672 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15673 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15674 | false, /* isInfallible. False in setters. */ | ||||
| 15675 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15676 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15677 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15678 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15679 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15680 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15681 | }; | ||||
| 15682 | |||||
| 15683 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15684 | passArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15685 | { | ||||
| 15686 | BindingCallContext cx(cx_, "TestJSImplInterface.passArrayBufferView"); | ||||
| 15687 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15690( cx, "TestJSImplInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15688 | "TestJSImplInterface", "passArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15690( cx, "TestJSImplInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15689 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15690( cx, "TestJSImplInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15690 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15690( cx, "TestJSImplInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15691 | |||||
| 15692 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15693 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passArrayBufferView", 1)) { | ||||
| 15694 | return false; | ||||
| 15695 | } | ||||
| 15696 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15697 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15698 | if (objIsXray) { | ||||
| 15699 | unwrappedObj.emplace(cx, obj); | ||||
| 15700 | } | ||||
| 15701 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | ||||
| 15702 | if (args[0].isObject()) { | ||||
| 15703 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 15704 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView"); | ||||
| 15705 | return false; | ||||
| 15706 | } | ||||
| 15707 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 15708 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15709 | return false; | ||||
| 15710 | } | ||||
| 15711 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 15712 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15713 | return false; | ||||
| 15714 | } | ||||
| 15715 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 15716 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15717 | return false; | ||||
| 15718 | } | ||||
| 15719 | } else { | ||||
| 15720 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15721 | return false; | ||||
| 15722 | } | ||||
| 15723 | if (objIsXray) { | ||||
| 15724 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15725 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15726 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15727 | if (!unwrappedObj.ref()) { | ||||
| 15728 | return false; | ||||
| 15729 | } | ||||
| 15730 | } | ||||
| 15731 | FastErrorResult rv; | ||||
| 15732 | // NOTE: This assert does NOT call the function. | ||||
| 15733 | 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"); | ||||
| 15734 | MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15735 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView" )), 0))) { | ||||
| 15736 | return false; | ||||
| 15737 | } | ||||
| 15738 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15738); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15738; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15739 | args.rval().setUndefined(); | ||||
| 15740 | return true; | ||||
| 15741 | } | ||||
| 15742 | |||||
| 15743 | static const JSJitInfo passArrayBufferView_methodinfo = { | ||||
| 15744 | { (JSJitGetterOp)passArrayBufferView }, | ||||
| 15745 | { prototypes::id::TestJSImplInterface }, | ||||
| 15746 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15747 | JSJitInfo::Method, | ||||
| 15748 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15749 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15750 | false, /* isInfallible. False in setters. */ | ||||
| 15751 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15752 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15753 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15754 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15755 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15756 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15757 | }; | ||||
| 15758 | |||||
| 15759 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15760 | passInt8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15761 | { | ||||
| 15762 | BindingCallContext cx(cx_, "TestJSImplInterface.passInt8Array"); | ||||
| 15763 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15766( cx, "TestJSImplInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15764 | "TestJSImplInterface", "passInt8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15766( cx, "TestJSImplInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15765 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15766( cx, "TestJSImplInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15766 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15766( cx, "TestJSImplInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15767 | |||||
| 15768 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15769 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt8Array", 1)) { | ||||
| 15770 | return false; | ||||
| 15771 | } | ||||
| 15772 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15773 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15774 | if (objIsXray) { | ||||
| 15775 | unwrappedObj.emplace(cx, obj); | ||||
| 15776 | } | ||||
| 15777 | RootedSpiderMonkeyInterface<Int8Array> arg0(cx); | ||||
| 15778 | if (args[0].isObject()) { | ||||
| 15779 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 15780 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int8Array"); | ||||
| 15781 | return false; | ||||
| 15782 | } | ||||
| 15783 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 15784 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15785 | return false; | ||||
| 15786 | } | ||||
| 15787 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 15788 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15789 | return false; | ||||
| 15790 | } | ||||
| 15791 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 15792 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15793 | return false; | ||||
| 15794 | } | ||||
| 15795 | } else { | ||||
| 15796 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15797 | return false; | ||||
| 15798 | } | ||||
| 15799 | if (objIsXray) { | ||||
| 15800 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15801 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15802 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15803 | if (!unwrappedObj.ref()) { | ||||
| 15804 | return false; | ||||
| 15805 | } | ||||
| 15806 | } | ||||
| 15807 | FastErrorResult rv; | ||||
| 15808 | // NOTE: This assert does NOT call the function. | ||||
| 15809 | 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"); | ||||
| 15810 | MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15811 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array" )), 0))) { | ||||
| 15812 | return false; | ||||
| 15813 | } | ||||
| 15814 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15814); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15814; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15815 | args.rval().setUndefined(); | ||||
| 15816 | return true; | ||||
| 15817 | } | ||||
| 15818 | |||||
| 15819 | static const JSJitInfo passInt8Array_methodinfo = { | ||||
| 15820 | { (JSJitGetterOp)passInt8Array }, | ||||
| 15821 | { prototypes::id::TestJSImplInterface }, | ||||
| 15822 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15823 | JSJitInfo::Method, | ||||
| 15824 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15825 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15826 | false, /* isInfallible. False in setters. */ | ||||
| 15827 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15828 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15829 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15830 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15831 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15832 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15833 | }; | ||||
| 15834 | |||||
| 15835 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15836 | passInt16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15837 | { | ||||
| 15838 | BindingCallContext cx(cx_, "TestJSImplInterface.passInt16Array"); | ||||
| 15839 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15842( cx, "TestJSImplInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15840 | "TestJSImplInterface", "passInt16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15842( cx, "TestJSImplInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15841 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15842( cx, "TestJSImplInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15842 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15842( cx, "TestJSImplInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15843 | |||||
| 15844 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15845 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt16Array", 1)) { | ||||
| 15846 | return false; | ||||
| 15847 | } | ||||
| 15848 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15849 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15850 | if (objIsXray) { | ||||
| 15851 | unwrappedObj.emplace(cx, obj); | ||||
| 15852 | } | ||||
| 15853 | RootedSpiderMonkeyInterface<Int16Array> arg0(cx); | ||||
| 15854 | if (args[0].isObject()) { | ||||
| 15855 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 15856 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int16Array"); | ||||
| 15857 | return false; | ||||
| 15858 | } | ||||
| 15859 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 15860 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15861 | return false; | ||||
| 15862 | } | ||||
| 15863 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 15864 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15865 | return false; | ||||
| 15866 | } | ||||
| 15867 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 15868 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15869 | return false; | ||||
| 15870 | } | ||||
| 15871 | } else { | ||||
| 15872 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15873 | return false; | ||||
| 15874 | } | ||||
| 15875 | if (objIsXray) { | ||||
| 15876 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15877 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15878 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15879 | if (!unwrappedObj.ref()) { | ||||
| 15880 | return false; | ||||
| 15881 | } | ||||
| 15882 | } | ||||
| 15883 | FastErrorResult rv; | ||||
| 15884 | // NOTE: This assert does NOT call the function. | ||||
| 15885 | 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"); | ||||
| 15886 | MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15887 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array" )), 0))) { | ||||
| 15888 | return false; | ||||
| 15889 | } | ||||
| 15890 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15890); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15890; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15891 | args.rval().setUndefined(); | ||||
| 15892 | return true; | ||||
| 15893 | } | ||||
| 15894 | |||||
| 15895 | static const JSJitInfo passInt16Array_methodinfo = { | ||||
| 15896 | { (JSJitGetterOp)passInt16Array }, | ||||
| 15897 | { prototypes::id::TestJSImplInterface }, | ||||
| 15898 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15899 | JSJitInfo::Method, | ||||
| 15900 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15901 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15902 | false, /* isInfallible. False in setters. */ | ||||
| 15903 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15904 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15905 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15906 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15907 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15908 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15909 | }; | ||||
| 15910 | |||||
| 15911 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15912 | passInt32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15913 | { | ||||
| 15914 | BindingCallContext cx(cx_, "TestJSImplInterface.passInt32Array"); | ||||
| 15915 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15918( cx, "TestJSImplInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15916 | "TestJSImplInterface", "passInt32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15918( cx, "TestJSImplInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15917 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15918( cx, "TestJSImplInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15918 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15918( cx, "TestJSImplInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15919 | |||||
| 15920 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15921 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt32Array", 1)) { | ||||
| 15922 | return false; | ||||
| 15923 | } | ||||
| 15924 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 15925 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 15926 | if (objIsXray) { | ||||
| 15927 | unwrappedObj.emplace(cx, obj); | ||||
| 15928 | } | ||||
| 15929 | RootedSpiderMonkeyInterface<Int32Array> arg0(cx); | ||||
| 15930 | if (args[0].isObject()) { | ||||
| 15931 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 15932 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int32Array"); | ||||
| 15933 | return false; | ||||
| 15934 | } | ||||
| 15935 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 15936 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 15937 | return false; | ||||
| 15938 | } | ||||
| 15939 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 15940 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 15941 | return false; | ||||
| 15942 | } | ||||
| 15943 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 15944 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 15945 | return false; | ||||
| 15946 | } | ||||
| 15947 | } else { | ||||
| 15948 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 15949 | return false; | ||||
| 15950 | } | ||||
| 15951 | if (objIsXray) { | ||||
| 15952 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 15953 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 15954 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 15955 | if (!unwrappedObj.ref()) { | ||||
| 15956 | return false; | ||||
| 15957 | } | ||||
| 15958 | } | ||||
| 15959 | FastErrorResult rv; | ||||
| 15960 | // NOTE: This assert does NOT call the function. | ||||
| 15961 | 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"); | ||||
| 15962 | MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 15963 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array" )), 0))) { | ||||
| 15964 | return false; | ||||
| 15965 | } | ||||
| 15966 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 15966); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15966; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 15967 | args.rval().setUndefined(); | ||||
| 15968 | return true; | ||||
| 15969 | } | ||||
| 15970 | |||||
| 15971 | static const JSJitInfo passInt32Array_methodinfo = { | ||||
| 15972 | { (JSJitGetterOp)passInt32Array }, | ||||
| 15973 | { prototypes::id::TestJSImplInterface }, | ||||
| 15974 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 15975 | JSJitInfo::Method, | ||||
| 15976 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 15977 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 15978 | false, /* isInfallible. False in setters. */ | ||||
| 15979 | false, /* isMovable. Not relevant for setters. */ | ||||
| 15980 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 15981 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 15982 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 15983 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 15984 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 15985 | }; | ||||
| 15986 | |||||
| 15987 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 15988 | passUint8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 15989 | { | ||||
| 15990 | BindingCallContext cx(cx_, "TestJSImplInterface.passUint8Array"); | ||||
| 15991 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15994( cx, "TestJSImplInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15992 | "TestJSImplInterface", "passUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15994( cx, "TestJSImplInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15993 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15994( cx, "TestJSImplInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 15994 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15994( cx, "TestJSImplInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 15995 | |||||
| 15996 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 15997 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8Array", 1)) { | ||||
| 15998 | return false; | ||||
| 15999 | } | ||||
| 16000 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16001 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16002 | if (objIsXray) { | ||||
| 16003 | unwrappedObj.emplace(cx, obj); | ||||
| 16004 | } | ||||
| 16005 | RootedSpiderMonkeyInterface<Uint8Array> arg0(cx); | ||||
| 16006 | if (args[0].isObject()) { | ||||
| 16007 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16008 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8Array"); | ||||
| 16009 | return false; | ||||
| 16010 | } | ||||
| 16011 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16012 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16013 | return false; | ||||
| 16014 | } | ||||
| 16015 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16016 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16017 | return false; | ||||
| 16018 | } | ||||
| 16019 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16020 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16021 | return false; | ||||
| 16022 | } | ||||
| 16023 | } else { | ||||
| 16024 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16025 | return false; | ||||
| 16026 | } | ||||
| 16027 | if (objIsXray) { | ||||
| 16028 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16029 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16030 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16031 | if (!unwrappedObj.ref()) { | ||||
| 16032 | return false; | ||||
| 16033 | } | ||||
| 16034 | } | ||||
| 16035 | FastErrorResult rv; | ||||
| 16036 | // NOTE: This assert does NOT call the function. | ||||
| 16037 | 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"); | ||||
| 16038 | MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16039 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array" )), 0))) { | ||||
| 16040 | return false; | ||||
| 16041 | } | ||||
| 16042 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16042); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16042; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16043 | args.rval().setUndefined(); | ||||
| 16044 | return true; | ||||
| 16045 | } | ||||
| 16046 | |||||
| 16047 | static const JSJitInfo passUint8Array_methodinfo = { | ||||
| 16048 | { (JSJitGetterOp)passUint8Array }, | ||||
| 16049 | { prototypes::id::TestJSImplInterface }, | ||||
| 16050 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16051 | JSJitInfo::Method, | ||||
| 16052 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16053 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16054 | false, /* isInfallible. False in setters. */ | ||||
| 16055 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16056 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16057 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16058 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16059 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16060 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16061 | }; | ||||
| 16062 | |||||
| 16063 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16064 | passUint16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16065 | { | ||||
| 16066 | BindingCallContext cx(cx_, "TestJSImplInterface.passUint16Array"); | ||||
| 16067 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16070( cx, "TestJSImplInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16068 | "TestJSImplInterface", "passUint16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16070( cx, "TestJSImplInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16069 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16070( cx, "TestJSImplInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16070 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16070( cx, "TestJSImplInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16071 | |||||
| 16072 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16073 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint16Array", 1)) { | ||||
| 16074 | return false; | ||||
| 16075 | } | ||||
| 16076 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16077 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16078 | if (objIsXray) { | ||||
| 16079 | unwrappedObj.emplace(cx, obj); | ||||
| 16080 | } | ||||
| 16081 | RootedSpiderMonkeyInterface<Uint16Array> arg0(cx); | ||||
| 16082 | if (args[0].isObject()) { | ||||
| 16083 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16084 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint16Array"); | ||||
| 16085 | return false; | ||||
| 16086 | } | ||||
| 16087 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16088 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16089 | return false; | ||||
| 16090 | } | ||||
| 16091 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16092 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16093 | return false; | ||||
| 16094 | } | ||||
| 16095 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16096 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16097 | return false; | ||||
| 16098 | } | ||||
| 16099 | } else { | ||||
| 16100 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16101 | return false; | ||||
| 16102 | } | ||||
| 16103 | if (objIsXray) { | ||||
| 16104 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16105 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16106 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16107 | if (!unwrappedObj.ref()) { | ||||
| 16108 | return false; | ||||
| 16109 | } | ||||
| 16110 | } | ||||
| 16111 | FastErrorResult rv; | ||||
| 16112 | // NOTE: This assert does NOT call the function. | ||||
| 16113 | 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"); | ||||
| 16114 | MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16115 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array" )), 0))) { | ||||
| 16116 | return false; | ||||
| 16117 | } | ||||
| 16118 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16118); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16118; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16119 | args.rval().setUndefined(); | ||||
| 16120 | return true; | ||||
| 16121 | } | ||||
| 16122 | |||||
| 16123 | static const JSJitInfo passUint16Array_methodinfo = { | ||||
| 16124 | { (JSJitGetterOp)passUint16Array }, | ||||
| 16125 | { prototypes::id::TestJSImplInterface }, | ||||
| 16126 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16127 | JSJitInfo::Method, | ||||
| 16128 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16129 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16130 | false, /* isInfallible. False in setters. */ | ||||
| 16131 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16132 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16133 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16134 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16135 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16136 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16137 | }; | ||||
| 16138 | |||||
| 16139 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16140 | passUint32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16141 | { | ||||
| 16142 | BindingCallContext cx(cx_, "TestJSImplInterface.passUint32Array"); | ||||
| 16143 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16146( cx, "TestJSImplInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16144 | "TestJSImplInterface", "passUint32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16146( cx, "TestJSImplInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16145 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16146( cx, "TestJSImplInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16146 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16146( cx, "TestJSImplInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16147 | |||||
| 16148 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16149 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint32Array", 1)) { | ||||
| 16150 | return false; | ||||
| 16151 | } | ||||
| 16152 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16153 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16154 | if (objIsXray) { | ||||
| 16155 | unwrappedObj.emplace(cx, obj); | ||||
| 16156 | } | ||||
| 16157 | RootedSpiderMonkeyInterface<Uint32Array> arg0(cx); | ||||
| 16158 | if (args[0].isObject()) { | ||||
| 16159 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16160 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint32Array"); | ||||
| 16161 | return false; | ||||
| 16162 | } | ||||
| 16163 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16164 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16165 | return false; | ||||
| 16166 | } | ||||
| 16167 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16168 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16169 | return false; | ||||
| 16170 | } | ||||
| 16171 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16172 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16173 | return false; | ||||
| 16174 | } | ||||
| 16175 | } else { | ||||
| 16176 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16177 | return false; | ||||
| 16178 | } | ||||
| 16179 | if (objIsXray) { | ||||
| 16180 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16181 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16182 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16183 | if (!unwrappedObj.ref()) { | ||||
| 16184 | return false; | ||||
| 16185 | } | ||||
| 16186 | } | ||||
| 16187 | FastErrorResult rv; | ||||
| 16188 | // NOTE: This assert does NOT call the function. | ||||
| 16189 | 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"); | ||||
| 16190 | MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16191 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array" )), 0))) { | ||||
| 16192 | return false; | ||||
| 16193 | } | ||||
| 16194 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16194); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16194; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16195 | args.rval().setUndefined(); | ||||
| 16196 | return true; | ||||
| 16197 | } | ||||
| 16198 | |||||
| 16199 | static const JSJitInfo passUint32Array_methodinfo = { | ||||
| 16200 | { (JSJitGetterOp)passUint32Array }, | ||||
| 16201 | { prototypes::id::TestJSImplInterface }, | ||||
| 16202 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16203 | JSJitInfo::Method, | ||||
| 16204 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16205 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16206 | false, /* isInfallible. False in setters. */ | ||||
| 16207 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16208 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16209 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16210 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16211 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16212 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16213 | }; | ||||
| 16214 | |||||
| 16215 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16216 | passUint8ClampedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16217 | { | ||||
| 16218 | BindingCallContext cx(cx_, "TestJSImplInterface.passUint8ClampedArray"); | ||||
| 16219 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16222( cx, "TestJSImplInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16220 | "TestJSImplInterface", "passUint8ClampedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16222( cx, "TestJSImplInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16221 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16222( cx, "TestJSImplInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16222 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16222( cx, "TestJSImplInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16223 | |||||
| 16224 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16225 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8ClampedArray", 1)) { | ||||
| 16226 | return false; | ||||
| 16227 | } | ||||
| 16228 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16229 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16230 | if (objIsXray) { | ||||
| 16231 | unwrappedObj.emplace(cx, obj); | ||||
| 16232 | } | ||||
| 16233 | RootedSpiderMonkeyInterface<Uint8ClampedArray> arg0(cx); | ||||
| 16234 | if (args[0].isObject()) { | ||||
| 16235 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16236 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8ClampedArray"); | ||||
| 16237 | return false; | ||||
| 16238 | } | ||||
| 16239 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16240 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16241 | return false; | ||||
| 16242 | } | ||||
| 16243 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16244 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16245 | return false; | ||||
| 16246 | } | ||||
| 16247 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16248 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16249 | return false; | ||||
| 16250 | } | ||||
| 16251 | } else { | ||||
| 16252 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16253 | return false; | ||||
| 16254 | } | ||||
| 16255 | if (objIsXray) { | ||||
| 16256 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16257 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16258 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16259 | if (!unwrappedObj.ref()) { | ||||
| 16260 | return false; | ||||
| 16261 | } | ||||
| 16262 | } | ||||
| 16263 | FastErrorResult rv; | ||||
| 16264 | // NOTE: This assert does NOT call the function. | ||||
| 16265 | 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"); | ||||
| 16266 | MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16267 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray" )), 0))) { | ||||
| 16268 | return false; | ||||
| 16269 | } | ||||
| 16270 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16270); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16270; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16271 | args.rval().setUndefined(); | ||||
| 16272 | return true; | ||||
| 16273 | } | ||||
| 16274 | |||||
| 16275 | static const JSJitInfo passUint8ClampedArray_methodinfo = { | ||||
| 16276 | { (JSJitGetterOp)passUint8ClampedArray }, | ||||
| 16277 | { prototypes::id::TestJSImplInterface }, | ||||
| 16278 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16279 | JSJitInfo::Method, | ||||
| 16280 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16281 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16282 | false, /* isInfallible. False in setters. */ | ||||
| 16283 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16284 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16285 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16286 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16287 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16288 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16289 | }; | ||||
| 16290 | |||||
| 16291 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16292 | passFloat32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16293 | { | ||||
| 16294 | BindingCallContext cx(cx_, "TestJSImplInterface.passFloat32Array"); | ||||
| 16295 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16298( cx, "TestJSImplInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16296 | "TestJSImplInterface", "passFloat32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16298( cx, "TestJSImplInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16297 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16298( cx, "TestJSImplInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16298 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16298( cx, "TestJSImplInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16299 | |||||
| 16300 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16301 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat32Array", 1)) { | ||||
| 16302 | return false; | ||||
| 16303 | } | ||||
| 16304 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16305 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16306 | if (objIsXray) { | ||||
| 16307 | unwrappedObj.emplace(cx, obj); | ||||
| 16308 | } | ||||
| 16309 | RootedSpiderMonkeyInterface<Float32Array> arg0(cx); | ||||
| 16310 | if (args[0].isObject()) { | ||||
| 16311 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16312 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array"); | ||||
| 16313 | return false; | ||||
| 16314 | } | ||||
| 16315 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16316 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16317 | return false; | ||||
| 16318 | } | ||||
| 16319 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16320 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16321 | return false; | ||||
| 16322 | } | ||||
| 16323 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16324 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16325 | return false; | ||||
| 16326 | } | ||||
| 16327 | } else { | ||||
| 16328 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16329 | return false; | ||||
| 16330 | } | ||||
| 16331 | if (objIsXray) { | ||||
| 16332 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16333 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16334 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16335 | if (!unwrappedObj.ref()) { | ||||
| 16336 | return false; | ||||
| 16337 | } | ||||
| 16338 | } | ||||
| 16339 | FastErrorResult rv; | ||||
| 16340 | // NOTE: This assert does NOT call the function. | ||||
| 16341 | 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"); | ||||
| 16342 | MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16343 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array" )), 0))) { | ||||
| 16344 | return false; | ||||
| 16345 | } | ||||
| 16346 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16346); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16346; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16347 | args.rval().setUndefined(); | ||||
| 16348 | return true; | ||||
| 16349 | } | ||||
| 16350 | |||||
| 16351 | static const JSJitInfo passFloat32Array_methodinfo = { | ||||
| 16352 | { (JSJitGetterOp)passFloat32Array }, | ||||
| 16353 | { prototypes::id::TestJSImplInterface }, | ||||
| 16354 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16355 | JSJitInfo::Method, | ||||
| 16356 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16357 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16358 | false, /* isInfallible. False in setters. */ | ||||
| 16359 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16360 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16361 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16362 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16363 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16364 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16365 | }; | ||||
| 16366 | |||||
| 16367 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16368 | passFloat64Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16369 | { | ||||
| 16370 | BindingCallContext cx(cx_, "TestJSImplInterface.passFloat64Array"); | ||||
| 16371 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16374( cx, "TestJSImplInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16372 | "TestJSImplInterface", "passFloat64Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16374( cx, "TestJSImplInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16373 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16374( cx, "TestJSImplInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16374 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16374( cx, "TestJSImplInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16375 | |||||
| 16376 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16377 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat64Array", 1)) { | ||||
| 16378 | return false; | ||||
| 16379 | } | ||||
| 16380 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16381 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16382 | if (objIsXray) { | ||||
| 16383 | unwrappedObj.emplace(cx, obj); | ||||
| 16384 | } | ||||
| 16385 | RootedSpiderMonkeyInterface<Float64Array> arg0(cx); | ||||
| 16386 | if (args[0].isObject()) { | ||||
| 16387 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 16388 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float64Array"); | ||||
| 16389 | return false; | ||||
| 16390 | } | ||||
| 16391 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 16392 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16393 | return false; | ||||
| 16394 | } | ||||
| 16395 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 16396 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16397 | return false; | ||||
| 16398 | } | ||||
| 16399 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 16400 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 16401 | return false; | ||||
| 16402 | } | ||||
| 16403 | } else { | ||||
| 16404 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16405 | return false; | ||||
| 16406 | } | ||||
| 16407 | if (objIsXray) { | ||||
| 16408 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16409 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16410 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16411 | if (!unwrappedObj.ref()) { | ||||
| 16412 | return false; | ||||
| 16413 | } | ||||
| 16414 | } | ||||
| 16415 | FastErrorResult rv; | ||||
| 16416 | // NOTE: This assert does NOT call the function. | ||||
| 16417 | 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"); | ||||
| 16418 | MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16419 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array" )), 0))) { | ||||
| 16420 | return false; | ||||
| 16421 | } | ||||
| 16422 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16422); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16422; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16423 | args.rval().setUndefined(); | ||||
| 16424 | return true; | ||||
| 16425 | } | ||||
| 16426 | |||||
| 16427 | static const JSJitInfo passFloat64Array_methodinfo = { | ||||
| 16428 | { (JSJitGetterOp)passFloat64Array }, | ||||
| 16429 | { prototypes::id::TestJSImplInterface }, | ||||
| 16430 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16431 | JSJitInfo::Method, | ||||
| 16432 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16433 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16434 | false, /* isInfallible. False in setters. */ | ||||
| 16435 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16436 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16437 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16438 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16439 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16440 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16441 | }; | ||||
| 16442 | |||||
| 16443 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16444 | passSequenceOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16445 | { | ||||
| 16446 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfArrayBuffers"); | ||||
| 16447 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16450( cx, "TestJSImplInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16448 | "TestJSImplInterface", "passSequenceOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16450( cx, "TestJSImplInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16449 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16450( cx, "TestJSImplInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16450 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16450( cx, "TestJSImplInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 16451 | |||||
| 16452 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16453 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfArrayBuffers", 1)) { | ||||
| 16454 | return false; | ||||
| 16455 | } | ||||
| 16456 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16457 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16458 | if (objIsXray) { | ||||
| 16459 | unwrappedObj.emplace(cx, obj); | ||||
| 16460 | } | ||||
| 16461 | binding_detail::AutoSequence<ArrayBuffer> arg0; | ||||
| 16462 | SequenceRooter<ArrayBuffer> arg0_holder(cx, &arg0); | ||||
| 16463 | if (args[0].isObject()) { | ||||
| 16464 | JS::ForOfIterator iter(cx); | ||||
| 16465 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 16466 | return false; | ||||
| 16467 | } | ||||
| 16468 | if (!iter.valueIsIterable()) { | ||||
| 16469 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 16470 | return false; | ||||
| 16471 | } | ||||
| 16472 | binding_detail::AutoSequence<ArrayBuffer> &arr = arg0; | ||||
| 16473 | JS::Rooted<JS::Value> temp(cx); | ||||
| 16474 | while (true) { | ||||
| 16475 | bool done; | ||||
| 16476 | if (!iter.next(&temp, &done)) { | ||||
| 16477 | return false; | ||||
| 16478 | } | ||||
| 16479 | if (done) { | ||||
| 16480 | break; | ||||
| 16481 | } | ||||
| 16482 | ArrayBuffer* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 16483 | if (!slotPtr) { | ||||
| 16484 | JS_ReportOutOfMemory(cx); | ||||
| 16485 | return false; | ||||
| 16486 | } | ||||
| 16487 | ArrayBuffer& slot = *slotPtr; | ||||
| 16488 | if (temp.isObject()) { | ||||
| 16489 | if (!slot.Init(&temp.toObject())) { | ||||
| 16490 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBuffer"); | ||||
| 16491 | return false; | ||||
| 16492 | } | ||||
| 16493 | if (JS::IsSharedArrayBufferObject(slot.Obj())) { | ||||
| 16494 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1"); | ||||
| 16495 | return false; | ||||
| 16496 | } | ||||
| 16497 | if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) { | ||||
| 16498 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1"); | ||||
| 16499 | return false; | ||||
| 16500 | } | ||||
| 16501 | if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) { | ||||
| 16502 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1"); | ||||
| 16503 | return false; | ||||
| 16504 | } | ||||
| 16505 | } else { | ||||
| 16506 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 16507 | return false; | ||||
| 16508 | } | ||||
| 16509 | } | ||||
| 16510 | } else { | ||||
| 16511 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 16512 | return false; | ||||
| 16513 | } | ||||
| 16514 | if (objIsXray) { | ||||
| 16515 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16516 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16517 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16518 | if (!unwrappedObj.ref()) { | ||||
| 16519 | return false; | ||||
| 16520 | } | ||||
| 16521 | } | ||||
| 16522 | FastErrorResult rv; | ||||
| 16523 | // NOTE: This assert does NOT call the function. | ||||
| 16524 | 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"); | ||||
| 16525 | MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16526 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers" )), 0))) { | ||||
| 16527 | return false; | ||||
| 16528 | } | ||||
| 16529 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16529); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16529; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16530 | args.rval().setUndefined(); | ||||
| 16531 | return true; | ||||
| 16532 | } | ||||
| 16533 | |||||
| 16534 | static const JSJitInfo passSequenceOfArrayBuffers_methodinfo = { | ||||
| 16535 | { (JSJitGetterOp)passSequenceOfArrayBuffers }, | ||||
| 16536 | { prototypes::id::TestJSImplInterface }, | ||||
| 16537 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16538 | JSJitInfo::Method, | ||||
| 16539 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16540 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16541 | false, /* isInfallible. False in setters. */ | ||||
| 16542 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16543 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16544 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16545 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16546 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16547 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16548 | }; | ||||
| 16549 | |||||
| 16550 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16551 | passSequenceOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16552 | { | ||||
| 16553 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"); | ||||
| 16554 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16557( cx, "TestJSImplInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16555 | "TestJSImplInterface", "passSequenceOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16557( cx, "TestJSImplInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16556 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16557( cx, "TestJSImplInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16557 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16557( cx, "TestJSImplInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 16558 | |||||
| 16559 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16560 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", 1)) { | ||||
| 16561 | return false; | ||||
| 16562 | } | ||||
| 16563 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16564 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16565 | if (objIsXray) { | ||||
| 16566 | unwrappedObj.emplace(cx, obj); | ||||
| 16567 | } | ||||
| 16568 | binding_detail::AutoSequence<Nullable<ArrayBuffer>> arg0; | ||||
| 16569 | SequenceRooter<Nullable<ArrayBuffer>> arg0_holder(cx, &arg0); | ||||
| 16570 | if (args[0].isObject()) { | ||||
| 16571 | JS::ForOfIterator iter(cx); | ||||
| 16572 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 16573 | return false; | ||||
| 16574 | } | ||||
| 16575 | if (!iter.valueIsIterable()) { | ||||
| 16576 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 16577 | return false; | ||||
| 16578 | } | ||||
| 16579 | binding_detail::AutoSequence<Nullable<ArrayBuffer>> &arr = arg0; | ||||
| 16580 | JS::Rooted<JS::Value> temp(cx); | ||||
| 16581 | while (true) { | ||||
| 16582 | bool done; | ||||
| 16583 | if (!iter.next(&temp, &done)) { | ||||
| 16584 | return false; | ||||
| 16585 | } | ||||
| 16586 | if (done) { | ||||
| 16587 | break; | ||||
| 16588 | } | ||||
| 16589 | Nullable<ArrayBuffer>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 16590 | if (!slotPtr) { | ||||
| 16591 | JS_ReportOutOfMemory(cx); | ||||
| 16592 | return false; | ||||
| 16593 | } | ||||
| 16594 | Nullable<ArrayBuffer>& slot = *slotPtr; | ||||
| 16595 | if (temp.isObject()) { | ||||
| 16596 | if (!slot.SetValue().Init(&temp.toObject())) { | ||||
| 16597 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBufferOrNull"); | ||||
| 16598 | return false; | ||||
| 16599 | } | ||||
| 16600 | if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) { | ||||
| 16601 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1"); | ||||
| 16602 | return false; | ||||
| 16603 | } | ||||
| 16604 | if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) { | ||||
| 16605 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1"); | ||||
| 16606 | return false; | ||||
| 16607 | } | ||||
| 16608 | if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) { | ||||
| 16609 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1"); | ||||
| 16610 | return false; | ||||
| 16611 | } | ||||
| 16612 | } else if (temp.isNullOrUndefined()) { | ||||
| 16613 | slot.SetNull(); | ||||
| 16614 | } else { | ||||
| 16615 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 16616 | return false; | ||||
| 16617 | } | ||||
| 16618 | } | ||||
| 16619 | } else { | ||||
| 16620 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 16621 | return false; | ||||
| 16622 | } | ||||
| 16623 | if (objIsXray) { | ||||
| 16624 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16625 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16626 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16627 | if (!unwrappedObj.ref()) { | ||||
| 16628 | return false; | ||||
| 16629 | } | ||||
| 16630 | } | ||||
| 16631 | FastErrorResult rv; | ||||
| 16632 | // NOTE: This assert does NOT call the function. | ||||
| 16633 | 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"); | ||||
| 16634 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16635 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers" )), 0))) { | ||||
| 16636 | return false; | ||||
| 16637 | } | ||||
| 16638 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16638); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16638; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16639 | args.rval().setUndefined(); | ||||
| 16640 | return true; | ||||
| 16641 | } | ||||
| 16642 | |||||
| 16643 | static const JSJitInfo passSequenceOfNullableArrayBuffers_methodinfo = { | ||||
| 16644 | { (JSJitGetterOp)passSequenceOfNullableArrayBuffers }, | ||||
| 16645 | { prototypes::id::TestJSImplInterface }, | ||||
| 16646 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16647 | JSJitInfo::Method, | ||||
| 16648 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16649 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16650 | false, /* isInfallible. False in setters. */ | ||||
| 16651 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16652 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16653 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16654 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16655 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16656 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16657 | }; | ||||
| 16658 | |||||
| 16659 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16660 | passRecordOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16661 | { | ||||
| 16662 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfArrayBuffers"); | ||||
| 16663 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16666( cx, "TestJSImplInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16664 | "TestJSImplInterface", "passRecordOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16666( cx, "TestJSImplInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16665 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16666( cx, "TestJSImplInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16666 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16666( cx, "TestJSImplInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 16667 | |||||
| 16668 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16669 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfArrayBuffers", 1)) { | ||||
| 16670 | return false; | ||||
| 16671 | } | ||||
| 16672 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16673 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16674 | if (objIsXray) { | ||||
| 16675 | unwrappedObj.emplace(cx, obj); | ||||
| 16676 | } | ||||
| 16677 | Record<nsString, ArrayBuffer> arg0; | ||||
| 16678 | RecordRooter<nsString, ArrayBuffer> arg0_holder(cx, &arg0); | ||||
| 16679 | if (args[0].isObject()) { | ||||
| 16680 | auto& recordEntries = arg0.Entries(); | ||||
| 16681 | |||||
| 16682 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 16683 | JS::RootedVector<jsid> ids(cx); | ||||
| 16684 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 16685 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 16686 | return false; | ||||
| 16687 | } | ||||
| 16688 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 16689 | JS_ReportOutOfMemory(cx); | ||||
| 16690 | return false; | ||||
| 16691 | } | ||||
| 16692 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 16693 | JS::Rooted<JS::Value> temp(cx); | ||||
| 16694 | JS::Rooted<jsid> curId(cx); | ||||
| 16695 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 16696 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 16697 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 16698 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 16699 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 16700 | // around. | ||||
| 16701 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 16702 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 16703 | curId = ids[i]; | ||||
| 16704 | |||||
| 16705 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 16706 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 16707 | &desc)) { | ||||
| 16708 | return false; | ||||
| 16709 | } | ||||
| 16710 | |||||
| 16711 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 16712 | continue; | ||||
| 16713 | } | ||||
| 16714 | |||||
| 16715 | idVal = js::IdToValue(curId); | ||||
| 16716 | nsString propName; | ||||
| 16717 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 16718 | // to do. | ||||
| 16719 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 16720 | return false; | ||||
| 16721 | } | ||||
| 16722 | |||||
| 16723 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 16724 | return false; | ||||
| 16725 | } | ||||
| 16726 | |||||
| 16727 | Record<nsString, ArrayBuffer>::EntryType* entry; | ||||
| 16728 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 16729 | // Find the existing entry. | ||||
| 16730 | auto idx = recordEntries.IndexOf(propName); | ||||
| 16731 | 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", 16732); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 16732; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 16732 | "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", 16732); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 16732; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 16733 | // Now blow it away to make it look like it was just added | ||||
| 16734 | // to the array, because it's not obvious that it's | ||||
| 16735 | // safe to write to its already-initialized mValue via our | ||||
| 16736 | // normal codegen conversions. For example, the value | ||||
| 16737 | // could be a union and this would change its type, but | ||||
| 16738 | // codegen assumes we won't do that. | ||||
| 16739 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 16740 | } else { | ||||
| 16741 | // Safe to do an infallible append here, because we did a | ||||
| 16742 | // SetCapacity above to the right capacity. | ||||
| 16743 | entry = recordEntries.AppendElement(); | ||||
| 16744 | } | ||||
| 16745 | entry->mKey = propName; | ||||
| 16746 | ArrayBuffer& slot = entry->mValue; | ||||
| 16747 | if (temp.isObject()) { | ||||
| 16748 | if (!slot.Init(&temp.toObject())) { | ||||
| 16749 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBuffer"); | ||||
| 16750 | return false; | ||||
| 16751 | } | ||||
| 16752 | if (JS::IsSharedArrayBufferObject(slot.Obj())) { | ||||
| 16753 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1"); | ||||
| 16754 | return false; | ||||
| 16755 | } | ||||
| 16756 | if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) { | ||||
| 16757 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1"); | ||||
| 16758 | return false; | ||||
| 16759 | } | ||||
| 16760 | if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) { | ||||
| 16761 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1"); | ||||
| 16762 | return false; | ||||
| 16763 | } | ||||
| 16764 | } else { | ||||
| 16765 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 16766 | return false; | ||||
| 16767 | } | ||||
| 16768 | } | ||||
| 16769 | } else { | ||||
| 16770 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16771 | return false; | ||||
| 16772 | } | ||||
| 16773 | if (objIsXray) { | ||||
| 16774 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16775 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16776 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16777 | if (!unwrappedObj.ref()) { | ||||
| 16778 | return false; | ||||
| 16779 | } | ||||
| 16780 | } | ||||
| 16781 | FastErrorResult rv; | ||||
| 16782 | // NOTE: This assert does NOT call the function. | ||||
| 16783 | 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"); | ||||
| 16784 | MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16785 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers" )), 0))) { | ||||
| 16786 | return false; | ||||
| 16787 | } | ||||
| 16788 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16788); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16788; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16789 | args.rval().setUndefined(); | ||||
| 16790 | return true; | ||||
| 16791 | } | ||||
| 16792 | |||||
| 16793 | static const JSJitInfo passRecordOfArrayBuffers_methodinfo = { | ||||
| 16794 | { (JSJitGetterOp)passRecordOfArrayBuffers }, | ||||
| 16795 | { prototypes::id::TestJSImplInterface }, | ||||
| 16796 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16797 | JSJitInfo::Method, | ||||
| 16798 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16799 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16800 | false, /* isInfallible. False in setters. */ | ||||
| 16801 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16802 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16803 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16804 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16805 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16806 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16807 | }; | ||||
| 16808 | |||||
| 16809 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16810 | passRecordOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16811 | { | ||||
| 16812 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableArrayBuffers"); | ||||
| 16813 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16816( cx, "TestJSImplInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16814 | "TestJSImplInterface", "passRecordOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16816( cx, "TestJSImplInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16815 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16816( cx, "TestJSImplInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 16816 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16816( cx, "TestJSImplInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 16817 | |||||
| 16818 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16819 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers", 1)) { | ||||
| 16820 | return false; | ||||
| 16821 | } | ||||
| 16822 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16823 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16824 | if (objIsXray) { | ||||
| 16825 | unwrappedObj.emplace(cx, obj); | ||||
| 16826 | } | ||||
| 16827 | Record<nsString, Nullable<ArrayBuffer>> arg0; | ||||
| 16828 | RecordRooter<nsString, Nullable<ArrayBuffer>> arg0_holder(cx, &arg0); | ||||
| 16829 | if (args[0].isObject()) { | ||||
| 16830 | auto& recordEntries = arg0.Entries(); | ||||
| 16831 | |||||
| 16832 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 16833 | JS::RootedVector<jsid> ids(cx); | ||||
| 16834 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 16835 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 16836 | return false; | ||||
| 16837 | } | ||||
| 16838 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 16839 | JS_ReportOutOfMemory(cx); | ||||
| 16840 | return false; | ||||
| 16841 | } | ||||
| 16842 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 16843 | JS::Rooted<JS::Value> temp(cx); | ||||
| 16844 | JS::Rooted<jsid> curId(cx); | ||||
| 16845 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 16846 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 16847 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 16848 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 16849 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 16850 | // around. | ||||
| 16851 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 16852 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 16853 | curId = ids[i]; | ||||
| 16854 | |||||
| 16855 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 16856 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 16857 | &desc)) { | ||||
| 16858 | return false; | ||||
| 16859 | } | ||||
| 16860 | |||||
| 16861 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 16862 | continue; | ||||
| 16863 | } | ||||
| 16864 | |||||
| 16865 | idVal = js::IdToValue(curId); | ||||
| 16866 | nsString propName; | ||||
| 16867 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 16868 | // to do. | ||||
| 16869 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 16870 | return false; | ||||
| 16871 | } | ||||
| 16872 | |||||
| 16873 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 16874 | return false; | ||||
| 16875 | } | ||||
| 16876 | |||||
| 16877 | Record<nsString, Nullable<ArrayBuffer>>::EntryType* entry; | ||||
| 16878 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 16879 | // Find the existing entry. | ||||
| 16880 | auto idx = recordEntries.IndexOf(propName); | ||||
| 16881 | 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", 16882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 16882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 16882 | "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", 16882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 16882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 16883 | // Now blow it away to make it look like it was just added | ||||
| 16884 | // to the array, because it's not obvious that it's | ||||
| 16885 | // safe to write to its already-initialized mValue via our | ||||
| 16886 | // normal codegen conversions. For example, the value | ||||
| 16887 | // could be a union and this would change its type, but | ||||
| 16888 | // codegen assumes we won't do that. | ||||
| 16889 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 16890 | } else { | ||||
| 16891 | // Safe to do an infallible append here, because we did a | ||||
| 16892 | // SetCapacity above to the right capacity. | ||||
| 16893 | entry = recordEntries.AppendElement(); | ||||
| 16894 | } | ||||
| 16895 | entry->mKey = propName; | ||||
| 16896 | Nullable<ArrayBuffer>& slot = entry->mValue; | ||||
| 16897 | if (temp.isObject()) { | ||||
| 16898 | if (!slot.SetValue().Init(&temp.toObject())) { | ||||
| 16899 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBufferOrNull"); | ||||
| 16900 | return false; | ||||
| 16901 | } | ||||
| 16902 | if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) { | ||||
| 16903 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1"); | ||||
| 16904 | return false; | ||||
| 16905 | } | ||||
| 16906 | if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) { | ||||
| 16907 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1"); | ||||
| 16908 | return false; | ||||
| 16909 | } | ||||
| 16910 | if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) { | ||||
| 16911 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1"); | ||||
| 16912 | return false; | ||||
| 16913 | } | ||||
| 16914 | } else if (temp.isNullOrUndefined()) { | ||||
| 16915 | slot.SetNull(); | ||||
| 16916 | } else { | ||||
| 16917 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 16918 | return false; | ||||
| 16919 | } | ||||
| 16920 | } | ||||
| 16921 | } else { | ||||
| 16922 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 16923 | return false; | ||||
| 16924 | } | ||||
| 16925 | if (objIsXray) { | ||||
| 16926 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 16927 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 16928 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 16929 | if (!unwrappedObj.ref()) { | ||||
| 16930 | return false; | ||||
| 16931 | } | ||||
| 16932 | } | ||||
| 16933 | FastErrorResult rv; | ||||
| 16934 | // NOTE: This assert does NOT call the function. | ||||
| 16935 | 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"); | ||||
| 16936 | MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 16937 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers" )), 0))) { | ||||
| 16938 | return false; | ||||
| 16939 | } | ||||
| 16940 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 16940); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16940; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 16941 | args.rval().setUndefined(); | ||||
| 16942 | return true; | ||||
| 16943 | } | ||||
| 16944 | |||||
| 16945 | static const JSJitInfo passRecordOfNullableArrayBuffers_methodinfo = { | ||||
| 16946 | { (JSJitGetterOp)passRecordOfNullableArrayBuffers }, | ||||
| 16947 | { prototypes::id::TestJSImplInterface }, | ||||
| 16948 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 16949 | JSJitInfo::Method, | ||||
| 16950 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 16951 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 16952 | false, /* isInfallible. False in setters. */ | ||||
| 16953 | false, /* isMovable. Not relevant for setters. */ | ||||
| 16954 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 16955 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 16956 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 16957 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 16958 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 16959 | }; | ||||
| 16960 | |||||
| 16961 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 16962 | passVariadicTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 16963 | { | ||||
| 16964 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicTypedArray"); | ||||
| 16965 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16968( cx, "TestJSImplInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16966 | "TestJSImplInterface", "passVariadicTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16968( cx, "TestJSImplInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16967 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16968( cx, "TestJSImplInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 16968 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16968( cx, "TestJSImplInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 16969 | |||||
| 16970 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 16971 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 16972 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 16973 | if (objIsXray) { | ||||
| 16974 | unwrappedObj.emplace(cx, obj); | ||||
| 16975 | } | ||||
| 16976 | AutoSequence<Float32Array> arg0; | ||||
| 16977 | SequenceRooter<Float32Array> arg0_holder(cx, &arg0); | ||||
| 16978 | if (args.length() > 0) { | ||||
| 16979 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 16980 | JS_ReportOutOfMemory(cx); | ||||
| 16981 | return false; | ||||
| 16982 | } | ||||
| 16983 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 16984 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 16985 | Float32Array& slot = *arg0.AppendElement(); | ||||
| 16986 | if (args[variadicArg].isObject()) { | ||||
| 16987 | if (!slot.Init(&args[variadicArg].toObject())) { | ||||
| 16988 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array"); | ||||
| 16989 | return false; | ||||
| 16990 | } | ||||
| 16991 | if (JS::IsArrayBufferViewShared(slot.Obj())) { | ||||
| 16992 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 16993 | return false; | ||||
| 16994 | } | ||||
| 16995 | if (JS::IsLargeArrayBufferView(slot.Obj())) { | ||||
| 16996 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 16997 | return false; | ||||
| 16998 | } | ||||
| 16999 | if (JS::IsResizableArrayBufferView(slot.Obj())) { | ||||
| 17000 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 17001 | return false; | ||||
| 17002 | } | ||||
| 17003 | } else { | ||||
| 17004 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 17005 | return false; | ||||
| 17006 | } | ||||
| 17007 | } | ||||
| 17008 | } | ||||
| 17009 | if (objIsXray) { | ||||
| 17010 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17011 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17012 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17013 | if (!unwrappedObj.ref()) { | ||||
| 17014 | return false; | ||||
| 17015 | } | ||||
| 17016 | } | ||||
| 17017 | FastErrorResult rv; | ||||
| 17018 | // NOTE: This assert does NOT call the function. | ||||
| 17019 | 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"); | ||||
| 17020 | MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17021 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray" )), 0))) { | ||||
| 17022 | return false; | ||||
| 17023 | } | ||||
| 17024 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17024); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17024; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17025 | args.rval().setUndefined(); | ||||
| 17026 | return true; | ||||
| 17027 | } | ||||
| 17028 | |||||
| 17029 | static const JSJitInfo passVariadicTypedArray_methodinfo = { | ||||
| 17030 | { (JSJitGetterOp)passVariadicTypedArray }, | ||||
| 17031 | { prototypes::id::TestJSImplInterface }, | ||||
| 17032 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17033 | JSJitInfo::Method, | ||||
| 17034 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17035 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17036 | false, /* isInfallible. False in setters. */ | ||||
| 17037 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17038 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17039 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17040 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17041 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17042 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17043 | }; | ||||
| 17044 | |||||
| 17045 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17046 | passVariadicNullableTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17047 | { | ||||
| 17048 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableTypedArray"); | ||||
| 17049 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17052( cx, "TestJSImplInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17050 | "TestJSImplInterface", "passVariadicNullableTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17052( cx, "TestJSImplInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17051 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17052( cx, "TestJSImplInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17052 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17052( cx, "TestJSImplInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17053 | |||||
| 17054 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17055 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17056 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17057 | if (objIsXray) { | ||||
| 17058 | unwrappedObj.emplace(cx, obj); | ||||
| 17059 | } | ||||
| 17060 | AutoSequence<Nullable<Float32Array>> arg0; | ||||
| 17061 | SequenceRooter<Nullable<Float32Array>> arg0_holder(cx, &arg0); | ||||
| 17062 | if (args.length() > 0) { | ||||
| 17063 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 17064 | JS_ReportOutOfMemory(cx); | ||||
| 17065 | return false; | ||||
| 17066 | } | ||||
| 17067 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 17068 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 17069 | Nullable<Float32Array>& slot = *arg0.AppendElement(); | ||||
| 17070 | if (args[variadicArg].isObject()) { | ||||
| 17071 | if (!slot.SetValue().Init(&args[variadicArg].toObject())) { | ||||
| 17072 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32ArrayOrNull"); | ||||
| 17073 | return false; | ||||
| 17074 | } | ||||
| 17075 | if (JS::IsArrayBufferViewShared(slot.SetValue().Obj())) { | ||||
| 17076 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | ||||
| 17077 | return false; | ||||
| 17078 | } | ||||
| 17079 | if (JS::IsLargeArrayBufferView(slot.SetValue().Obj())) { | ||||
| 17080 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 17081 | return false; | ||||
| 17082 | } | ||||
| 17083 | if (JS::IsResizableArrayBufferView(slot.SetValue().Obj())) { | ||||
| 17084 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 17085 | return false; | ||||
| 17086 | } | ||||
| 17087 | } else if (args[variadicArg].isNullOrUndefined()) { | ||||
| 17088 | slot.SetNull(); | ||||
| 17089 | } else { | ||||
| 17090 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 17091 | return false; | ||||
| 17092 | } | ||||
| 17093 | } | ||||
| 17094 | } | ||||
| 17095 | if (objIsXray) { | ||||
| 17096 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17097 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17098 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17099 | if (!unwrappedObj.ref()) { | ||||
| 17100 | return false; | ||||
| 17101 | } | ||||
| 17102 | } | ||||
| 17103 | FastErrorResult rv; | ||||
| 17104 | // NOTE: This assert does NOT call the function. | ||||
| 17105 | 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"); | ||||
| 17106 | MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17107 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray" )), 0))) { | ||||
| 17108 | return false; | ||||
| 17109 | } | ||||
| 17110 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17110); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17110; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17111 | args.rval().setUndefined(); | ||||
| 17112 | return true; | ||||
| 17113 | } | ||||
| 17114 | |||||
| 17115 | static const JSJitInfo passVariadicNullableTypedArray_methodinfo = { | ||||
| 17116 | { (JSJitGetterOp)passVariadicNullableTypedArray }, | ||||
| 17117 | { prototypes::id::TestJSImplInterface }, | ||||
| 17118 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17119 | JSJitInfo::Method, | ||||
| 17120 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17121 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17122 | false, /* isInfallible. False in setters. */ | ||||
| 17123 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17124 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17125 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17126 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17127 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17128 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17129 | }; | ||||
| 17130 | |||||
| 17131 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17132 | receiveUint8Array(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17133 | { | ||||
| 17134 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17137( cx, "TestJSImplInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17135 | "TestJSImplInterface", "receiveUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17137( cx, "TestJSImplInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17136 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17137( cx, "TestJSImplInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17137 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17137( cx, "TestJSImplInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17138 | |||||
| 17139 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17140 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17141 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17142 | if (objIsXray) { | ||||
| 17143 | unwrappedObj.emplace(cx, obj); | ||||
| 17144 | } | ||||
| 17145 | if (objIsXray) { | ||||
| 17146 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17147 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17148 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17149 | if (!unwrappedObj.ref()) { | ||||
| 17150 | return false; | ||||
| 17151 | } | ||||
| 17152 | } | ||||
| 17153 | FastErrorResult rv; | ||||
| 17154 | JS::Rooted<JSObject*> result(cx); | ||||
| 17155 | // NOTE: This assert does NOT call the function. | ||||
| 17156 | 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"); | ||||
| 17157 | MOZ_KnownLive(self)(self)->ReceiveUint8Array(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17158 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array" )), 0))) { | ||||
| 17159 | return false; | ||||
| 17160 | } | ||||
| 17161 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17161); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17161; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17162 | JS::ExposeObjectToActiveJS(result); | ||||
| 17163 | args.rval().setObject(*result); | ||||
| 17164 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | ||||
| 17165 | return false; | ||||
| 17166 | } | ||||
| 17167 | return true; | ||||
| 17168 | } | ||||
| 17169 | |||||
| 17170 | static const JSJitInfo receiveUint8Array_methodinfo = { | ||||
| 17171 | { (JSJitGetterOp)receiveUint8Array }, | ||||
| 17172 | { prototypes::id::TestJSImplInterface }, | ||||
| 17173 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17174 | JSJitInfo::Method, | ||||
| 17175 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17176 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 17177 | false, /* isInfallible. False in setters. */ | ||||
| 17178 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17179 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17180 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17181 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17182 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17183 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17184 | }; | ||||
| 17185 | |||||
| 17186 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17187 | get_uint8ArrayAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 17188 | { | ||||
| 17189 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17192( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17190 | "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17192( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17191 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17192( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17192 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17192( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17193 | |||||
| 17194 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17195 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17196 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17197 | if (objIsXray) { | ||||
| 17198 | unwrappedObj.emplace(cx, obj); | ||||
| 17199 | } | ||||
| 17200 | if (objIsXray) { | ||||
| 17201 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17202 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17203 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17204 | if (!unwrappedObj.ref()) { | ||||
| 17205 | return false; | ||||
| 17206 | } | ||||
| 17207 | } | ||||
| 17208 | FastErrorResult rv; | ||||
| 17209 | JS::Rooted<JSObject*> result(cx); | ||||
| 17210 | // NOTE: This assert does NOT call the function. | ||||
| 17211 | 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"); | ||||
| 17212 | MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17213 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter" )), 0))) { | ||||
| 17214 | return false; | ||||
| 17215 | } | ||||
| 17216 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17216); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17216; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17217 | JS::ExposeObjectToActiveJS(result); | ||||
| 17218 | args.rval().setObject(*result); | ||||
| 17219 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | ||||
| 17220 | return false; | ||||
| 17221 | } | ||||
| 17222 | return true; | ||||
| 17223 | } | ||||
| 17224 | |||||
| 17225 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17226 | set_uint8ArrayAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 17227 | { | ||||
| 17228 | BindingCallContext cx(cx_, "TestJSImplInterface.uint8ArrayAttr setter"); | ||||
| 17229 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17232( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17230 | "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17232( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17231 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject17232( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17232 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17232( cx, "TestJSImplInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17233 | |||||
| 17234 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17235 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17236 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17237 | if (objIsXray) { | ||||
| 17238 | unwrappedObj.emplace(cx, obj); | ||||
| 17239 | } | ||||
| 17240 | RootedSpiderMonkeyInterface<Uint8Array> arg0(cx); | ||||
| 17241 | if (args[0].isObject()) { | ||||
| 17242 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 17243 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "Uint8Array"); | ||||
| 17244 | return false; | ||||
| 17245 | } | ||||
| 17246 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | ||||
| 17247 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value being assigned"); | ||||
| 17248 | return false; | ||||
| 17249 | } | ||||
| 17250 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 17251 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 17252 | return false; | ||||
| 17253 | } | ||||
| 17254 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 17255 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 17256 | return false; | ||||
| 17257 | } | ||||
| 17258 | } else { | ||||
| 17259 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 17260 | return false; | ||||
| 17261 | } | ||||
| 17262 | if (objIsXray) { | ||||
| 17263 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17264 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17265 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17266 | if (!unwrappedObj.ref()) { | ||||
| 17267 | return false; | ||||
| 17268 | } | ||||
| 17269 | } | ||||
| 17270 | FastErrorResult rv; | ||||
| 17271 | // NOTE: This assert does NOT call the function. | ||||
| 17272 | 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"); | ||||
| 17273 | MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17274 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter" )), 0))) { | ||||
| 17275 | return false; | ||||
| 17276 | } | ||||
| 17277 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17277); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17277; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17278 | |||||
| 17279 | return true; | ||||
| 17280 | } | ||||
| 17281 | |||||
| 17282 | static const JSJitInfo uint8ArrayAttr_getterinfo = { | ||||
| 17283 | { get_uint8ArrayAttr }, | ||||
| 17284 | { prototypes::id::TestJSImplInterface }, | ||||
| 17285 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17286 | JSJitInfo::Getter, | ||||
| 17287 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17288 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 17289 | false, /* isInfallible. False in setters. */ | ||||
| 17290 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17291 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17292 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17293 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17294 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17295 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17296 | }; | ||||
| 17297 | static const JSJitInfo uint8ArrayAttr_setterinfo = { | ||||
| 17298 | { (JSJitGetterOp)set_uint8ArrayAttr }, | ||||
| 17299 | { prototypes::id::TestJSImplInterface }, | ||||
| 17300 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17301 | JSJitInfo::Setter, | ||||
| 17302 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17303 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17304 | false, /* isInfallible. False in setters. */ | ||||
| 17305 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17306 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17307 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17308 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17309 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17310 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17311 | }; | ||||
| 17312 | |||||
| 17313 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17314 | passString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17315 | { | ||||
| 17316 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17319( cx, "TestJSImplInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17317 | "TestJSImplInterface", "passString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17319( cx, "TestJSImplInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17318 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17319( cx, "TestJSImplInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17319 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17319( cx, "TestJSImplInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17320 | |||||
| 17321 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17322 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passString", 1)) { | ||||
| 17323 | return false; | ||||
| 17324 | } | ||||
| 17325 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17326 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17327 | if (objIsXray) { | ||||
| 17328 | unwrappedObj.emplace(cx, obj); | ||||
| 17329 | } | ||||
| 17330 | binding_detail::FakeString<char16_t> arg0; | ||||
| 17331 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 17332 | return false; | ||||
| 17333 | } | ||||
| 17334 | if (objIsXray) { | ||||
| 17335 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17336 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17337 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17338 | if (!unwrappedObj.ref()) { | ||||
| 17339 | return false; | ||||
| 17340 | } | ||||
| 17341 | } | ||||
| 17342 | FastErrorResult rv; | ||||
| 17343 | // NOTE: This assert does NOT call the function. | ||||
| 17344 | 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"); | ||||
| 17345 | MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17346 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString" )), 0))) { | ||||
| 17347 | return false; | ||||
| 17348 | } | ||||
| 17349 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17349); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17349; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17350 | args.rval().setUndefined(); | ||||
| 17351 | return true; | ||||
| 17352 | } | ||||
| 17353 | |||||
| 17354 | static const JSJitInfo passString_methodinfo = { | ||||
| 17355 | { (JSJitGetterOp)passString }, | ||||
| 17356 | { prototypes::id::TestJSImplInterface }, | ||||
| 17357 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17358 | JSJitInfo::Method, | ||||
| 17359 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17360 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17361 | false, /* isInfallible. False in setters. */ | ||||
| 17362 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17363 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17364 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17365 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17366 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17367 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17368 | }; | ||||
| 17369 | |||||
| 17370 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17371 | passNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17372 | { | ||||
| 17373 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17376( cx, "TestJSImplInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17374 | "TestJSImplInterface", "passNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17376( cx, "TestJSImplInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17375 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17376( cx, "TestJSImplInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17376 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17376( cx, "TestJSImplInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17377 | |||||
| 17378 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17379 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableString", 1)) { | ||||
| 17380 | return false; | ||||
| 17381 | } | ||||
| 17382 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17383 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17384 | if (objIsXray) { | ||||
| 17385 | unwrappedObj.emplace(cx, obj); | ||||
| 17386 | } | ||||
| 17387 | binding_detail::FakeString<char16_t> arg0; | ||||
| 17388 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 17389 | return false; | ||||
| 17390 | } | ||||
| 17391 | if (objIsXray) { | ||||
| 17392 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17393 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17394 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17395 | if (!unwrappedObj.ref()) { | ||||
| 17396 | return false; | ||||
| 17397 | } | ||||
| 17398 | } | ||||
| 17399 | FastErrorResult rv; | ||||
| 17400 | // NOTE: This assert does NOT call the function. | ||||
| 17401 | 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"); | ||||
| 17402 | MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17403 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString" )), 0))) { | ||||
| 17404 | return false; | ||||
| 17405 | } | ||||
| 17406 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17406; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17407 | args.rval().setUndefined(); | ||||
| 17408 | return true; | ||||
| 17409 | } | ||||
| 17410 | |||||
| 17411 | static const JSJitInfo passNullableString_methodinfo = { | ||||
| 17412 | { (JSJitGetterOp)passNullableString }, | ||||
| 17413 | { prototypes::id::TestJSImplInterface }, | ||||
| 17414 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17415 | JSJitInfo::Method, | ||||
| 17416 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17417 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17418 | false, /* isInfallible. False in setters. */ | ||||
| 17419 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17420 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17421 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17422 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17423 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17424 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17425 | }; | ||||
| 17426 | |||||
| 17427 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17428 | passOptionalString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17429 | { | ||||
| 17430 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17433( cx, "TestJSImplInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17431 | "TestJSImplInterface", "passOptionalString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17433( cx, "TestJSImplInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17432 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17433( cx, "TestJSImplInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17433 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17433( cx, "TestJSImplInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17434 | |||||
| 17435 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17436 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17437 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17438 | if (objIsXray) { | ||||
| 17439 | unwrappedObj.emplace(cx, obj); | ||||
| 17440 | } | ||||
| 17441 | Optional<nsAString> arg0; | ||||
| 17442 | binding_detail::FakeString<char16_t> arg0_holder; | ||||
| 17443 | if (args.hasDefined(0)) { | ||||
| 17444 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | ||||
| 17445 | return false; | ||||
| 17446 | } | ||||
| 17447 | arg0 = &arg0_holder; | ||||
| 17448 | } | ||||
| 17449 | if (objIsXray) { | ||||
| 17450 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17451 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17452 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17453 | if (!unwrappedObj.ref()) { | ||||
| 17454 | return false; | ||||
| 17455 | } | ||||
| 17456 | } | ||||
| 17457 | FastErrorResult rv; | ||||
| 17458 | // NOTE: This assert does NOT call the function. | ||||
| 17459 | 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"); | ||||
| 17460 | MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17461 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString" )), 0))) { | ||||
| 17462 | return false; | ||||
| 17463 | } | ||||
| 17464 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17464); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17464; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17465 | args.rval().setUndefined(); | ||||
| 17466 | return true; | ||||
| 17467 | } | ||||
| 17468 | |||||
| 17469 | static const JSJitInfo passOptionalString_methodinfo = { | ||||
| 17470 | { (JSJitGetterOp)passOptionalString }, | ||||
| 17471 | { prototypes::id::TestJSImplInterface }, | ||||
| 17472 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17473 | JSJitInfo::Method, | ||||
| 17474 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17475 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17476 | false, /* isInfallible. False in setters. */ | ||||
| 17477 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17478 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17479 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17480 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17481 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17482 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17483 | }; | ||||
| 17484 | |||||
| 17485 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17486 | passOptionalStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17487 | { | ||||
| 17488 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17491( cx, "TestJSImplInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17489 | "TestJSImplInterface", "passOptionalStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17491( cx, "TestJSImplInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17490 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17491( cx, "TestJSImplInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17491 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17491( cx, "TestJSImplInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17492 | |||||
| 17493 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17494 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17495 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17496 | if (objIsXray) { | ||||
| 17497 | unwrappedObj.emplace(cx, obj); | ||||
| 17498 | } | ||||
| 17499 | binding_detail::FakeString<char16_t> arg0; | ||||
| 17500 | if (args.hasDefined(0)) { | ||||
| 17501 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 17502 | return false; | ||||
| 17503 | } | ||||
| 17504 | } else { | ||||
| 17505 | arg0.AssignLiteral(u"abc"); | ||||
| 17506 | } | ||||
| 17507 | if (objIsXray) { | ||||
| 17508 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17509 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17510 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17511 | if (!unwrappedObj.ref()) { | ||||
| 17512 | return false; | ||||
| 17513 | } | ||||
| 17514 | } | ||||
| 17515 | FastErrorResult rv; | ||||
| 17516 | // NOTE: This assert does NOT call the function. | ||||
| 17517 | 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"); | ||||
| 17518 | MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17519 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue" )), 0))) { | ||||
| 17520 | return false; | ||||
| 17521 | } | ||||
| 17522 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17522); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17522; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17523 | args.rval().setUndefined(); | ||||
| 17524 | return true; | ||||
| 17525 | } | ||||
| 17526 | |||||
| 17527 | static const JSJitInfo passOptionalStringWithDefaultValue_methodinfo = { | ||||
| 17528 | { (JSJitGetterOp)passOptionalStringWithDefaultValue }, | ||||
| 17529 | { prototypes::id::TestJSImplInterface }, | ||||
| 17530 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17531 | JSJitInfo::Method, | ||||
| 17532 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17533 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17534 | false, /* isInfallible. False in setters. */ | ||||
| 17535 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17536 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17537 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17538 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17539 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17540 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17541 | }; | ||||
| 17542 | |||||
| 17543 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17544 | passOptionalNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17545 | { | ||||
| 17546 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17549( cx, "TestJSImplInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17547 | "TestJSImplInterface", "passOptionalNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17549( cx, "TestJSImplInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17548 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17549( cx, "TestJSImplInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17549 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17549( cx, "TestJSImplInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17550 | |||||
| 17551 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17552 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17553 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17554 | if (objIsXray) { | ||||
| 17555 | unwrappedObj.emplace(cx, obj); | ||||
| 17556 | } | ||||
| 17557 | Optional<nsAString> arg0; | ||||
| 17558 | binding_detail::FakeString<char16_t> arg0_holder; | ||||
| 17559 | if (args.hasDefined(0)) { | ||||
| 17560 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | ||||
| 17561 | return false; | ||||
| 17562 | } | ||||
| 17563 | arg0 = &arg0_holder; | ||||
| 17564 | } | ||||
| 17565 | if (objIsXray) { | ||||
| 17566 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17567 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17568 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17569 | if (!unwrappedObj.ref()) { | ||||
| 17570 | return false; | ||||
| 17571 | } | ||||
| 17572 | } | ||||
| 17573 | FastErrorResult rv; | ||||
| 17574 | // NOTE: This assert does NOT call the function. | ||||
| 17575 | 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"); | ||||
| 17576 | MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17577 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString" )), 0))) { | ||||
| 17578 | return false; | ||||
| 17579 | } | ||||
| 17580 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17580; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17581 | args.rval().setUndefined(); | ||||
| 17582 | return true; | ||||
| 17583 | } | ||||
| 17584 | |||||
| 17585 | static const JSJitInfo passOptionalNullableString_methodinfo = { | ||||
| 17586 | { (JSJitGetterOp)passOptionalNullableString }, | ||||
| 17587 | { prototypes::id::TestJSImplInterface }, | ||||
| 17588 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17589 | JSJitInfo::Method, | ||||
| 17590 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17591 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17592 | false, /* isInfallible. False in setters. */ | ||||
| 17593 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17594 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17595 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17596 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17597 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17598 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17599 | }; | ||||
| 17600 | |||||
| 17601 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17602 | passOptionalNullableStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17603 | { | ||||
| 17604 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17607( cx, "TestJSImplInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17605 | "TestJSImplInterface", "passOptionalNullableStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17607( cx, "TestJSImplInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17606 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17607( cx, "TestJSImplInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17607 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17607( cx, "TestJSImplInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17608 | |||||
| 17609 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17610 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17611 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17612 | if (objIsXray) { | ||||
| 17613 | unwrappedObj.emplace(cx, obj); | ||||
| 17614 | } | ||||
| 17615 | binding_detail::FakeString<char16_t> arg0; | ||||
| 17616 | if (args.hasDefined(0)) { | ||||
| 17617 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 17618 | return false; | ||||
| 17619 | } | ||||
| 17620 | } else { | ||||
| 17621 | arg0.SetIsVoid(true); | ||||
| 17622 | } | ||||
| 17623 | if (objIsXray) { | ||||
| 17624 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17625 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17626 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17627 | if (!unwrappedObj.ref()) { | ||||
| 17628 | return false; | ||||
| 17629 | } | ||||
| 17630 | } | ||||
| 17631 | FastErrorResult rv; | ||||
| 17632 | // NOTE: This assert does NOT call the function. | ||||
| 17633 | 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"); | ||||
| 17634 | MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17635 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue" )), 0))) { | ||||
| 17636 | return false; | ||||
| 17637 | } | ||||
| 17638 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17638); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17638; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17639 | args.rval().setUndefined(); | ||||
| 17640 | return true; | ||||
| 17641 | } | ||||
| 17642 | |||||
| 17643 | static const JSJitInfo passOptionalNullableStringWithDefaultValue_methodinfo = { | ||||
| 17644 | { (JSJitGetterOp)passOptionalNullableStringWithDefaultValue }, | ||||
| 17645 | { prototypes::id::TestJSImplInterface }, | ||||
| 17646 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17647 | JSJitInfo::Method, | ||||
| 17648 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17649 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17650 | false, /* isInfallible. False in setters. */ | ||||
| 17651 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17652 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17653 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17654 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17655 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17656 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17657 | }; | ||||
| 17658 | |||||
| 17659 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17660 | passVariadicString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17661 | { | ||||
| 17662 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17665( cx, "TestJSImplInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17663 | "TestJSImplInterface", "passVariadicString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17665( cx, "TestJSImplInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17664 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17665( cx, "TestJSImplInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17665 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17665( cx, "TestJSImplInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17666 | |||||
| 17667 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17668 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17669 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17670 | if (objIsXray) { | ||||
| 17671 | unwrappedObj.emplace(cx, obj); | ||||
| 17672 | } | ||||
| 17673 | AutoSequence<nsString> arg0; | ||||
| 17674 | if (args.length() > 0) { | ||||
| 17675 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 17676 | JS_ReportOutOfMemory(cx); | ||||
| 17677 | return false; | ||||
| 17678 | } | ||||
| 17679 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 17680 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 17681 | nsString& slot = *arg0.AppendElement(); | ||||
| 17682 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | ||||
| 17683 | return false; | ||||
| 17684 | } | ||||
| 17685 | } | ||||
| 17686 | } | ||||
| 17687 | if (objIsXray) { | ||||
| 17688 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17689 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17690 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17691 | if (!unwrappedObj.ref()) { | ||||
| 17692 | return false; | ||||
| 17693 | } | ||||
| 17694 | } | ||||
| 17695 | FastErrorResult rv; | ||||
| 17696 | // NOTE: This assert does NOT call the function. | ||||
| 17697 | 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"); | ||||
| 17698 | MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17699 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString" )), 0))) { | ||||
| 17700 | return false; | ||||
| 17701 | } | ||||
| 17702 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17702); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17702; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17703 | args.rval().setUndefined(); | ||||
| 17704 | return true; | ||||
| 17705 | } | ||||
| 17706 | |||||
| 17707 | static const JSJitInfo passVariadicString_methodinfo = { | ||||
| 17708 | { (JSJitGetterOp)passVariadicString }, | ||||
| 17709 | { prototypes::id::TestJSImplInterface }, | ||||
| 17710 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17711 | JSJitInfo::Method, | ||||
| 17712 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17713 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17714 | false, /* isInfallible. False in setters. */ | ||||
| 17715 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17716 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17717 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17718 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17719 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17720 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17721 | }; | ||||
| 17722 | |||||
| 17723 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17724 | passByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17725 | { | ||||
| 17726 | BindingCallContext cx(cx_, "TestJSImplInterface.passByteString"); | ||||
| 17727 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17730( cx, "TestJSImplInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17728 | "TestJSImplInterface", "passByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17730( cx, "TestJSImplInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17729 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17730( cx, "TestJSImplInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17730 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17730( cx, "TestJSImplInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17731 | |||||
| 17732 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17733 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passByteString", 1)) { | ||||
| 17734 | return false; | ||||
| 17735 | } | ||||
| 17736 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17737 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17738 | if (objIsXray) { | ||||
| 17739 | unwrappedObj.emplace(cx, obj); | ||||
| 17740 | } | ||||
| 17741 | nsCString arg0; | ||||
| 17742 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) { | ||||
| 17743 | return false; | ||||
| 17744 | } | ||||
| 17745 | if (objIsXray) { | ||||
| 17746 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17747 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17748 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17749 | if (!unwrappedObj.ref()) { | ||||
| 17750 | return false; | ||||
| 17751 | } | ||||
| 17752 | } | ||||
| 17753 | FastErrorResult rv; | ||||
| 17754 | // NOTE: This assert does NOT call the function. | ||||
| 17755 | 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"); | ||||
| 17756 | MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17757 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString" )), 0))) { | ||||
| 17758 | return false; | ||||
| 17759 | } | ||||
| 17760 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17760); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17760; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17761 | args.rval().setUndefined(); | ||||
| 17762 | return true; | ||||
| 17763 | } | ||||
| 17764 | |||||
| 17765 | static const JSJitInfo passByteString_methodinfo = { | ||||
| 17766 | { (JSJitGetterOp)passByteString }, | ||||
| 17767 | { prototypes::id::TestJSImplInterface }, | ||||
| 17768 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17769 | JSJitInfo::Method, | ||||
| 17770 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17771 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17772 | false, /* isInfallible. False in setters. */ | ||||
| 17773 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17774 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17775 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17776 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17777 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17778 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17779 | }; | ||||
| 17780 | |||||
| 17781 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17782 | passNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17783 | { | ||||
| 17784 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableByteString"); | ||||
| 17785 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17788( cx, "TestJSImplInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17786 | "TestJSImplInterface", "passNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17788( cx, "TestJSImplInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17787 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17788( cx, "TestJSImplInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17788 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17788( cx, "TestJSImplInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17789 | |||||
| 17790 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17791 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByteString", 1)) { | ||||
| 17792 | return false; | ||||
| 17793 | } | ||||
| 17794 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17795 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17796 | if (objIsXray) { | ||||
| 17797 | unwrappedObj.emplace(cx, obj); | ||||
| 17798 | } | ||||
| 17799 | nsCString arg0; | ||||
| 17800 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) { | ||||
| 17801 | return false; | ||||
| 17802 | } | ||||
| 17803 | if (objIsXray) { | ||||
| 17804 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17805 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17806 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17807 | if (!unwrappedObj.ref()) { | ||||
| 17808 | return false; | ||||
| 17809 | } | ||||
| 17810 | } | ||||
| 17811 | FastErrorResult rv; | ||||
| 17812 | // NOTE: This assert does NOT call the function. | ||||
| 17813 | 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"); | ||||
| 17814 | MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17815 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString" )), 0))) { | ||||
| 17816 | return false; | ||||
| 17817 | } | ||||
| 17818 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17818); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17818; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17819 | args.rval().setUndefined(); | ||||
| 17820 | return true; | ||||
| 17821 | } | ||||
| 17822 | |||||
| 17823 | static const JSJitInfo passNullableByteString_methodinfo = { | ||||
| 17824 | { (JSJitGetterOp)passNullableByteString }, | ||||
| 17825 | { prototypes::id::TestJSImplInterface }, | ||||
| 17826 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17827 | JSJitInfo::Method, | ||||
| 17828 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17829 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17830 | false, /* isInfallible. False in setters. */ | ||||
| 17831 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17832 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17833 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17834 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17835 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17836 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17837 | }; | ||||
| 17838 | |||||
| 17839 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17840 | passOptionalByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17841 | { | ||||
| 17842 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteString"); | ||||
| 17843 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17846( cx, "TestJSImplInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17844 | "TestJSImplInterface", "passOptionalByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17846( cx, "TestJSImplInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17845 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17846( cx, "TestJSImplInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 17846 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17846( cx, "TestJSImplInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 17847 | |||||
| 17848 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17849 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17850 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17851 | if (objIsXray) { | ||||
| 17852 | unwrappedObj.emplace(cx, obj); | ||||
| 17853 | } | ||||
| 17854 | Optional<nsCString> arg0; | ||||
| 17855 | if (args.hasDefined(0)) { | ||||
| 17856 | arg0.Construct(); | ||||
| 17857 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0.Value())) { | ||||
| 17858 | return false; | ||||
| 17859 | } | ||||
| 17860 | } | ||||
| 17861 | if (objIsXray) { | ||||
| 17862 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17863 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17864 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17865 | if (!unwrappedObj.ref()) { | ||||
| 17866 | return false; | ||||
| 17867 | } | ||||
| 17868 | } | ||||
| 17869 | FastErrorResult rv; | ||||
| 17870 | // NOTE: This assert does NOT call the function. | ||||
| 17871 | 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"); | ||||
| 17872 | MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17873 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString" )), 0))) { | ||||
| 17874 | return false; | ||||
| 17875 | } | ||||
| 17876 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17876); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17876; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17877 | args.rval().setUndefined(); | ||||
| 17878 | return true; | ||||
| 17879 | } | ||||
| 17880 | |||||
| 17881 | static const JSJitInfo passOptionalByteString_methodinfo = { | ||||
| 17882 | { (JSJitGetterOp)passOptionalByteString }, | ||||
| 17883 | { prototypes::id::TestJSImplInterface }, | ||||
| 17884 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17885 | JSJitInfo::Method, | ||||
| 17886 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17887 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17888 | false, /* isInfallible. False in setters. */ | ||||
| 17889 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17890 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17891 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17892 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17893 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17894 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17895 | }; | ||||
| 17896 | |||||
| 17897 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17898 | passOptionalByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17899 | { | ||||
| 17900 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"); | ||||
| 17901 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17904( cx, "TestJSImplInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17902 | "TestJSImplInterface", "passOptionalByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17904( cx, "TestJSImplInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17903 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17904( cx, "TestJSImplInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17904 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17904( cx, "TestJSImplInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17905 | |||||
| 17906 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17907 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17908 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17909 | if (objIsXray) { | ||||
| 17910 | unwrappedObj.emplace(cx, obj); | ||||
| 17911 | } | ||||
| 17912 | nsCString arg0; | ||||
| 17913 | if (args.hasDefined(0)) { | ||||
| 17914 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) { | ||||
| 17915 | return false; | ||||
| 17916 | } | ||||
| 17917 | } else { | ||||
| 17918 | arg0.AssignLiteral("abc"); | ||||
| 17919 | } | ||||
| 17920 | if (objIsXray) { | ||||
| 17921 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17922 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17923 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17924 | if (!unwrappedObj.ref()) { | ||||
| 17925 | return false; | ||||
| 17926 | } | ||||
| 17927 | } | ||||
| 17928 | FastErrorResult rv; | ||||
| 17929 | // NOTE: This assert does NOT call the function. | ||||
| 17930 | 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"); | ||||
| 17931 | MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17932 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue" )), 0))) { | ||||
| 17933 | return false; | ||||
| 17934 | } | ||||
| 17935 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17935); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17935; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17936 | args.rval().setUndefined(); | ||||
| 17937 | return true; | ||||
| 17938 | } | ||||
| 17939 | |||||
| 17940 | static const JSJitInfo passOptionalByteStringWithDefaultValue_methodinfo = { | ||||
| 17941 | { (JSJitGetterOp)passOptionalByteStringWithDefaultValue }, | ||||
| 17942 | { prototypes::id::TestJSImplInterface }, | ||||
| 17943 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 17944 | JSJitInfo::Method, | ||||
| 17945 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 17946 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 17947 | false, /* isInfallible. False in setters. */ | ||||
| 17948 | false, /* isMovable. Not relevant for setters. */ | ||||
| 17949 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 17950 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 17951 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 17952 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 17953 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 17954 | }; | ||||
| 17955 | |||||
| 17956 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 17957 | passOptionalNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 17958 | { | ||||
| 17959 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteString"); | ||||
| 17960 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17963( cx, "TestJSImplInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17961 | "TestJSImplInterface", "passOptionalNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17963( cx, "TestJSImplInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17962 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17963( cx, "TestJSImplInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 17963 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17963( cx, "TestJSImplInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 17964 | |||||
| 17965 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 17966 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 17967 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 17968 | if (objIsXray) { | ||||
| 17969 | unwrappedObj.emplace(cx, obj); | ||||
| 17970 | } | ||||
| 17971 | Optional<nsCString> arg0; | ||||
| 17972 | if (args.hasDefined(0)) { | ||||
| 17973 | arg0.Construct(); | ||||
| 17974 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0.Value())) { | ||||
| 17975 | return false; | ||||
| 17976 | } | ||||
| 17977 | } | ||||
| 17978 | if (objIsXray) { | ||||
| 17979 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 17980 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 17981 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 17982 | if (!unwrappedObj.ref()) { | ||||
| 17983 | return false; | ||||
| 17984 | } | ||||
| 17985 | } | ||||
| 17986 | FastErrorResult rv; | ||||
| 17987 | // NOTE: This assert does NOT call the function. | ||||
| 17988 | 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"); | ||||
| 17989 | MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 17990 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString" )), 0))) { | ||||
| 17991 | return false; | ||||
| 17992 | } | ||||
| 17993 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 17993); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17993; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 17994 | args.rval().setUndefined(); | ||||
| 17995 | return true; | ||||
| 17996 | } | ||||
| 17997 | |||||
| 17998 | static const JSJitInfo passOptionalNullableByteString_methodinfo = { | ||||
| 17999 | { (JSJitGetterOp)passOptionalNullableByteString }, | ||||
| 18000 | { prototypes::id::TestJSImplInterface }, | ||||
| 18001 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18002 | JSJitInfo::Method, | ||||
| 18003 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18004 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18005 | false, /* isInfallible. False in setters. */ | ||||
| 18006 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18007 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18008 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18009 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18010 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18011 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18012 | }; | ||||
| 18013 | |||||
| 18014 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18015 | passOptionalNullableByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18016 | { | ||||
| 18017 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"); | ||||
| 18018 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18021( cx, "TestJSImplInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18019 | "TestJSImplInterface", "passOptionalNullableByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18021( cx, "TestJSImplInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18020 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18021( cx, "TestJSImplInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18021 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18021( cx, "TestJSImplInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18022 | |||||
| 18023 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18024 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18025 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18026 | if (objIsXray) { | ||||
| 18027 | unwrappedObj.emplace(cx, obj); | ||||
| 18028 | } | ||||
| 18029 | nsCString arg0; | ||||
| 18030 | if (args.hasDefined(0)) { | ||||
| 18031 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) { | ||||
| 18032 | return false; | ||||
| 18033 | } | ||||
| 18034 | } else { | ||||
| 18035 | arg0.SetIsVoid(true); | ||||
| 18036 | } | ||||
| 18037 | if (objIsXray) { | ||||
| 18038 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18039 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18040 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18041 | if (!unwrappedObj.ref()) { | ||||
| 18042 | return false; | ||||
| 18043 | } | ||||
| 18044 | } | ||||
| 18045 | FastErrorResult rv; | ||||
| 18046 | // NOTE: This assert does NOT call the function. | ||||
| 18047 | 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"); | ||||
| 18048 | MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18049 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue" )), 0))) { | ||||
| 18050 | return false; | ||||
| 18051 | } | ||||
| 18052 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18052); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18052; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18053 | args.rval().setUndefined(); | ||||
| 18054 | return true; | ||||
| 18055 | } | ||||
| 18056 | |||||
| 18057 | static const JSJitInfo passOptionalNullableByteStringWithDefaultValue_methodinfo = { | ||||
| 18058 | { (JSJitGetterOp)passOptionalNullableByteStringWithDefaultValue }, | ||||
| 18059 | { prototypes::id::TestJSImplInterface }, | ||||
| 18060 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18061 | JSJitInfo::Method, | ||||
| 18062 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18063 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18064 | false, /* isInfallible. False in setters. */ | ||||
| 18065 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18066 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18067 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18068 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18069 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18070 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18071 | }; | ||||
| 18072 | |||||
| 18073 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18074 | passVariadicByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18075 | { | ||||
| 18076 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicByteString"); | ||||
| 18077 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18080( cx, "TestJSImplInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18078 | "TestJSImplInterface", "passVariadicByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18080( cx, "TestJSImplInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18079 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18080( cx, "TestJSImplInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18080 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18080( cx, "TestJSImplInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18081 | |||||
| 18082 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18083 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18084 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18085 | if (objIsXray) { | ||||
| 18086 | unwrappedObj.emplace(cx, obj); | ||||
| 18087 | } | ||||
| 18088 | AutoSequence<nsCString> arg0; | ||||
| 18089 | if (args.length() > 0) { | ||||
| 18090 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 18091 | JS_ReportOutOfMemory(cx); | ||||
| 18092 | return false; | ||||
| 18093 | } | ||||
| 18094 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 18095 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 18096 | nsCString& slot = *arg0.AppendElement(); | ||||
| 18097 | if (!ConvertJSValueToByteString(cx, args[variadicArg], false, "argument 1", slot)) { | ||||
| 18098 | return false; | ||||
| 18099 | } | ||||
| 18100 | } | ||||
| 18101 | } | ||||
| 18102 | if (objIsXray) { | ||||
| 18103 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18104 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18105 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18106 | if (!unwrappedObj.ref()) { | ||||
| 18107 | return false; | ||||
| 18108 | } | ||||
| 18109 | } | ||||
| 18110 | FastErrorResult rv; | ||||
| 18111 | // NOTE: This assert does NOT call the function. | ||||
| 18112 | 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"); | ||||
| 18113 | MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18114 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString" )), 0))) { | ||||
| 18115 | return false; | ||||
| 18116 | } | ||||
| 18117 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18117); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18117; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18118 | args.rval().setUndefined(); | ||||
| 18119 | return true; | ||||
| 18120 | } | ||||
| 18121 | |||||
| 18122 | static const JSJitInfo passVariadicByteString_methodinfo = { | ||||
| 18123 | { (JSJitGetterOp)passVariadicByteString }, | ||||
| 18124 | { prototypes::id::TestJSImplInterface }, | ||||
| 18125 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18126 | JSJitInfo::Method, | ||||
| 18127 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18128 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18129 | false, /* isInfallible. False in setters. */ | ||||
| 18130 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18131 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18132 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18133 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18134 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18135 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18136 | }; | ||||
| 18137 | |||||
| 18138 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18139 | passUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18140 | { | ||||
| 18141 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionByteString"); | ||||
| 18142 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18145( cx, "TestJSImplInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18143 | "TestJSImplInterface", "passUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18145( cx, "TestJSImplInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18144 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18145( cx, "TestJSImplInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18145 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18145( cx, "TestJSImplInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18146 | |||||
| 18147 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18148 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionByteString", 1)) { | ||||
| 18149 | return false; | ||||
| 18150 | } | ||||
| 18151 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18152 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18153 | if (objIsXray) { | ||||
| 18154 | unwrappedObj.emplace(cx, obj); | ||||
| 18155 | } | ||||
| 18156 | ByteStringOrLong arg0; | ||||
| 18157 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 18158 | return false; | ||||
| 18159 | } | ||||
| 18160 | if (objIsXray) { | ||||
| 18161 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18162 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18163 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18164 | if (!unwrappedObj.ref()) { | ||||
| 18165 | return false; | ||||
| 18166 | } | ||||
| 18167 | } | ||||
| 18168 | FastErrorResult rv; | ||||
| 18169 | // NOTE: This assert does NOT call the function. | ||||
| 18170 | 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"); | ||||
| 18171 | MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18172 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString" )), 0))) { | ||||
| 18173 | return false; | ||||
| 18174 | } | ||||
| 18175 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18175; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18176 | args.rval().setUndefined(); | ||||
| 18177 | return true; | ||||
| 18178 | } | ||||
| 18179 | |||||
| 18180 | static const JSJitInfo passUnionByteString_methodinfo = { | ||||
| 18181 | { (JSJitGetterOp)passUnionByteString }, | ||||
| 18182 | { prototypes::id::TestJSImplInterface }, | ||||
| 18183 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18184 | JSJitInfo::Method, | ||||
| 18185 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18186 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18187 | false, /* isInfallible. False in setters. */ | ||||
| 18188 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18189 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18190 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18191 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18192 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18193 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18194 | }; | ||||
| 18195 | |||||
| 18196 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18197 | passOptionalUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18198 | { | ||||
| 18199 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteString"); | ||||
| 18200 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18203( cx, "TestJSImplInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18201 | "TestJSImplInterface", "passOptionalUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18203( cx, "TestJSImplInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18202 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18203( cx, "TestJSImplInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18203 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18203( cx, "TestJSImplInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18204 | |||||
| 18205 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18206 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18207 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18208 | if (objIsXray) { | ||||
| 18209 | unwrappedObj.emplace(cx, obj); | ||||
| 18210 | } | ||||
| 18211 | Optional<ByteStringOrLong> arg0; | ||||
| 18212 | if (args.hasDefined(0)) { | ||||
| 18213 | arg0.Construct(); | ||||
| 18214 | if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) { | ||||
| 18215 | return false; | ||||
| 18216 | } | ||||
| 18217 | } | ||||
| 18218 | if (objIsXray) { | ||||
| 18219 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18220 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18221 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18222 | if (!unwrappedObj.ref()) { | ||||
| 18223 | return false; | ||||
| 18224 | } | ||||
| 18225 | } | ||||
| 18226 | FastErrorResult rv; | ||||
| 18227 | // NOTE: This assert does NOT call the function. | ||||
| 18228 | 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"); | ||||
| 18229 | MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18230 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString" )), 0))) { | ||||
| 18231 | return false; | ||||
| 18232 | } | ||||
| 18233 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18233); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18233; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18234 | args.rval().setUndefined(); | ||||
| 18235 | return true; | ||||
| 18236 | } | ||||
| 18237 | |||||
| 18238 | static const JSJitInfo passOptionalUnionByteString_methodinfo = { | ||||
| 18239 | { (JSJitGetterOp)passOptionalUnionByteString }, | ||||
| 18240 | { prototypes::id::TestJSImplInterface }, | ||||
| 18241 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18242 | JSJitInfo::Method, | ||||
| 18243 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18244 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18245 | false, /* isInfallible. False in setters. */ | ||||
| 18246 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18247 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18248 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18249 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18250 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18251 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18252 | }; | ||||
| 18253 | |||||
| 18254 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18255 | passOptionalUnionByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18256 | { | ||||
| 18257 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"); | ||||
| 18258 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18261( cx, "TestJSImplInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18259 | "TestJSImplInterface", "passOptionalUnionByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18261( cx, "TestJSImplInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18260 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18261( cx, "TestJSImplInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18261 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18261( cx, "TestJSImplInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18262 | |||||
| 18263 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18264 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18265 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18266 | if (objIsXray) { | ||||
| 18267 | unwrappedObj.emplace(cx, obj); | ||||
| 18268 | } | ||||
| 18269 | ByteStringOrLong arg0; | ||||
| 18270 | if (!(args.hasDefined(0))) { | ||||
| 18271 | arg0.SetStringLiteral("abc"); | ||||
| 18272 | } else { | ||||
| 18273 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 18274 | return false; | ||||
| 18275 | } | ||||
| 18276 | } | ||||
| 18277 | if (objIsXray) { | ||||
| 18278 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18279 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18280 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18281 | if (!unwrappedObj.ref()) { | ||||
| 18282 | return false; | ||||
| 18283 | } | ||||
| 18284 | } | ||||
| 18285 | FastErrorResult rv; | ||||
| 18286 | // NOTE: This assert does NOT call the function. | ||||
| 18287 | 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"); | ||||
| 18288 | MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18289 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue" )), 0))) { | ||||
| 18290 | return false; | ||||
| 18291 | } | ||||
| 18292 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18292); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18292; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18293 | args.rval().setUndefined(); | ||||
| 18294 | return true; | ||||
| 18295 | } | ||||
| 18296 | |||||
| 18297 | static const JSJitInfo passOptionalUnionByteStringWithDefaultValue_methodinfo = { | ||||
| 18298 | { (JSJitGetterOp)passOptionalUnionByteStringWithDefaultValue }, | ||||
| 18299 | { prototypes::id::TestJSImplInterface }, | ||||
| 18300 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18301 | JSJitInfo::Method, | ||||
| 18302 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18303 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18304 | false, /* isInfallible. False in setters. */ | ||||
| 18305 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18306 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18307 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18308 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18309 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18310 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18311 | }; | ||||
| 18312 | |||||
| 18313 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18314 | passUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18315 | { | ||||
| 18316 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18319( cx, "TestJSImplInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18317 | "TestJSImplInterface", "passUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18319( cx, "TestJSImplInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18318 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18319( cx, "TestJSImplInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18319 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18319( cx, "TestJSImplInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18320 | |||||
| 18321 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18322 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUTF8String", 1)) { | ||||
| 18323 | return false; | ||||
| 18324 | } | ||||
| 18325 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18326 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18327 | if (objIsXray) { | ||||
| 18328 | unwrappedObj.emplace(cx, obj); | ||||
| 18329 | } | ||||
| 18330 | binding_detail::FakeString<char> arg0; | ||||
| 18331 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 18332 | return false; | ||||
| 18333 | } | ||||
| 18334 | if (objIsXray) { | ||||
| 18335 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18336 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18337 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18338 | if (!unwrappedObj.ref()) { | ||||
| 18339 | return false; | ||||
| 18340 | } | ||||
| 18341 | } | ||||
| 18342 | FastErrorResult rv; | ||||
| 18343 | // NOTE: This assert does NOT call the function. | ||||
| 18344 | 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"); | ||||
| 18345 | MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18346 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String" )), 0))) { | ||||
| 18347 | return false; | ||||
| 18348 | } | ||||
| 18349 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18349); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18349; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18350 | args.rval().setUndefined(); | ||||
| 18351 | return true; | ||||
| 18352 | } | ||||
| 18353 | |||||
| 18354 | static const JSJitInfo passUTF8String_methodinfo = { | ||||
| 18355 | { (JSJitGetterOp)passUTF8String }, | ||||
| 18356 | { prototypes::id::TestJSImplInterface }, | ||||
| 18357 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18358 | JSJitInfo::Method, | ||||
| 18359 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18360 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18361 | false, /* isInfallible. False in setters. */ | ||||
| 18362 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18363 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18364 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18365 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18366 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18367 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18368 | }; | ||||
| 18369 | |||||
| 18370 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18371 | passNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18372 | { | ||||
| 18373 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18376( cx, "TestJSImplInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18374 | "TestJSImplInterface", "passNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18376( cx, "TestJSImplInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18375 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18376( cx, "TestJSImplInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18376 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18376( cx, "TestJSImplInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18377 | |||||
| 18378 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18379 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUTF8String", 1)) { | ||||
| 18380 | return false; | ||||
| 18381 | } | ||||
| 18382 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18383 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18384 | if (objIsXray) { | ||||
| 18385 | unwrappedObj.emplace(cx, obj); | ||||
| 18386 | } | ||||
| 18387 | binding_detail::FakeString<char> arg0; | ||||
| 18388 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 18389 | return false; | ||||
| 18390 | } | ||||
| 18391 | if (objIsXray) { | ||||
| 18392 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18393 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18394 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18395 | if (!unwrappedObj.ref()) { | ||||
| 18396 | return false; | ||||
| 18397 | } | ||||
| 18398 | } | ||||
| 18399 | FastErrorResult rv; | ||||
| 18400 | // NOTE: This assert does NOT call the function. | ||||
| 18401 | 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"); | ||||
| 18402 | MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18403 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String" )), 0))) { | ||||
| 18404 | return false; | ||||
| 18405 | } | ||||
| 18406 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18406; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18407 | args.rval().setUndefined(); | ||||
| 18408 | return true; | ||||
| 18409 | } | ||||
| 18410 | |||||
| 18411 | static const JSJitInfo passNullableUTF8String_methodinfo = { | ||||
| 18412 | { (JSJitGetterOp)passNullableUTF8String }, | ||||
| 18413 | { prototypes::id::TestJSImplInterface }, | ||||
| 18414 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18415 | JSJitInfo::Method, | ||||
| 18416 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18417 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18418 | false, /* isInfallible. False in setters. */ | ||||
| 18419 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18420 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18421 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18422 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18423 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18424 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18425 | }; | ||||
| 18426 | |||||
| 18427 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18428 | passOptionalUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18429 | { | ||||
| 18430 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18433( cx, "TestJSImplInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18431 | "TestJSImplInterface", "passOptionalUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18433( cx, "TestJSImplInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18432 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18433( cx, "TestJSImplInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18433 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18433( cx, "TestJSImplInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18434 | |||||
| 18435 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18436 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18437 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18438 | if (objIsXray) { | ||||
| 18439 | unwrappedObj.emplace(cx, obj); | ||||
| 18440 | } | ||||
| 18441 | Optional<nsACString> arg0; | ||||
| 18442 | binding_detail::FakeString<char> arg0_holder; | ||||
| 18443 | if (args.hasDefined(0)) { | ||||
| 18444 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | ||||
| 18445 | return false; | ||||
| 18446 | } | ||||
| 18447 | arg0 = &arg0_holder; | ||||
| 18448 | } | ||||
| 18449 | if (objIsXray) { | ||||
| 18450 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18451 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18452 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18453 | if (!unwrappedObj.ref()) { | ||||
| 18454 | return false; | ||||
| 18455 | } | ||||
| 18456 | } | ||||
| 18457 | FastErrorResult rv; | ||||
| 18458 | // NOTE: This assert does NOT call the function. | ||||
| 18459 | 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"); | ||||
| 18460 | MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18461 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String" )), 0))) { | ||||
| 18462 | return false; | ||||
| 18463 | } | ||||
| 18464 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18464); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18464; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18465 | args.rval().setUndefined(); | ||||
| 18466 | return true; | ||||
| 18467 | } | ||||
| 18468 | |||||
| 18469 | static const JSJitInfo passOptionalUTF8String_methodinfo = { | ||||
| 18470 | { (JSJitGetterOp)passOptionalUTF8String }, | ||||
| 18471 | { prototypes::id::TestJSImplInterface }, | ||||
| 18472 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18473 | JSJitInfo::Method, | ||||
| 18474 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18475 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18476 | false, /* isInfallible. False in setters. */ | ||||
| 18477 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18478 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18479 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18480 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18481 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18482 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18483 | }; | ||||
| 18484 | |||||
| 18485 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18486 | passOptionalUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18487 | { | ||||
| 18488 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18491( cx, "TestJSImplInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18489 | "TestJSImplInterface", "passOptionalUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18491( cx, "TestJSImplInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18490 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18491( cx, "TestJSImplInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18491 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18491( cx, "TestJSImplInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18492 | |||||
| 18493 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18494 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18495 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18496 | if (objIsXray) { | ||||
| 18497 | unwrappedObj.emplace(cx, obj); | ||||
| 18498 | } | ||||
| 18499 | binding_detail::FakeString<char> arg0; | ||||
| 18500 | if (args.hasDefined(0)) { | ||||
| 18501 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 18502 | return false; | ||||
| 18503 | } | ||||
| 18504 | } else { | ||||
| 18505 | arg0.AssignLiteral("abc"); | ||||
| 18506 | } | ||||
| 18507 | if (objIsXray) { | ||||
| 18508 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18509 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18510 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18511 | if (!unwrappedObj.ref()) { | ||||
| 18512 | return false; | ||||
| 18513 | } | ||||
| 18514 | } | ||||
| 18515 | FastErrorResult rv; | ||||
| 18516 | // NOTE: This assert does NOT call the function. | ||||
| 18517 | 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"); | ||||
| 18518 | MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18519 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue" )), 0))) { | ||||
| 18520 | return false; | ||||
| 18521 | } | ||||
| 18522 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18522); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18522; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18523 | args.rval().setUndefined(); | ||||
| 18524 | return true; | ||||
| 18525 | } | ||||
| 18526 | |||||
| 18527 | static const JSJitInfo passOptionalUTF8StringWithDefaultValue_methodinfo = { | ||||
| 18528 | { (JSJitGetterOp)passOptionalUTF8StringWithDefaultValue }, | ||||
| 18529 | { prototypes::id::TestJSImplInterface }, | ||||
| 18530 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18531 | JSJitInfo::Method, | ||||
| 18532 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18533 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18534 | false, /* isInfallible. False in setters. */ | ||||
| 18535 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18536 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18537 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18538 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18539 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18540 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18541 | }; | ||||
| 18542 | |||||
| 18543 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18544 | passOptionalNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18545 | { | ||||
| 18546 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18549( cx, "TestJSImplInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18547 | "TestJSImplInterface", "passOptionalNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18549( cx, "TestJSImplInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18548 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18549( cx, "TestJSImplInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18549 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18549( cx, "TestJSImplInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18550 | |||||
| 18551 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18552 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18553 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18554 | if (objIsXray) { | ||||
| 18555 | unwrappedObj.emplace(cx, obj); | ||||
| 18556 | } | ||||
| 18557 | Optional<nsACString> arg0; | ||||
| 18558 | binding_detail::FakeString<char> arg0_holder; | ||||
| 18559 | if (args.hasDefined(0)) { | ||||
| 18560 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | ||||
| 18561 | return false; | ||||
| 18562 | } | ||||
| 18563 | arg0 = &arg0_holder; | ||||
| 18564 | } | ||||
| 18565 | if (objIsXray) { | ||||
| 18566 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18567 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18568 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18569 | if (!unwrappedObj.ref()) { | ||||
| 18570 | return false; | ||||
| 18571 | } | ||||
| 18572 | } | ||||
| 18573 | FastErrorResult rv; | ||||
| 18574 | // NOTE: This assert does NOT call the function. | ||||
| 18575 | 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"); | ||||
| 18576 | MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18577 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String" )), 0))) { | ||||
| 18578 | return false; | ||||
| 18579 | } | ||||
| 18580 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18580; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18581 | args.rval().setUndefined(); | ||||
| 18582 | return true; | ||||
| 18583 | } | ||||
| 18584 | |||||
| 18585 | static const JSJitInfo passOptionalNullableUTF8String_methodinfo = { | ||||
| 18586 | { (JSJitGetterOp)passOptionalNullableUTF8String }, | ||||
| 18587 | { prototypes::id::TestJSImplInterface }, | ||||
| 18588 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18589 | JSJitInfo::Method, | ||||
| 18590 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18591 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18592 | false, /* isInfallible. False in setters. */ | ||||
| 18593 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18594 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18595 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18596 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18597 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18598 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18599 | }; | ||||
| 18600 | |||||
| 18601 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18602 | passOptionalNullableUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18603 | { | ||||
| 18604 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18607( cx, "TestJSImplInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18605 | "TestJSImplInterface", "passOptionalNullableUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18607( cx, "TestJSImplInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18606 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18607( cx, "TestJSImplInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18607 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18607( cx, "TestJSImplInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18608 | |||||
| 18609 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18610 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18611 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18612 | if (objIsXray) { | ||||
| 18613 | unwrappedObj.emplace(cx, obj); | ||||
| 18614 | } | ||||
| 18615 | binding_detail::FakeString<char> arg0; | ||||
| 18616 | if (args.hasDefined(0)) { | ||||
| 18617 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 18618 | return false; | ||||
| 18619 | } | ||||
| 18620 | } else { | ||||
| 18621 | arg0.SetIsVoid(true); | ||||
| 18622 | } | ||||
| 18623 | if (objIsXray) { | ||||
| 18624 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18625 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18626 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18627 | if (!unwrappedObj.ref()) { | ||||
| 18628 | return false; | ||||
| 18629 | } | ||||
| 18630 | } | ||||
| 18631 | FastErrorResult rv; | ||||
| 18632 | // NOTE: This assert does NOT call the function. | ||||
| 18633 | 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"); | ||||
| 18634 | MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18635 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue" )), 0))) { | ||||
| 18636 | return false; | ||||
| 18637 | } | ||||
| 18638 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18638); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18638; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18639 | args.rval().setUndefined(); | ||||
| 18640 | return true; | ||||
| 18641 | } | ||||
| 18642 | |||||
| 18643 | static const JSJitInfo passOptionalNullableUTF8StringWithDefaultValue_methodinfo = { | ||||
| 18644 | { (JSJitGetterOp)passOptionalNullableUTF8StringWithDefaultValue }, | ||||
| 18645 | { prototypes::id::TestJSImplInterface }, | ||||
| 18646 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18647 | JSJitInfo::Method, | ||||
| 18648 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18649 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18650 | false, /* isInfallible. False in setters. */ | ||||
| 18651 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18652 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18653 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18654 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18655 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18656 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18657 | }; | ||||
| 18658 | |||||
| 18659 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18660 | passVariadicUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18661 | { | ||||
| 18662 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestJSImplInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18663 | "TestJSImplInterface", "passVariadicUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestJSImplInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18664 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestJSImplInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18665 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestJSImplInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18666 | |||||
| 18667 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18668 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18669 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18670 | if (objIsXray) { | ||||
| 18671 | unwrappedObj.emplace(cx, obj); | ||||
| 18672 | } | ||||
| 18673 | AutoSequence<nsCString> arg0; | ||||
| 18674 | if (args.length() > 0) { | ||||
| 18675 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 18676 | JS_ReportOutOfMemory(cx); | ||||
| 18677 | return false; | ||||
| 18678 | } | ||||
| 18679 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 18680 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 18681 | nsCString& slot = *arg0.AppendElement(); | ||||
| 18682 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | ||||
| 18683 | return false; | ||||
| 18684 | } | ||||
| 18685 | } | ||||
| 18686 | } | ||||
| 18687 | if (objIsXray) { | ||||
| 18688 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18689 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18690 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18691 | if (!unwrappedObj.ref()) { | ||||
| 18692 | return false; | ||||
| 18693 | } | ||||
| 18694 | } | ||||
| 18695 | FastErrorResult rv; | ||||
| 18696 | // NOTE: This assert does NOT call the function. | ||||
| 18697 | 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"); | ||||
| 18698 | MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18699 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String" )), 0))) { | ||||
| 18700 | return false; | ||||
| 18701 | } | ||||
| 18702 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18702); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18702; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18703 | args.rval().setUndefined(); | ||||
| 18704 | return true; | ||||
| 18705 | } | ||||
| 18706 | |||||
| 18707 | static const JSJitInfo passVariadicUTF8String_methodinfo = { | ||||
| 18708 | { (JSJitGetterOp)passVariadicUTF8String }, | ||||
| 18709 | { prototypes::id::TestJSImplInterface }, | ||||
| 18710 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18711 | JSJitInfo::Method, | ||||
| 18712 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18713 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18714 | false, /* isInfallible. False in setters. */ | ||||
| 18715 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18716 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18717 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18718 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18719 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18720 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18721 | }; | ||||
| 18722 | |||||
| 18723 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18724 | passUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18725 | { | ||||
| 18726 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionUTF8String"); | ||||
| 18727 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18730( cx, "TestJSImplInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18728 | "TestJSImplInterface", "passUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18730( cx, "TestJSImplInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18729 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18730( cx, "TestJSImplInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18730 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18730( cx, "TestJSImplInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18731 | |||||
| 18732 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18733 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionUTF8String", 1)) { | ||||
| 18734 | return false; | ||||
| 18735 | } | ||||
| 18736 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18737 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18738 | if (objIsXray) { | ||||
| 18739 | unwrappedObj.emplace(cx, obj); | ||||
| 18740 | } | ||||
| 18741 | UTF8StringOrLong arg0; | ||||
| 18742 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 18743 | return false; | ||||
| 18744 | } | ||||
| 18745 | if (objIsXray) { | ||||
| 18746 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18747 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18748 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18749 | if (!unwrappedObj.ref()) { | ||||
| 18750 | return false; | ||||
| 18751 | } | ||||
| 18752 | } | ||||
| 18753 | FastErrorResult rv; | ||||
| 18754 | // NOTE: This assert does NOT call the function. | ||||
| 18755 | 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"); | ||||
| 18756 | MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18757 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String" )), 0))) { | ||||
| 18758 | return false; | ||||
| 18759 | } | ||||
| 18760 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18760); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18760; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18761 | args.rval().setUndefined(); | ||||
| 18762 | return true; | ||||
| 18763 | } | ||||
| 18764 | |||||
| 18765 | static const JSJitInfo passUnionUTF8String_methodinfo = { | ||||
| 18766 | { (JSJitGetterOp)passUnionUTF8String }, | ||||
| 18767 | { prototypes::id::TestJSImplInterface }, | ||||
| 18768 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18769 | JSJitInfo::Method, | ||||
| 18770 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18771 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18772 | false, /* isInfallible. False in setters. */ | ||||
| 18773 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18774 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18775 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18776 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18777 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18778 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18779 | }; | ||||
| 18780 | |||||
| 18781 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18782 | passOptionalUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18783 | { | ||||
| 18784 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8String"); | ||||
| 18785 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18788( cx, "TestJSImplInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18786 | "TestJSImplInterface", "passOptionalUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18788( cx, "TestJSImplInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18787 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18788( cx, "TestJSImplInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18788 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18788( cx, "TestJSImplInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18789 | |||||
| 18790 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18791 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18792 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18793 | if (objIsXray) { | ||||
| 18794 | unwrappedObj.emplace(cx, obj); | ||||
| 18795 | } | ||||
| 18796 | Optional<UTF8StringOrLong> arg0; | ||||
| 18797 | if (args.hasDefined(0)) { | ||||
| 18798 | arg0.Construct(); | ||||
| 18799 | if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) { | ||||
| 18800 | return false; | ||||
| 18801 | } | ||||
| 18802 | } | ||||
| 18803 | if (objIsXray) { | ||||
| 18804 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18805 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18806 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18807 | if (!unwrappedObj.ref()) { | ||||
| 18808 | return false; | ||||
| 18809 | } | ||||
| 18810 | } | ||||
| 18811 | FastErrorResult rv; | ||||
| 18812 | // NOTE: This assert does NOT call the function. | ||||
| 18813 | 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"); | ||||
| 18814 | MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18815 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String" )), 0))) { | ||||
| 18816 | return false; | ||||
| 18817 | } | ||||
| 18818 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18818); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18818; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18819 | args.rval().setUndefined(); | ||||
| 18820 | return true; | ||||
| 18821 | } | ||||
| 18822 | |||||
| 18823 | static const JSJitInfo passOptionalUnionUTF8String_methodinfo = { | ||||
| 18824 | { (JSJitGetterOp)passOptionalUnionUTF8String }, | ||||
| 18825 | { prototypes::id::TestJSImplInterface }, | ||||
| 18826 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18827 | JSJitInfo::Method, | ||||
| 18828 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18829 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18830 | false, /* isInfallible. False in setters. */ | ||||
| 18831 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18832 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18833 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18834 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18835 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18836 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18837 | }; | ||||
| 18838 | |||||
| 18839 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18840 | passOptionalUnionUTF8StringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18841 | { | ||||
| 18842 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"); | ||||
| 18843 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18846( cx, "TestJSImplInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18844 | "TestJSImplInterface", "passOptionalUnionUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18846( cx, "TestJSImplInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18845 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18846( cx, "TestJSImplInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 18846 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18846( cx, "TestJSImplInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 18847 | |||||
| 18848 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18849 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18850 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18851 | if (objIsXray) { | ||||
| 18852 | unwrappedObj.emplace(cx, obj); | ||||
| 18853 | } | ||||
| 18854 | UTF8StringOrLong arg0; | ||||
| 18855 | if (!(args.hasDefined(0))) { | ||||
| 18856 | arg0.SetStringLiteral("abc"); | ||||
| 18857 | } else { | ||||
| 18858 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 18859 | return false; | ||||
| 18860 | } | ||||
| 18861 | } | ||||
| 18862 | if (objIsXray) { | ||||
| 18863 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18864 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18865 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18866 | if (!unwrappedObj.ref()) { | ||||
| 18867 | return false; | ||||
| 18868 | } | ||||
| 18869 | } | ||||
| 18870 | FastErrorResult rv; | ||||
| 18871 | // NOTE: This assert does NOT call the function. | ||||
| 18872 | 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"); | ||||
| 18873 | MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18874 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue" )), 0))) { | ||||
| 18875 | return false; | ||||
| 18876 | } | ||||
| 18877 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18877); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18877; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18878 | args.rval().setUndefined(); | ||||
| 18879 | return true; | ||||
| 18880 | } | ||||
| 18881 | |||||
| 18882 | static const JSJitInfo passOptionalUnionUTF8StringWithDefaultValue_methodinfo = { | ||||
| 18883 | { (JSJitGetterOp)passOptionalUnionUTF8StringWithDefaultValue }, | ||||
| 18884 | { prototypes::id::TestJSImplInterface }, | ||||
| 18885 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18886 | JSJitInfo::Method, | ||||
| 18887 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18888 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18889 | false, /* isInfallible. False in setters. */ | ||||
| 18890 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18891 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18892 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18893 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18894 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18895 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18896 | }; | ||||
| 18897 | |||||
| 18898 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18899 | passSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18900 | { | ||||
| 18901 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18904( cx, "TestJSImplInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 18902 | "TestJSImplInterface", "passSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18904( cx, "TestJSImplInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 18903 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18904( cx, "TestJSImplInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 18904 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18904( cx, "TestJSImplInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 18905 | |||||
| 18906 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18907 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSVS", 1)) { | ||||
| 18908 | return false; | ||||
| 18909 | } | ||||
| 18910 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18911 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18912 | if (objIsXray) { | ||||
| 18913 | unwrappedObj.emplace(cx, obj); | ||||
| 18914 | } | ||||
| 18915 | binding_detail::FakeString<char16_t> arg0; | ||||
| 18916 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 18917 | return false; | ||||
| 18918 | } | ||||
| 18919 | if (!NormalizeUSVString(arg0)) { | ||||
| 18920 | JS_ReportOutOfMemory(cx); | ||||
| 18921 | return false; | ||||
| 18922 | } | ||||
| 18923 | if (objIsXray) { | ||||
| 18924 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18925 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18926 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18927 | if (!unwrappedObj.ref()) { | ||||
| 18928 | return false; | ||||
| 18929 | } | ||||
| 18930 | } | ||||
| 18931 | FastErrorResult rv; | ||||
| 18932 | // NOTE: This assert does NOT call the function. | ||||
| 18933 | 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"); | ||||
| 18934 | MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18935 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS" )), 0))) { | ||||
| 18936 | return false; | ||||
| 18937 | } | ||||
| 18938 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18938); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18938; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 18939 | args.rval().setUndefined(); | ||||
| 18940 | return true; | ||||
| 18941 | } | ||||
| 18942 | |||||
| 18943 | static const JSJitInfo passSVS_methodinfo = { | ||||
| 18944 | { (JSJitGetterOp)passSVS }, | ||||
| 18945 | { prototypes::id::TestJSImplInterface }, | ||||
| 18946 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 18947 | JSJitInfo::Method, | ||||
| 18948 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 18949 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 18950 | false, /* isInfallible. False in setters. */ | ||||
| 18951 | false, /* isMovable. Not relevant for setters. */ | ||||
| 18952 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 18953 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 18954 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 18955 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 18956 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 18957 | }; | ||||
| 18958 | |||||
| 18959 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 18960 | passNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 18961 | { | ||||
| 18962 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18965( cx, "TestJSImplInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18963 | "TestJSImplInterface", "passNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18965( cx, "TestJSImplInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18964 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18965( cx, "TestJSImplInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 18965 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18965( cx, "TestJSImplInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 18966 | |||||
| 18967 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 18968 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSVS", 1)) { | ||||
| 18969 | return false; | ||||
| 18970 | } | ||||
| 18971 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 18972 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 18973 | if (objIsXray) { | ||||
| 18974 | unwrappedObj.emplace(cx, obj); | ||||
| 18975 | } | ||||
| 18976 | binding_detail::FakeString<char16_t> arg0; | ||||
| 18977 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 18978 | return false; | ||||
| 18979 | } | ||||
| 18980 | if (!NormalizeUSVString(arg0)) { | ||||
| 18981 | JS_ReportOutOfMemory(cx); | ||||
| 18982 | return false; | ||||
| 18983 | } | ||||
| 18984 | if (objIsXray) { | ||||
| 18985 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 18986 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 18987 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 18988 | if (!unwrappedObj.ref()) { | ||||
| 18989 | return false; | ||||
| 18990 | } | ||||
| 18991 | } | ||||
| 18992 | FastErrorResult rv; | ||||
| 18993 | // NOTE: This assert does NOT call the function. | ||||
| 18994 | 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"); | ||||
| 18995 | MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 18996 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS" )), 0))) { | ||||
| 18997 | return false; | ||||
| 18998 | } | ||||
| 18999 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 18999); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18999; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19000 | args.rval().setUndefined(); | ||||
| 19001 | return true; | ||||
| 19002 | } | ||||
| 19003 | |||||
| 19004 | static const JSJitInfo passNullableSVS_methodinfo = { | ||||
| 19005 | { (JSJitGetterOp)passNullableSVS }, | ||||
| 19006 | { prototypes::id::TestJSImplInterface }, | ||||
| 19007 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19008 | JSJitInfo::Method, | ||||
| 19009 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19010 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19011 | false, /* isInfallible. False in setters. */ | ||||
| 19012 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19013 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19014 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19015 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19016 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19017 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19018 | }; | ||||
| 19019 | |||||
| 19020 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19021 | passOptionalSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19022 | { | ||||
| 19023 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19026( cx, "TestJSImplInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19024 | "TestJSImplInterface", "passOptionalSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19026( cx, "TestJSImplInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19025 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19026( cx, "TestJSImplInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19026 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19026( cx, "TestJSImplInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19027 | |||||
| 19028 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19029 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19030 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19031 | if (objIsXray) { | ||||
| 19032 | unwrappedObj.emplace(cx, obj); | ||||
| 19033 | } | ||||
| 19034 | Optional<nsAString> arg0; | ||||
| 19035 | binding_detail::FakeString<char16_t> arg0_holder; | ||||
| 19036 | if (args.hasDefined(0)) { | ||||
| 19037 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | ||||
| 19038 | return false; | ||||
| 19039 | } | ||||
| 19040 | if (!NormalizeUSVString(arg0_holder)) { | ||||
| 19041 | JS_ReportOutOfMemory(cx); | ||||
| 19042 | return false; | ||||
| 19043 | } | ||||
| 19044 | arg0 = &arg0_holder; | ||||
| 19045 | } | ||||
| 19046 | if (objIsXray) { | ||||
| 19047 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19048 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19049 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19050 | if (!unwrappedObj.ref()) { | ||||
| 19051 | return false; | ||||
| 19052 | } | ||||
| 19053 | } | ||||
| 19054 | FastErrorResult rv; | ||||
| 19055 | // NOTE: This assert does NOT call the function. | ||||
| 19056 | 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"); | ||||
| 19057 | MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19058 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS" )), 0))) { | ||||
| 19059 | return false; | ||||
| 19060 | } | ||||
| 19061 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19062 | args.rval().setUndefined(); | ||||
| 19063 | return true; | ||||
| 19064 | } | ||||
| 19065 | |||||
| 19066 | static const JSJitInfo passOptionalSVS_methodinfo = { | ||||
| 19067 | { (JSJitGetterOp)passOptionalSVS }, | ||||
| 19068 | { prototypes::id::TestJSImplInterface }, | ||||
| 19069 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19070 | JSJitInfo::Method, | ||||
| 19071 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19072 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19073 | false, /* isInfallible. False in setters. */ | ||||
| 19074 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19075 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19076 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19077 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19078 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19079 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19080 | }; | ||||
| 19081 | |||||
| 19082 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19083 | passOptionalSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19084 | { | ||||
| 19085 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19088( cx, "TestJSImplInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19086 | "TestJSImplInterface", "passOptionalSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19088( cx, "TestJSImplInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19087 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19088( cx, "TestJSImplInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19088 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19088( cx, "TestJSImplInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 19089 | |||||
| 19090 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19091 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19092 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19093 | if (objIsXray) { | ||||
| 19094 | unwrappedObj.emplace(cx, obj); | ||||
| 19095 | } | ||||
| 19096 | binding_detail::FakeString<char16_t> arg0; | ||||
| 19097 | if (args.hasDefined(0)) { | ||||
| 19098 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 19099 | return false; | ||||
| 19100 | } | ||||
| 19101 | if (!NormalizeUSVString(arg0)) { | ||||
| 19102 | JS_ReportOutOfMemory(cx); | ||||
| 19103 | return false; | ||||
| 19104 | } | ||||
| 19105 | } else { | ||||
| 19106 | arg0.AssignLiteral(u"abc"); | ||||
| 19107 | } | ||||
| 19108 | if (objIsXray) { | ||||
| 19109 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19110 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19111 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19112 | if (!unwrappedObj.ref()) { | ||||
| 19113 | return false; | ||||
| 19114 | } | ||||
| 19115 | } | ||||
| 19116 | FastErrorResult rv; | ||||
| 19117 | // NOTE: This assert does NOT call the function. | ||||
| 19118 | 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"); | ||||
| 19119 | MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19120 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue" )), 0))) { | ||||
| 19121 | return false; | ||||
| 19122 | } | ||||
| 19123 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19123); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19123; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19124 | args.rval().setUndefined(); | ||||
| 19125 | return true; | ||||
| 19126 | } | ||||
| 19127 | |||||
| 19128 | static const JSJitInfo passOptionalSVSWithDefaultValue_methodinfo = { | ||||
| 19129 | { (JSJitGetterOp)passOptionalSVSWithDefaultValue }, | ||||
| 19130 | { prototypes::id::TestJSImplInterface }, | ||||
| 19131 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19132 | JSJitInfo::Method, | ||||
| 19133 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19134 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19135 | false, /* isInfallible. False in setters. */ | ||||
| 19136 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19137 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19138 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19139 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19140 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19141 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19142 | }; | ||||
| 19143 | |||||
| 19144 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19145 | passOptionalNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19146 | { | ||||
| 19147 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19150( cx, "TestJSImplInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19148 | "TestJSImplInterface", "passOptionalNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19150( cx, "TestJSImplInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19149 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19150( cx, "TestJSImplInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19150 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19150( cx, "TestJSImplInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19151 | |||||
| 19152 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19153 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19154 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19155 | if (objIsXray) { | ||||
| 19156 | unwrappedObj.emplace(cx, obj); | ||||
| 19157 | } | ||||
| 19158 | Optional<nsAString> arg0; | ||||
| 19159 | binding_detail::FakeString<char16_t> arg0_holder; | ||||
| 19160 | if (args.hasDefined(0)) { | ||||
| 19161 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | ||||
| 19162 | return false; | ||||
| 19163 | } | ||||
| 19164 | if (!NormalizeUSVString(arg0_holder)) { | ||||
| 19165 | JS_ReportOutOfMemory(cx); | ||||
| 19166 | return false; | ||||
| 19167 | } | ||||
| 19168 | arg0 = &arg0_holder; | ||||
| 19169 | } | ||||
| 19170 | if (objIsXray) { | ||||
| 19171 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19172 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19173 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19174 | if (!unwrappedObj.ref()) { | ||||
| 19175 | return false; | ||||
| 19176 | } | ||||
| 19177 | } | ||||
| 19178 | FastErrorResult rv; | ||||
| 19179 | // NOTE: This assert does NOT call the function. | ||||
| 19180 | 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"); | ||||
| 19181 | MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19182 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS" )), 0))) { | ||||
| 19183 | return false; | ||||
| 19184 | } | ||||
| 19185 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19185); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19185; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19186 | args.rval().setUndefined(); | ||||
| 19187 | return true; | ||||
| 19188 | } | ||||
| 19189 | |||||
| 19190 | static const JSJitInfo passOptionalNullableSVS_methodinfo = { | ||||
| 19191 | { (JSJitGetterOp)passOptionalNullableSVS }, | ||||
| 19192 | { prototypes::id::TestJSImplInterface }, | ||||
| 19193 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19194 | JSJitInfo::Method, | ||||
| 19195 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19196 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19197 | false, /* isInfallible. False in setters. */ | ||||
| 19198 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19199 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19200 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19201 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19202 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19203 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19204 | }; | ||||
| 19205 | |||||
| 19206 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19207 | passOptionalNullableSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19208 | { | ||||
| 19209 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19212( cx, "TestJSImplInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19210 | "TestJSImplInterface", "passOptionalNullableSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19212( cx, "TestJSImplInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19211 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19212( cx, "TestJSImplInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19212 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19212( cx, "TestJSImplInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 19213 | |||||
| 19214 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19215 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19216 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19217 | if (objIsXray) { | ||||
| 19218 | unwrappedObj.emplace(cx, obj); | ||||
| 19219 | } | ||||
| 19220 | binding_detail::FakeString<char16_t> arg0; | ||||
| 19221 | if (args.hasDefined(0)) { | ||||
| 19222 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 19223 | return false; | ||||
| 19224 | } | ||||
| 19225 | if (!NormalizeUSVString(arg0)) { | ||||
| 19226 | JS_ReportOutOfMemory(cx); | ||||
| 19227 | return false; | ||||
| 19228 | } | ||||
| 19229 | } else { | ||||
| 19230 | arg0.SetIsVoid(true); | ||||
| 19231 | } | ||||
| 19232 | if (objIsXray) { | ||||
| 19233 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19234 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19235 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19236 | if (!unwrappedObj.ref()) { | ||||
| 19237 | return false; | ||||
| 19238 | } | ||||
| 19239 | } | ||||
| 19240 | FastErrorResult rv; | ||||
| 19241 | // NOTE: This assert does NOT call the function. | ||||
| 19242 | 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"); | ||||
| 19243 | MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19244 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue" )), 0))) { | ||||
| 19245 | return false; | ||||
| 19246 | } | ||||
| 19247 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19247); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19247; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19248 | args.rval().setUndefined(); | ||||
| 19249 | return true; | ||||
| 19250 | } | ||||
| 19251 | |||||
| 19252 | static const JSJitInfo passOptionalNullableSVSWithDefaultValue_methodinfo = { | ||||
| 19253 | { (JSJitGetterOp)passOptionalNullableSVSWithDefaultValue }, | ||||
| 19254 | { prototypes::id::TestJSImplInterface }, | ||||
| 19255 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19256 | JSJitInfo::Method, | ||||
| 19257 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19258 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19259 | false, /* isInfallible. False in setters. */ | ||||
| 19260 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19261 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19262 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19263 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19264 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19265 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19266 | }; | ||||
| 19267 | |||||
| 19268 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19269 | passVariadicSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19270 | { | ||||
| 19271 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19274( cx, "TestJSImplInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19272 | "TestJSImplInterface", "passVariadicSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19274( cx, "TestJSImplInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19273 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19274( cx, "TestJSImplInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19274 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19274( cx, "TestJSImplInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19275 | |||||
| 19276 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19277 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19278 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19279 | if (objIsXray) { | ||||
| 19280 | unwrappedObj.emplace(cx, obj); | ||||
| 19281 | } | ||||
| 19282 | AutoSequence<nsString> arg0; | ||||
| 19283 | if (args.length() > 0) { | ||||
| 19284 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 19285 | JS_ReportOutOfMemory(cx); | ||||
| 19286 | return false; | ||||
| 19287 | } | ||||
| 19288 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 19289 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 19290 | nsString& slot = *arg0.AppendElement(); | ||||
| 19291 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | ||||
| 19292 | return false; | ||||
| 19293 | } | ||||
| 19294 | if (!NormalizeUSVString(slot)) { | ||||
| 19295 | JS_ReportOutOfMemory(cx); | ||||
| 19296 | return false; | ||||
| 19297 | } | ||||
| 19298 | } | ||||
| 19299 | } | ||||
| 19300 | if (objIsXray) { | ||||
| 19301 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19302 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19303 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19304 | if (!unwrappedObj.ref()) { | ||||
| 19305 | return false; | ||||
| 19306 | } | ||||
| 19307 | } | ||||
| 19308 | FastErrorResult rv; | ||||
| 19309 | // NOTE: This assert does NOT call the function. | ||||
| 19310 | 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"); | ||||
| 19311 | MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19312 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS" )), 0))) { | ||||
| 19313 | return false; | ||||
| 19314 | } | ||||
| 19315 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19315); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19315; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19316 | args.rval().setUndefined(); | ||||
| 19317 | return true; | ||||
| 19318 | } | ||||
| 19319 | |||||
| 19320 | static const JSJitInfo passVariadicSVS_methodinfo = { | ||||
| 19321 | { (JSJitGetterOp)passVariadicSVS }, | ||||
| 19322 | { prototypes::id::TestJSImplInterface }, | ||||
| 19323 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19324 | JSJitInfo::Method, | ||||
| 19325 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19326 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19327 | false, /* isInfallible. False in setters. */ | ||||
| 19328 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19329 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19330 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19331 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19332 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19333 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19334 | }; | ||||
| 19335 | |||||
| 19336 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19337 | receiveSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19338 | { | ||||
| 19339 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19342( cx, "TestJSImplInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19340 | "TestJSImplInterface", "receiveSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19342( cx, "TestJSImplInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19341 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19342( cx, "TestJSImplInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19342 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19342( cx, "TestJSImplInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19343 | |||||
| 19344 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19345 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19346 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19347 | if (objIsXray) { | ||||
| 19348 | unwrappedObj.emplace(cx, obj); | ||||
| 19349 | } | ||||
| 19350 | if (objIsXray) { | ||||
| 19351 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19352 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19353 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19354 | if (!unwrappedObj.ref()) { | ||||
| 19355 | return false; | ||||
| 19356 | } | ||||
| 19357 | } | ||||
| 19358 | FastErrorResult rv; | ||||
| 19359 | DOMString result; | ||||
| 19360 | // NOTE: This assert does NOT call the function. | ||||
| 19361 | 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"); | ||||
| 19362 | MOZ_KnownLive(self)(self)->ReceiveSVS(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19363 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS" )), 0))) { | ||||
| 19364 | return false; | ||||
| 19365 | } | ||||
| 19366 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19366); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19366; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19367 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { | ||||
| 19368 | return false; | ||||
| 19369 | } | ||||
| 19370 | return true; | ||||
| 19371 | } | ||||
| 19372 | |||||
| 19373 | static const JSJitInfo receiveSVS_methodinfo = { | ||||
| 19374 | { (JSJitGetterOp)receiveSVS }, | ||||
| 19375 | { prototypes::id::TestJSImplInterface }, | ||||
| 19376 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19377 | JSJitInfo::Method, | ||||
| 19378 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19379 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 19380 | false, /* isInfallible. False in setters. */ | ||||
| 19381 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19382 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19383 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19384 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19385 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19386 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19387 | }; | ||||
| 19388 | |||||
| 19389 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19390 | passJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19391 | { | ||||
| 19392 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19395( cx, "TestJSImplInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19393 | "TestJSImplInterface", "passJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19395( cx, "TestJSImplInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19394 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19395( cx, "TestJSImplInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19395 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19395( cx, "TestJSImplInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19396 | |||||
| 19397 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19398 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passJSString", 1)) { | ||||
| 19399 | return false; | ||||
| 19400 | } | ||||
| 19401 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19402 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19403 | if (objIsXray) { | ||||
| 19404 | unwrappedObj.emplace(cx, obj); | ||||
| 19405 | } | ||||
| 19406 | JS::Rooted<JSString*> arg0(cx); | ||||
| 19407 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | ||||
| 19408 | return false; | ||||
| 19409 | } | ||||
| 19410 | if (objIsXray) { | ||||
| 19411 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19412 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19413 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19414 | if (!unwrappedObj.ref()) { | ||||
| 19415 | return false; | ||||
| 19416 | } | ||||
| 19417 | } | ||||
| 19418 | FastErrorResult rv; | ||||
| 19419 | // NOTE: This assert does NOT call the function. | ||||
| 19420 | 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"); | ||||
| 19421 | MOZ_KnownLive(self)(self)->PassJSString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19422 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString" )), 0))) { | ||||
| 19423 | return false; | ||||
| 19424 | } | ||||
| 19425 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19425); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19425; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19426 | args.rval().setUndefined(); | ||||
| 19427 | return true; | ||||
| 19428 | } | ||||
| 19429 | |||||
| 19430 | static const JSJitInfo passJSString_methodinfo = { | ||||
| 19431 | { (JSJitGetterOp)passJSString }, | ||||
| 19432 | { prototypes::id::TestJSImplInterface }, | ||||
| 19433 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19434 | JSJitInfo::Method, | ||||
| 19435 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19436 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19437 | false, /* isInfallible. False in setters. */ | ||||
| 19438 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19439 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19440 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19441 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19442 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19443 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19444 | }; | ||||
| 19445 | |||||
| 19446 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19447 | passOptionalJSStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19448 | { | ||||
| 19449 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19452( cx, "TestJSImplInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19450 | "TestJSImplInterface", "passOptionalJSStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19452( cx, "TestJSImplInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19451 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19452( cx, "TestJSImplInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19452 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19452( cx, "TestJSImplInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 19453 | |||||
| 19454 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19455 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19456 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19457 | if (objIsXray) { | ||||
| 19458 | unwrappedObj.emplace(cx, obj); | ||||
| 19459 | } | ||||
| 19460 | JS::Rooted<JSString*> arg0(cx); | ||||
| 19461 | if (args.hasDefined(0)) { | ||||
| 19462 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | ||||
| 19463 | return false; | ||||
| 19464 | } | ||||
| 19465 | } else { | ||||
| 19466 | static const char data[] = { 'a', 'b', 'c', 0 }; | ||||
| 19467 | arg0 = JS_NewStringCopyN(cx, data, std::size(data) - 1); | ||||
| 19468 | if (!arg0) { | ||||
| 19469 | return false; | ||||
| 19470 | } | ||||
| 19471 | } | ||||
| 19472 | if (objIsXray) { | ||||
| 19473 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19474 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19475 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19476 | if (!unwrappedObj.ref()) { | ||||
| 19477 | return false; | ||||
| 19478 | } | ||||
| 19479 | } | ||||
| 19480 | FastErrorResult rv; | ||||
| 19481 | // NOTE: This assert does NOT call the function. | ||||
| 19482 | 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"); | ||||
| 19483 | MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19484 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue" )), 0))) { | ||||
| 19485 | return false; | ||||
| 19486 | } | ||||
| 19487 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19487); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19487; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19488 | args.rval().setUndefined(); | ||||
| 19489 | return true; | ||||
| 19490 | } | ||||
| 19491 | |||||
| 19492 | static const JSJitInfo passOptionalJSStringWithDefaultValue_methodinfo = { | ||||
| 19493 | { (JSJitGetterOp)passOptionalJSStringWithDefaultValue }, | ||||
| 19494 | { prototypes::id::TestJSImplInterface }, | ||||
| 19495 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19496 | JSJitInfo::Method, | ||||
| 19497 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19498 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19499 | false, /* isInfallible. False in setters. */ | ||||
| 19500 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19501 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19502 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19503 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19504 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19505 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19506 | }; | ||||
| 19507 | |||||
| 19508 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19509 | receiveJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19510 | { | ||||
| 19511 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19514( cx, "TestJSImplInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19512 | "TestJSImplInterface", "receiveJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19514( cx, "TestJSImplInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19513 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19514( cx, "TestJSImplInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19514 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19514( cx, "TestJSImplInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19515 | |||||
| 19516 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19517 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19518 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19519 | if (objIsXray) { | ||||
| 19520 | unwrappedObj.emplace(cx, obj); | ||||
| 19521 | } | ||||
| 19522 | if (objIsXray) { | ||||
| 19523 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19524 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19525 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19526 | if (!unwrappedObj.ref()) { | ||||
| 19527 | return false; | ||||
| 19528 | } | ||||
| 19529 | } | ||||
| 19530 | FastErrorResult rv; | ||||
| 19531 | JS::Rooted<JSString*> result(cx); | ||||
| 19532 | // NOTE: This assert does NOT call the function. | ||||
| 19533 | 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"); | ||||
| 19534 | MOZ_KnownLive(self)(self)->ReceiveJSString(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19535 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString" )), 0))) { | ||||
| 19536 | return false; | ||||
| 19537 | } | ||||
| 19538 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19538); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19538; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19539 | args.rval().setString(result); | ||||
| 19540 | if (!MaybeWrapStringValue(cx, args.rval())) { | ||||
| 19541 | return false; | ||||
| 19542 | } | ||||
| 19543 | return true; | ||||
| 19544 | } | ||||
| 19545 | |||||
| 19546 | static const JSJitInfo receiveJSString_methodinfo = { | ||||
| 19547 | { (JSJitGetterOp)receiveJSString }, | ||||
| 19548 | { prototypes::id::TestJSImplInterface }, | ||||
| 19549 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19550 | JSJitInfo::Method, | ||||
| 19551 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19552 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 19553 | false, /* isInfallible. False in setters. */ | ||||
| 19554 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19555 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19556 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19557 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19558 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19559 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19560 | }; | ||||
| 19561 | |||||
| 19562 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19563 | get_readonlyJSStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 19564 | { | ||||
| 19565 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19568( cx, "TestJSImplInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19566 | "TestJSImplInterface", "readonlyJSStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19568( cx, "TestJSImplInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19567 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19568( cx, "TestJSImplInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19568 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19568( cx, "TestJSImplInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19569 | |||||
| 19570 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19571 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19572 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19573 | if (objIsXray) { | ||||
| 19574 | unwrappedObj.emplace(cx, obj); | ||||
| 19575 | } | ||||
| 19576 | if (objIsXray) { | ||||
| 19577 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19578 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19579 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19580 | if (!unwrappedObj.ref()) { | ||||
| 19581 | return false; | ||||
| 19582 | } | ||||
| 19583 | } | ||||
| 19584 | FastErrorResult rv; | ||||
| 19585 | JS::Rooted<JSString*> result(cx); | ||||
| 19586 | // NOTE: This assert does NOT call the function. | ||||
| 19587 | 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"); | ||||
| 19588 | MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19589 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter" )), 0))) { | ||||
| 19590 | return false; | ||||
| 19591 | } | ||||
| 19592 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19592); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19592; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19593 | args.rval().setString(result); | ||||
| 19594 | if (!MaybeWrapStringValue(cx, args.rval())) { | ||||
| 19595 | return false; | ||||
| 19596 | } | ||||
| 19597 | return true; | ||||
| 19598 | } | ||||
| 19599 | |||||
| 19600 | static const JSJitInfo readonlyJSStringAttr_getterinfo = { | ||||
| 19601 | { get_readonlyJSStringAttr }, | ||||
| 19602 | { prototypes::id::TestJSImplInterface }, | ||||
| 19603 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19604 | JSJitInfo::Getter, | ||||
| 19605 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19606 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 19607 | false, /* isInfallible. False in setters. */ | ||||
| 19608 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19609 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19610 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19611 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19612 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19613 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19614 | }; | ||||
| 19615 | |||||
| 19616 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19617 | get_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 19618 | { | ||||
| 19619 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19622( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19620 | "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19622( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19621 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19622( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19622 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19622( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19623 | |||||
| 19624 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19625 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19626 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19627 | if (objIsXray) { | ||||
| 19628 | unwrappedObj.emplace(cx, obj); | ||||
| 19629 | } | ||||
| 19630 | if (objIsXray) { | ||||
| 19631 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19632 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19633 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19634 | if (!unwrappedObj.ref()) { | ||||
| 19635 | return false; | ||||
| 19636 | } | ||||
| 19637 | } | ||||
| 19638 | FastErrorResult rv; | ||||
| 19639 | JS::Rooted<JSString*> result(cx); | ||||
| 19640 | // NOTE: This assert does NOT call the function. | ||||
| 19641 | 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"); | ||||
| 19642 | MOZ_KnownLive(self)(self)->GetJsStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19643 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter" )), 0))) { | ||||
| 19644 | return false; | ||||
| 19645 | } | ||||
| 19646 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19646); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19646; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19647 | args.rval().setString(result); | ||||
| 19648 | if (!MaybeWrapStringValue(cx, args.rval())) { | ||||
| 19649 | return false; | ||||
| 19650 | } | ||||
| 19651 | return true; | ||||
| 19652 | } | ||||
| 19653 | |||||
| 19654 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19655 | set_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 19656 | { | ||||
| 19657 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19660( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19658 | "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19660( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19659 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject19660( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19660 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19660( cx, "TestJSImplInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19661 | |||||
| 19662 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19663 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19664 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19665 | if (objIsXray) { | ||||
| 19666 | unwrappedObj.emplace(cx, obj); | ||||
| 19667 | } | ||||
| 19668 | JS::Rooted<JSString*> arg0(cx); | ||||
| 19669 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | ||||
| 19670 | return false; | ||||
| 19671 | } | ||||
| 19672 | if (objIsXray) { | ||||
| 19673 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19674 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19675 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19676 | if (!unwrappedObj.ref()) { | ||||
| 19677 | return false; | ||||
| 19678 | } | ||||
| 19679 | } | ||||
| 19680 | FastErrorResult rv; | ||||
| 19681 | // NOTE: This assert does NOT call the function. | ||||
| 19682 | 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"); | ||||
| 19683 | MOZ_KnownLive(self)(self)->SetJsStringAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19684 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter" )), 0))) { | ||||
| 19685 | return false; | ||||
| 19686 | } | ||||
| 19687 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19687); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19687; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19688 | |||||
| 19689 | return true; | ||||
| 19690 | } | ||||
| 19691 | |||||
| 19692 | static const JSJitInfo jsStringAttr_getterinfo = { | ||||
| 19693 | { get_jsStringAttr }, | ||||
| 19694 | { prototypes::id::TestJSImplInterface }, | ||||
| 19695 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19696 | JSJitInfo::Getter, | ||||
| 19697 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19698 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 19699 | false, /* isInfallible. False in setters. */ | ||||
| 19700 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19701 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19702 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19703 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19704 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19705 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19706 | }; | ||||
| 19707 | static const JSJitInfo jsStringAttr_setterinfo = { | ||||
| 19708 | { (JSJitGetterOp)set_jsStringAttr }, | ||||
| 19709 | { prototypes::id::TestJSImplInterface }, | ||||
| 19710 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19711 | JSJitInfo::Setter, | ||||
| 19712 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19713 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19714 | false, /* isInfallible. False in setters. */ | ||||
| 19715 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19716 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19717 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19718 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19719 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19720 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19721 | }; | ||||
| 19722 | |||||
| 19723 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19724 | passEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19725 | { | ||||
| 19726 | BindingCallContext cx(cx_, "TestJSImplInterface.passEnum"); | ||||
| 19727 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19730( cx, "TestJSImplInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 19728 | "TestJSImplInterface", "passEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19730( cx, "TestJSImplInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 19729 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19730( cx, "TestJSImplInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 19730 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19730( cx, "TestJSImplInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 19731 | |||||
| 19732 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19733 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passEnum", 1)) { | ||||
| 19734 | return false; | ||||
| 19735 | } | ||||
| 19736 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19737 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19738 | if (objIsXray) { | ||||
| 19739 | unwrappedObj.emplace(cx, obj); | ||||
| 19740 | } | ||||
| 19741 | MyTestEnum arg0; | ||||
| 19742 | { | ||||
| 19743 | int index; | ||||
| 19744 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 19745 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 19746 | "MyTestEnum", "argument 1", | ||||
| 19747 | &index)) { | ||||
| 19748 | return false; | ||||
| 19749 | } | ||||
| 19750 | 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", 19750); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 19750; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 19751 | arg0 = static_cast<MyTestEnum>(index); | ||||
| 19752 | } | ||||
| 19753 | if (objIsXray) { | ||||
| 19754 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19755 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19756 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19757 | if (!unwrappedObj.ref()) { | ||||
| 19758 | return false; | ||||
| 19759 | } | ||||
| 19760 | } | ||||
| 19761 | FastErrorResult rv; | ||||
| 19762 | // NOTE: This assert does NOT call the function. | ||||
| 19763 | 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"); | ||||
| 19764 | MOZ_KnownLive(self)(self)->PassEnum(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19765 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum" )), 0))) { | ||||
| 19766 | return false; | ||||
| 19767 | } | ||||
| 19768 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19768); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19768; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19769 | args.rval().setUndefined(); | ||||
| 19770 | return true; | ||||
| 19771 | } | ||||
| 19772 | |||||
| 19773 | static const JSJitInfo passEnum_methodinfo = { | ||||
| 19774 | { (JSJitGetterOp)passEnum }, | ||||
| 19775 | { prototypes::id::TestJSImplInterface }, | ||||
| 19776 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19777 | JSJitInfo::Method, | ||||
| 19778 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19779 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19780 | false, /* isInfallible. False in setters. */ | ||||
| 19781 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19782 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19783 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19784 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19785 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19786 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19787 | }; | ||||
| 19788 | |||||
| 19789 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19790 | passNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19791 | { | ||||
| 19792 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableEnum"); | ||||
| 19793 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19796( cx, "TestJSImplInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19794 | "TestJSImplInterface", "passNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19796( cx, "TestJSImplInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19795 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19796( cx, "TestJSImplInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19796 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19796( cx, "TestJSImplInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19797 | |||||
| 19798 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19799 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableEnum", 1)) { | ||||
| 19800 | return false; | ||||
| 19801 | } | ||||
| 19802 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19803 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19804 | if (objIsXray) { | ||||
| 19805 | unwrappedObj.emplace(cx, obj); | ||||
| 19806 | } | ||||
| 19807 | Nullable<MyTestEnum> arg0; | ||||
| 19808 | if (args[0].isNullOrUndefined()) { | ||||
| 19809 | arg0.SetNull(); | ||||
| 19810 | } else { | ||||
| 19811 | { | ||||
| 19812 | int index; | ||||
| 19813 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 19814 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 19815 | "MyTestEnum", "argument 1", | ||||
| 19816 | &index)) { | ||||
| 19817 | return false; | ||||
| 19818 | } | ||||
| 19819 | 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", 19819); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 19819; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 19820 | arg0.SetValue() = static_cast<MyTestEnum>(index); | ||||
| 19821 | } | ||||
| 19822 | } | ||||
| 19823 | if (objIsXray) { | ||||
| 19824 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19825 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19826 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19827 | if (!unwrappedObj.ref()) { | ||||
| 19828 | return false; | ||||
| 19829 | } | ||||
| 19830 | } | ||||
| 19831 | FastErrorResult rv; | ||||
| 19832 | // NOTE: This assert does NOT call the function. | ||||
| 19833 | 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"); | ||||
| 19834 | MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19835 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum" )), 0))) { | ||||
| 19836 | return false; | ||||
| 19837 | } | ||||
| 19838 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19838); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19838; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19839 | args.rval().setUndefined(); | ||||
| 19840 | return true; | ||||
| 19841 | } | ||||
| 19842 | |||||
| 19843 | static const JSJitInfo passNullableEnum_methodinfo = { | ||||
| 19844 | { (JSJitGetterOp)passNullableEnum }, | ||||
| 19845 | { prototypes::id::TestJSImplInterface }, | ||||
| 19846 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19847 | JSJitInfo::Method, | ||||
| 19848 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19849 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19850 | false, /* isInfallible. False in setters. */ | ||||
| 19851 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19852 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19853 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19854 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19855 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19856 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19857 | }; | ||||
| 19858 | |||||
| 19859 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19860 | passOptionalEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19861 | { | ||||
| 19862 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalEnum"); | ||||
| 19863 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19866( cx, "TestJSImplInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19864 | "TestJSImplInterface", "passOptionalEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19866( cx, "TestJSImplInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19865 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19866( cx, "TestJSImplInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19866 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19866( cx, "TestJSImplInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19867 | |||||
| 19868 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19869 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19870 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19871 | if (objIsXray) { | ||||
| 19872 | unwrappedObj.emplace(cx, obj); | ||||
| 19873 | } | ||||
| 19874 | Optional<MyTestEnum> arg0; | ||||
| 19875 | if (args.hasDefined(0)) { | ||||
| 19876 | arg0.Construct(); | ||||
| 19877 | { | ||||
| 19878 | int index; | ||||
| 19879 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 19880 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 19881 | "MyTestEnum", "argument 1", | ||||
| 19882 | &index)) { | ||||
| 19883 | return false; | ||||
| 19884 | } | ||||
| 19885 | 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", 19885); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 19885; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 19886 | arg0.Value() = static_cast<MyTestEnum>(index); | ||||
| 19887 | } | ||||
| 19888 | } | ||||
| 19889 | if (objIsXray) { | ||||
| 19890 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19891 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19892 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19893 | if (!unwrappedObj.ref()) { | ||||
| 19894 | return false; | ||||
| 19895 | } | ||||
| 19896 | } | ||||
| 19897 | FastErrorResult rv; | ||||
| 19898 | // NOTE: This assert does NOT call the function. | ||||
| 19899 | 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"); | ||||
| 19900 | MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19901 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum" )), 0))) { | ||||
| 19902 | return false; | ||||
| 19903 | } | ||||
| 19904 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19904); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19904; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19905 | args.rval().setUndefined(); | ||||
| 19906 | return true; | ||||
| 19907 | } | ||||
| 19908 | |||||
| 19909 | static const JSJitInfo passOptionalEnum_methodinfo = { | ||||
| 19910 | { (JSJitGetterOp)passOptionalEnum }, | ||||
| 19911 | { prototypes::id::TestJSImplInterface }, | ||||
| 19912 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19913 | JSJitInfo::Method, | ||||
| 19914 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19915 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19916 | false, /* isInfallible. False in setters. */ | ||||
| 19917 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19918 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19919 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19920 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19921 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19922 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19923 | }; | ||||
| 19924 | |||||
| 19925 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19926 | passEnumWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19927 | { | ||||
| 19928 | BindingCallContext cx(cx_, "TestJSImplInterface.passEnumWithDefault"); | ||||
| 19929 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19932( cx, "TestJSImplInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19930 | "TestJSImplInterface", "passEnumWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19932( cx, "TestJSImplInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19931 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19932( cx, "TestJSImplInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 19932 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19932( cx, "TestJSImplInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 19933 | |||||
| 19934 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 19935 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 19936 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 19937 | if (objIsXray) { | ||||
| 19938 | unwrappedObj.emplace(cx, obj); | ||||
| 19939 | } | ||||
| 19940 | MyTestEnum arg0; | ||||
| 19941 | if (args.hasDefined(0)) { | ||||
| 19942 | { | ||||
| 19943 | int index; | ||||
| 19944 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 19945 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 19946 | "MyTestEnum", "argument 1", | ||||
| 19947 | &index)) { | ||||
| 19948 | return false; | ||||
| 19949 | } | ||||
| 19950 | 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", 19950); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 19950; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 19951 | arg0 = static_cast<MyTestEnum>(index); | ||||
| 19952 | } | ||||
| 19953 | } else { | ||||
| 19954 | arg0 = MyTestEnum::A; | ||||
| 19955 | } | ||||
| 19956 | if (objIsXray) { | ||||
| 19957 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 19958 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 19959 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 19960 | if (!unwrappedObj.ref()) { | ||||
| 19961 | return false; | ||||
| 19962 | } | ||||
| 19963 | } | ||||
| 19964 | FastErrorResult rv; | ||||
| 19965 | // NOTE: This assert does NOT call the function. | ||||
| 19966 | 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"); | ||||
| 19967 | MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 19968 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault" )), 0))) { | ||||
| 19969 | return false; | ||||
| 19970 | } | ||||
| 19971 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 19971); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19971; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 19972 | args.rval().setUndefined(); | ||||
| 19973 | return true; | ||||
| 19974 | } | ||||
| 19975 | |||||
| 19976 | static const JSJitInfo passEnumWithDefault_methodinfo = { | ||||
| 19977 | { (JSJitGetterOp)passEnumWithDefault }, | ||||
| 19978 | { prototypes::id::TestJSImplInterface }, | ||||
| 19979 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 19980 | JSJitInfo::Method, | ||||
| 19981 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 19982 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 19983 | false, /* isInfallible. False in setters. */ | ||||
| 19984 | false, /* isMovable. Not relevant for setters. */ | ||||
| 19985 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 19986 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 19987 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 19988 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 19989 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 19990 | }; | ||||
| 19991 | |||||
| 19992 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 19993 | passOptionalNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 19994 | { | ||||
| 19995 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnum"); | ||||
| 19996 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19999( cx, "TestJSImplInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19997 | "TestJSImplInterface", "passOptionalNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19999( cx, "TestJSImplInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19998 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19999( cx, "TestJSImplInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 19999 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19999( cx, "TestJSImplInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 20000 | |||||
| 20001 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20002 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20003 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20004 | if (objIsXray) { | ||||
| 20005 | unwrappedObj.emplace(cx, obj); | ||||
| 20006 | } | ||||
| 20007 | Optional<Nullable<MyTestEnum>> arg0; | ||||
| 20008 | if (args.hasDefined(0)) { | ||||
| 20009 | arg0.Construct(); | ||||
| 20010 | if (args[0].isNullOrUndefined()) { | ||||
| 20011 | arg0.Value().SetNull(); | ||||
| 20012 | } else { | ||||
| 20013 | { | ||||
| 20014 | int index; | ||||
| 20015 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 20016 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 20017 | "MyTestEnum", "argument 1", | ||||
| 20018 | &index)) { | ||||
| 20019 | return false; | ||||
| 20020 | } | ||||
| 20021 | 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", 20021); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 20021; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 20022 | arg0.Value().SetValue() = static_cast<MyTestEnum>(index); | ||||
| 20023 | } | ||||
| 20024 | } | ||||
| 20025 | } | ||||
| 20026 | if (objIsXray) { | ||||
| 20027 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20028 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20029 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20030 | if (!unwrappedObj.ref()) { | ||||
| 20031 | return false; | ||||
| 20032 | } | ||||
| 20033 | } | ||||
| 20034 | FastErrorResult rv; | ||||
| 20035 | // NOTE: This assert does NOT call the function. | ||||
| 20036 | 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"); | ||||
| 20037 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20038 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum" )), 0))) { | ||||
| 20039 | return false; | ||||
| 20040 | } | ||||
| 20041 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20041); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20041; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20042 | args.rval().setUndefined(); | ||||
| 20043 | return true; | ||||
| 20044 | } | ||||
| 20045 | |||||
| 20046 | static const JSJitInfo passOptionalNullableEnum_methodinfo = { | ||||
| 20047 | { (JSJitGetterOp)passOptionalNullableEnum }, | ||||
| 20048 | { prototypes::id::TestJSImplInterface }, | ||||
| 20049 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20050 | JSJitInfo::Method, | ||||
| 20051 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20052 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20053 | false, /* isInfallible. False in setters. */ | ||||
| 20054 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20055 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20056 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20057 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20058 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20059 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20060 | }; | ||||
| 20061 | |||||
| 20062 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20063 | passOptionalNullableEnumWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20064 | { | ||||
| 20065 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"); | ||||
| 20066 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20069( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20067 | "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20069( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20068 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20069( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20069 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20069( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 20070 | |||||
| 20071 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20072 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20073 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20074 | if (objIsXray) { | ||||
| 20075 | unwrappedObj.emplace(cx, obj); | ||||
| 20076 | } | ||||
| 20077 | Nullable<MyTestEnum> arg0; | ||||
| 20078 | if (args.hasDefined(0)) { | ||||
| 20079 | if (args[0].isNullOrUndefined()) { | ||||
| 20080 | arg0.SetNull(); | ||||
| 20081 | } else { | ||||
| 20082 | { | ||||
| 20083 | int index; | ||||
| 20084 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 20085 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 20086 | "MyTestEnum", "argument 1", | ||||
| 20087 | &index)) { | ||||
| 20088 | return false; | ||||
| 20089 | } | ||||
| 20090 | 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", 20090); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 20090; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 20091 | arg0.SetValue() = static_cast<MyTestEnum>(index); | ||||
| 20092 | } | ||||
| 20093 | } | ||||
| 20094 | } else { | ||||
| 20095 | arg0.SetNull(); | ||||
| 20096 | } | ||||
| 20097 | if (objIsXray) { | ||||
| 20098 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20099 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20100 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20101 | if (!unwrappedObj.ref()) { | ||||
| 20102 | return false; | ||||
| 20103 | } | ||||
| 20104 | } | ||||
| 20105 | FastErrorResult rv; | ||||
| 20106 | // NOTE: This assert does NOT call the function. | ||||
| 20107 | 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"); | ||||
| 20108 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20109 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue" )), 0))) { | ||||
| 20110 | return false; | ||||
| 20111 | } | ||||
| 20112 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20112); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20112; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20113 | args.rval().setUndefined(); | ||||
| 20114 | return true; | ||||
| 20115 | } | ||||
| 20116 | |||||
| 20117 | static const JSJitInfo passOptionalNullableEnumWithDefaultValue_methodinfo = { | ||||
| 20118 | { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue }, | ||||
| 20119 | { prototypes::id::TestJSImplInterface }, | ||||
| 20120 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20121 | JSJitInfo::Method, | ||||
| 20122 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20123 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20124 | false, /* isInfallible. False in setters. */ | ||||
| 20125 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20126 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20127 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20128 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20129 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20130 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20131 | }; | ||||
| 20132 | |||||
| 20133 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20134 | passOptionalNullableEnumWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20135 | { | ||||
| 20136 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"); | ||||
| 20137 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20140( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20138 | "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20140( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20139 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20140( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20140 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20140( cx, "TestJSImplInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 20141 | |||||
| 20142 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20143 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20144 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20145 | if (objIsXray) { | ||||
| 20146 | unwrappedObj.emplace(cx, obj); | ||||
| 20147 | } | ||||
| 20148 | Nullable<MyTestEnum> arg0; | ||||
| 20149 | if (args.hasDefined(0)) { | ||||
| 20150 | if (args[0].isNullOrUndefined()) { | ||||
| 20151 | arg0.SetNull(); | ||||
| 20152 | } else { | ||||
| 20153 | { | ||||
| 20154 | int index; | ||||
| 20155 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 20156 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 20157 | "MyTestEnum", "argument 1", | ||||
| 20158 | &index)) { | ||||
| 20159 | return false; | ||||
| 20160 | } | ||||
| 20161 | 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", 20161); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 20161; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 20162 | arg0.SetValue() = static_cast<MyTestEnum>(index); | ||||
| 20163 | } | ||||
| 20164 | } | ||||
| 20165 | } else { | ||||
| 20166 | arg0.SetValue() = MyTestEnum::A; | ||||
| 20167 | } | ||||
| 20168 | if (objIsXray) { | ||||
| 20169 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20170 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20171 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20172 | if (!unwrappedObj.ref()) { | ||||
| 20173 | return false; | ||||
| 20174 | } | ||||
| 20175 | } | ||||
| 20176 | FastErrorResult rv; | ||||
| 20177 | // NOTE: This assert does NOT call the function. | ||||
| 20178 | 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"); | ||||
| 20179 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20180 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2" )), 0))) { | ||||
| 20181 | return false; | ||||
| 20182 | } | ||||
| 20183 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20183); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20183; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20184 | args.rval().setUndefined(); | ||||
| 20185 | return true; | ||||
| 20186 | } | ||||
| 20187 | |||||
| 20188 | static const JSJitInfo passOptionalNullableEnumWithDefaultValue2_methodinfo = { | ||||
| 20189 | { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue2 }, | ||||
| 20190 | { prototypes::id::TestJSImplInterface }, | ||||
| 20191 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20192 | JSJitInfo::Method, | ||||
| 20193 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20194 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20195 | false, /* isInfallible. False in setters. */ | ||||
| 20196 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20197 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20198 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20199 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20200 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20201 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20202 | }; | ||||
| 20203 | |||||
| 20204 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20205 | receiveEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20206 | { | ||||
| 20207 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20210( cx, "TestJSImplInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20208 | "TestJSImplInterface", "receiveEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20210( cx, "TestJSImplInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20209 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20210( cx, "TestJSImplInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20210 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20210( cx, "TestJSImplInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20211 | |||||
| 20212 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20213 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20214 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20215 | if (objIsXray) { | ||||
| 20216 | unwrappedObj.emplace(cx, obj); | ||||
| 20217 | } | ||||
| 20218 | if (objIsXray) { | ||||
| 20219 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20220 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20221 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20222 | if (!unwrappedObj.ref()) { | ||||
| 20223 | return false; | ||||
| 20224 | } | ||||
| 20225 | } | ||||
| 20226 | FastErrorResult rv; | ||||
| 20227 | MyTestEnum result(MOZ_KnownLive(self)(self)->ReceiveEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20228 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum" )), 0))) { | ||||
| 20229 | return false; | ||||
| 20230 | } | ||||
| 20231 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20231); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20231; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20232 | if (!ToJSValue(cx, result, args.rval())) { | ||||
| 20233 | return false; | ||||
| 20234 | } | ||||
| 20235 | return true; | ||||
| 20236 | } | ||||
| 20237 | |||||
| 20238 | static const JSJitInfo receiveEnum_methodinfo = { | ||||
| 20239 | { (JSJitGetterOp)receiveEnum }, | ||||
| 20240 | { prototypes::id::TestJSImplInterface }, | ||||
| 20241 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20242 | JSJitInfo::Method, | ||||
| 20243 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20244 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 20245 | false, /* isInfallible. False in setters. */ | ||||
| 20246 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20247 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20248 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20249 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20250 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20251 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20252 | }; | ||||
| 20253 | |||||
| 20254 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20255 | receiveNullableEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20256 | { | ||||
| 20257 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20260( cx, "TestJSImplInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20258 | "TestJSImplInterface", "receiveNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20260( cx, "TestJSImplInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20259 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20260( cx, "TestJSImplInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20260 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20260( cx, "TestJSImplInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20261 | |||||
| 20262 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20263 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20264 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20265 | if (objIsXray) { | ||||
| 20266 | unwrappedObj.emplace(cx, obj); | ||||
| 20267 | } | ||||
| 20268 | if (objIsXray) { | ||||
| 20269 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20270 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20271 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20272 | if (!unwrappedObj.ref()) { | ||||
| 20273 | return false; | ||||
| 20274 | } | ||||
| 20275 | } | ||||
| 20276 | FastErrorResult rv; | ||||
| 20277 | Nullable<MyTestEnum> result(MOZ_KnownLive(self)(self)->ReceiveNullableEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20278 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum" )), 0))) { | ||||
| 20279 | return false; | ||||
| 20280 | } | ||||
| 20281 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20281); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20281; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20282 | if (result.IsNull()) { | ||||
| 20283 | args.rval().setNull(); | ||||
| 20284 | return true; | ||||
| 20285 | } else { | ||||
| 20286 | if (!ToJSValue(cx, result.Value(), args.rval())) { | ||||
| 20287 | return false; | ||||
| 20288 | } | ||||
| 20289 | return true; | ||||
| 20290 | } | ||||
| 20291 | } | ||||
| 20292 | |||||
| 20293 | static const JSJitInfo receiveNullableEnum_methodinfo = { | ||||
| 20294 | { (JSJitGetterOp)receiveNullableEnum }, | ||||
| 20295 | { prototypes::id::TestJSImplInterface }, | ||||
| 20296 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20297 | JSJitInfo::Method, | ||||
| 20298 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20299 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 20300 | false, /* isInfallible. False in setters. */ | ||||
| 20301 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20302 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20303 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20304 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20305 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20306 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20307 | }; | ||||
| 20308 | |||||
| 20309 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20310 | get_enumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 20311 | { | ||||
| 20312 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20315( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20313 | "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20315( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20314 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20315( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20315 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20315( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20316 | |||||
| 20317 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20318 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20319 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20320 | if (objIsXray) { | ||||
| 20321 | unwrappedObj.emplace(cx, obj); | ||||
| 20322 | } | ||||
| 20323 | if (objIsXray) { | ||||
| 20324 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20325 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20326 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20327 | if (!unwrappedObj.ref()) { | ||||
| 20328 | return false; | ||||
| 20329 | } | ||||
| 20330 | } | ||||
| 20331 | FastErrorResult rv; | ||||
| 20332 | MyTestEnum result(MOZ_KnownLive(self)(self)->GetEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20333 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter" )), 0))) { | ||||
| 20334 | return false; | ||||
| 20335 | } | ||||
| 20336 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20336); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20336; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20337 | if (!ToJSValue(cx, result, args.rval())) { | ||||
| 20338 | return false; | ||||
| 20339 | } | ||||
| 20340 | return true; | ||||
| 20341 | } | ||||
| 20342 | |||||
| 20343 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20344 | set_enumAttribute(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 20345 | { | ||||
| 20346 | BindingCallContext cx(cx_, "TestJSImplInterface.enumAttribute setter"); | ||||
| 20347 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20350( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20348 | "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20350( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20349 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject20350( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20350 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20350( cx, "TestJSImplInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20351 | |||||
| 20352 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20353 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20354 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20355 | if (objIsXray) { | ||||
| 20356 | unwrappedObj.emplace(cx, obj); | ||||
| 20357 | } | ||||
| 20358 | MyTestEnum arg0; | ||||
| 20359 | { | ||||
| 20360 | int index; | ||||
| 20361 | if (!binding_detail::FindEnumStringIndex<false>(cx, args[0], | ||||
| 20362 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 20363 | "MyTestEnum", "value being assigned", | ||||
| 20364 | &index)) { | ||||
| 20365 | return false; | ||||
| 20366 | } | ||||
| 20367 | if (index < 0) { | ||||
| 20368 | return true; | ||||
| 20369 | } | ||||
| 20370 | arg0 = static_cast<MyTestEnum>(index); | ||||
| 20371 | } | ||||
| 20372 | if (objIsXray) { | ||||
| 20373 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20374 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20375 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20376 | if (!unwrappedObj.ref()) { | ||||
| 20377 | return false; | ||||
| 20378 | } | ||||
| 20379 | } | ||||
| 20380 | FastErrorResult rv; | ||||
| 20381 | // NOTE: This assert does NOT call the function. | ||||
| 20382 | 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"); | ||||
| 20383 | MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20384 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter" )), 0))) { | ||||
| 20385 | return false; | ||||
| 20386 | } | ||||
| 20387 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20387); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20387; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20388 | |||||
| 20389 | return true; | ||||
| 20390 | } | ||||
| 20391 | |||||
| 20392 | static const JSJitInfo enumAttribute_getterinfo = { | ||||
| 20393 | { get_enumAttribute }, | ||||
| 20394 | { prototypes::id::TestJSImplInterface }, | ||||
| 20395 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20396 | JSJitInfo::Getter, | ||||
| 20397 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20398 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 20399 | false, /* isInfallible. False in setters. */ | ||||
| 20400 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20401 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20402 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20403 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20404 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20405 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20406 | }; | ||||
| 20407 | static const JSJitInfo enumAttribute_setterinfo = { | ||||
| 20408 | { (JSJitGetterOp)set_enumAttribute }, | ||||
| 20409 | { prototypes::id::TestJSImplInterface }, | ||||
| 20410 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20411 | JSJitInfo::Setter, | ||||
| 20412 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20413 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20414 | false, /* isInfallible. False in setters. */ | ||||
| 20415 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20416 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20417 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20418 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20419 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20420 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20421 | }; | ||||
| 20422 | |||||
| 20423 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20424 | get_readonlyEnumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 20425 | { | ||||
| 20426 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20429( cx, "TestJSImplInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20427 | "TestJSImplInterface", "readonlyEnumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20429( cx, "TestJSImplInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20428 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20429( cx, "TestJSImplInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20429 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20429( cx, "TestJSImplInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20430 | |||||
| 20431 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20432 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20433 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20434 | if (objIsXray) { | ||||
| 20435 | unwrappedObj.emplace(cx, obj); | ||||
| 20436 | } | ||||
| 20437 | if (objIsXray) { | ||||
| 20438 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20439 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20440 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20441 | if (!unwrappedObj.ref()) { | ||||
| 20442 | return false; | ||||
| 20443 | } | ||||
| 20444 | } | ||||
| 20445 | FastErrorResult rv; | ||||
| 20446 | MyTestEnum result(MOZ_KnownLive(self)(self)->GetReadonlyEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20447 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter" )), 0))) { | ||||
| 20448 | return false; | ||||
| 20449 | } | ||||
| 20450 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20450); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20450; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20451 | if (!ToJSValue(cx, result, args.rval())) { | ||||
| 20452 | return false; | ||||
| 20453 | } | ||||
| 20454 | return true; | ||||
| 20455 | } | ||||
| 20456 | |||||
| 20457 | static const JSJitInfo readonlyEnumAttribute_getterinfo = { | ||||
| 20458 | { get_readonlyEnumAttribute }, | ||||
| 20459 | { prototypes::id::TestJSImplInterface }, | ||||
| 20460 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20461 | JSJitInfo::Getter, | ||||
| 20462 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20463 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | ||||
| 20464 | false, /* isInfallible. False in setters. */ | ||||
| 20465 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20466 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20467 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20468 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20469 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20470 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20471 | }; | ||||
| 20472 | |||||
| 20473 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20474 | passCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20475 | { | ||||
| 20476 | BindingCallContext cx(cx_, "TestJSImplInterface.passCallback"); | ||||
| 20477 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20480( cx, "TestJSImplInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20478 | "TestJSImplInterface", "passCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20480( cx, "TestJSImplInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20479 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20480( cx, "TestJSImplInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20480 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20480( cx, "TestJSImplInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20481 | |||||
| 20482 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20483 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passCallback", 1)) { | ||||
| 20484 | return false; | ||||
| 20485 | } | ||||
| 20486 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20487 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20488 | if (objIsXray) { | ||||
| 20489 | unwrappedObj.emplace(cx, obj); | ||||
| 20490 | } | ||||
| 20491 | RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx); | ||||
| 20492 | if (args[0].isObject()) { | ||||
| 20493 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20494 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20495 | arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 20496 | } | ||||
| 20497 | } else { | ||||
| 20498 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20499 | return false; | ||||
| 20500 | } | ||||
| 20501 | } else { | ||||
| 20502 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20503 | return false; | ||||
| 20504 | } | ||||
| 20505 | if (objIsXray) { | ||||
| 20506 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20507 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20508 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20509 | if (!unwrappedObj.ref()) { | ||||
| 20510 | return false; | ||||
| 20511 | } | ||||
| 20512 | } | ||||
| 20513 | FastErrorResult rv; | ||||
| 20514 | // NOTE: This assert does NOT call the function. | ||||
| 20515 | 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"); | ||||
| 20516 | MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20517 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback" )), 0))) { | ||||
| 20518 | return false; | ||||
| 20519 | } | ||||
| 20520 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20520); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20520; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20521 | args.rval().setUndefined(); | ||||
| 20522 | return true; | ||||
| 20523 | } | ||||
| 20524 | |||||
| 20525 | static const JSJitInfo passCallback_methodinfo = { | ||||
| 20526 | { (JSJitGetterOp)passCallback }, | ||||
| 20527 | { prototypes::id::TestJSImplInterface }, | ||||
| 20528 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20529 | JSJitInfo::Method, | ||||
| 20530 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20531 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20532 | false, /* isInfallible. False in setters. */ | ||||
| 20533 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20534 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20535 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20536 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20537 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20538 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20539 | }; | ||||
| 20540 | |||||
| 20541 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20542 | passNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20543 | { | ||||
| 20544 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCallback"); | ||||
| 20545 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20548( cx, "TestJSImplInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20546 | "TestJSImplInterface", "passNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20548( cx, "TestJSImplInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20547 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20548( cx, "TestJSImplInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20548 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20548( cx, "TestJSImplInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20549 | |||||
| 20550 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20551 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCallback", 1)) { | ||||
| 20552 | return false; | ||||
| 20553 | } | ||||
| 20554 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20555 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20556 | if (objIsXray) { | ||||
| 20557 | unwrappedObj.emplace(cx, obj); | ||||
| 20558 | } | ||||
| 20559 | RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx); | ||||
| 20560 | if (args[0].isObject()) { | ||||
| 20561 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20562 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20563 | arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 20564 | } | ||||
| 20565 | } else { | ||||
| 20566 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20567 | return false; | ||||
| 20568 | } | ||||
| 20569 | } else if (args[0].isNullOrUndefined()) { | ||||
| 20570 | arg0 = nullptr; | ||||
| 20571 | } else { | ||||
| 20572 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20573 | return false; | ||||
| 20574 | } | ||||
| 20575 | if (objIsXray) { | ||||
| 20576 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20577 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20578 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20579 | if (!unwrappedObj.ref()) { | ||||
| 20580 | return false; | ||||
| 20581 | } | ||||
| 20582 | } | ||||
| 20583 | FastErrorResult rv; | ||||
| 20584 | // NOTE: This assert does NOT call the function. | ||||
| 20585 | 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"); | ||||
| 20586 | MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20587 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback" )), 0))) { | ||||
| 20588 | return false; | ||||
| 20589 | } | ||||
| 20590 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20590); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20590; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20591 | args.rval().setUndefined(); | ||||
| 20592 | return true; | ||||
| 20593 | } | ||||
| 20594 | |||||
| 20595 | static const JSJitInfo passNullableCallback_methodinfo = { | ||||
| 20596 | { (JSJitGetterOp)passNullableCallback }, | ||||
| 20597 | { prototypes::id::TestJSImplInterface }, | ||||
| 20598 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20599 | JSJitInfo::Method, | ||||
| 20600 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20601 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20602 | false, /* isInfallible. False in setters. */ | ||||
| 20603 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20604 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20605 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20606 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20607 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20608 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20609 | }; | ||||
| 20610 | |||||
| 20611 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20612 | passOptionalCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20613 | { | ||||
| 20614 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallback"); | ||||
| 20615 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20618( cx, "TestJSImplInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20616 | "TestJSImplInterface", "passOptionalCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20618( cx, "TestJSImplInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20617 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20618( cx, "TestJSImplInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20618 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20618( cx, "TestJSImplInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20619 | |||||
| 20620 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20621 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20622 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20623 | if (objIsXray) { | ||||
| 20624 | unwrappedObj.emplace(cx, obj); | ||||
| 20625 | } | ||||
| 20626 | Optional<OwningNonNull<MyTestCallback>> arg0; | ||||
| 20627 | if (args.hasDefined(0)) { | ||||
| 20628 | arg0.Construct(); | ||||
| 20629 | if (args[0].isObject()) { | ||||
| 20630 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20631 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20632 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | ||||
| 20633 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 20634 | arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 20635 | } | ||||
| 20636 | } else { | ||||
| 20637 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20638 | return false; | ||||
| 20639 | } | ||||
| 20640 | } else { | ||||
| 20641 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20642 | return false; | ||||
| 20643 | } | ||||
| 20644 | } | ||||
| 20645 | if (objIsXray) { | ||||
| 20646 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20647 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20648 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20649 | if (!unwrappedObj.ref()) { | ||||
| 20650 | return false; | ||||
| 20651 | } | ||||
| 20652 | } | ||||
| 20653 | FastErrorResult rv; | ||||
| 20654 | // NOTE: This assert does NOT call the function. | ||||
| 20655 | 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"); | ||||
| 20656 | MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20657 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback" )), 0))) { | ||||
| 20658 | return false; | ||||
| 20659 | } | ||||
| 20660 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20660); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20660; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20661 | args.rval().setUndefined(); | ||||
| 20662 | return true; | ||||
| 20663 | } | ||||
| 20664 | |||||
| 20665 | static const JSJitInfo passOptionalCallback_methodinfo = { | ||||
| 20666 | { (JSJitGetterOp)passOptionalCallback }, | ||||
| 20667 | { prototypes::id::TestJSImplInterface }, | ||||
| 20668 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20669 | JSJitInfo::Method, | ||||
| 20670 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20671 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20672 | false, /* isInfallible. False in setters. */ | ||||
| 20673 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20674 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20675 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20676 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20677 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20678 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20679 | }; | ||||
| 20680 | |||||
| 20681 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20682 | passOptionalNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20683 | { | ||||
| 20684 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallback"); | ||||
| 20685 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20688( cx, "TestJSImplInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20686 | "TestJSImplInterface", "passOptionalNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20688( cx, "TestJSImplInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20687 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20688( cx, "TestJSImplInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20688 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20688( cx, "TestJSImplInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 20689 | |||||
| 20690 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20691 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20692 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20693 | if (objIsXray) { | ||||
| 20694 | unwrappedObj.emplace(cx, obj); | ||||
| 20695 | } | ||||
| 20696 | Optional<RefPtr<MyTestCallback>> arg0; | ||||
| 20697 | if (args.hasDefined(0)) { | ||||
| 20698 | arg0.Construct(); | ||||
| 20699 | if (args[0].isObject()) { | ||||
| 20700 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20701 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20702 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | ||||
| 20703 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 20704 | arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 20705 | } | ||||
| 20706 | } else { | ||||
| 20707 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20708 | return false; | ||||
| 20709 | } | ||||
| 20710 | } else if (args[0].isNullOrUndefined()) { | ||||
| 20711 | arg0.Value() = nullptr; | ||||
| 20712 | } else { | ||||
| 20713 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20714 | return false; | ||||
| 20715 | } | ||||
| 20716 | } | ||||
| 20717 | if (objIsXray) { | ||||
| 20718 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20719 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20720 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20721 | if (!unwrappedObj.ref()) { | ||||
| 20722 | return false; | ||||
| 20723 | } | ||||
| 20724 | } | ||||
| 20725 | FastErrorResult rv; | ||||
| 20726 | // NOTE: This assert does NOT call the function. | ||||
| 20727 | 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"); | ||||
| 20728 | MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20729 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback" )), 0))) { | ||||
| 20730 | return false; | ||||
| 20731 | } | ||||
| 20732 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20732); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20732; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20733 | args.rval().setUndefined(); | ||||
| 20734 | return true; | ||||
| 20735 | } | ||||
| 20736 | |||||
| 20737 | static const JSJitInfo passOptionalNullableCallback_methodinfo = { | ||||
| 20738 | { (JSJitGetterOp)passOptionalNullableCallback }, | ||||
| 20739 | { prototypes::id::TestJSImplInterface }, | ||||
| 20740 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20741 | JSJitInfo::Method, | ||||
| 20742 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20743 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20744 | false, /* isInfallible. False in setters. */ | ||||
| 20745 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20746 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20747 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20748 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20749 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20750 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20751 | }; | ||||
| 20752 | |||||
| 20753 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20754 | passOptionalNullableCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20755 | { | ||||
| 20756 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"); | ||||
| 20757 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20760( cx, "TestJSImplInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20758 | "TestJSImplInterface", "passOptionalNullableCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20760( cx, "TestJSImplInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20759 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20760( cx, "TestJSImplInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 20760 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20760( cx, "TestJSImplInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 20761 | |||||
| 20762 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20763 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20764 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20765 | if (objIsXray) { | ||||
| 20766 | unwrappedObj.emplace(cx, obj); | ||||
| 20767 | } | ||||
| 20768 | RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx); | ||||
| 20769 | if (args.hasDefined(0)) { | ||||
| 20770 | if (args[0].isObject()) { | ||||
| 20771 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20772 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20773 | arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 20774 | } | ||||
| 20775 | } else { | ||||
| 20776 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20777 | return false; | ||||
| 20778 | } | ||||
| 20779 | } else if (args[0].isNullOrUndefined()) { | ||||
| 20780 | arg0 = nullptr; | ||||
| 20781 | } else { | ||||
| 20782 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20783 | return false; | ||||
| 20784 | } | ||||
| 20785 | } else { | ||||
| 20786 | arg0 = nullptr; | ||||
| 20787 | } | ||||
| 20788 | if (objIsXray) { | ||||
| 20789 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20790 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20791 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20792 | if (!unwrappedObj.ref()) { | ||||
| 20793 | return false; | ||||
| 20794 | } | ||||
| 20795 | } | ||||
| 20796 | FastErrorResult rv; | ||||
| 20797 | // NOTE: This assert does NOT call the function. | ||||
| 20798 | 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"); | ||||
| 20799 | MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20800 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue" )), 0))) { | ||||
| 20801 | return false; | ||||
| 20802 | } | ||||
| 20803 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20803); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20803; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20804 | args.rval().setUndefined(); | ||||
| 20805 | return true; | ||||
| 20806 | } | ||||
| 20807 | |||||
| 20808 | static const JSJitInfo passOptionalNullableCallbackWithDefaultValue_methodinfo = { | ||||
| 20809 | { (JSJitGetterOp)passOptionalNullableCallbackWithDefaultValue }, | ||||
| 20810 | { prototypes::id::TestJSImplInterface }, | ||||
| 20811 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20812 | JSJitInfo::Method, | ||||
| 20813 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20814 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20815 | false, /* isInfallible. False in setters. */ | ||||
| 20816 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20817 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20818 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20819 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20820 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20821 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20822 | }; | ||||
| 20823 | |||||
| 20824 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20825 | receiveCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20826 | { | ||||
| 20827 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20830( cx, "TestJSImplInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20828 | "TestJSImplInterface", "receiveCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20830( cx, "TestJSImplInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20829 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20830( cx, "TestJSImplInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20830 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20830( cx, "TestJSImplInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20831 | |||||
| 20832 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20833 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20834 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20835 | if (objIsXray) { | ||||
| 20836 | unwrappedObj.emplace(cx, obj); | ||||
| 20837 | } | ||||
| 20838 | if (objIsXray) { | ||||
| 20839 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20840 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20841 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20842 | if (!unwrappedObj.ref()) { | ||||
| 20843 | return false; | ||||
| 20844 | } | ||||
| 20845 | } | ||||
| 20846 | FastErrorResult rv; | ||||
| 20847 | RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20848 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback" )), 0))) { | ||||
| 20849 | return false; | ||||
| 20850 | } | ||||
| 20851 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20851); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20851; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20852 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | ||||
| 20853 | if (!MaybeWrapObjectValue(cx, args.rval())) { | ||||
| 20854 | return false; | ||||
| 20855 | } | ||||
| 20856 | return true; | ||||
| 20857 | } | ||||
| 20858 | |||||
| 20859 | static const JSJitInfo receiveCallback_methodinfo = { | ||||
| 20860 | { (JSJitGetterOp)receiveCallback }, | ||||
| 20861 | { prototypes::id::TestJSImplInterface }, | ||||
| 20862 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20863 | JSJitInfo::Method, | ||||
| 20864 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20865 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 20866 | false, /* isInfallible. False in setters. */ | ||||
| 20867 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20868 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20869 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20870 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20871 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20872 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20873 | }; | ||||
| 20874 | |||||
| 20875 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20876 | receiveNullableCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20877 | { | ||||
| 20878 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20881( cx, "TestJSImplInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20879 | "TestJSImplInterface", "receiveNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20881( cx, "TestJSImplInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20880 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20881( cx, "TestJSImplInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 20881 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20881( cx, "TestJSImplInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 20882 | |||||
| 20883 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20884 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20885 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20886 | if (objIsXray) { | ||||
| 20887 | unwrappedObj.emplace(cx, obj); | ||||
| 20888 | } | ||||
| 20889 | if (objIsXray) { | ||||
| 20890 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20891 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20892 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20893 | if (!unwrappedObj.ref()) { | ||||
| 20894 | return false; | ||||
| 20895 | } | ||||
| 20896 | } | ||||
| 20897 | FastErrorResult rv; | ||||
| 20898 | RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveNullableCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 20899 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback" )), 0))) { | ||||
| 20900 | return false; | ||||
| 20901 | } | ||||
| 20902 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20902); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20902; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20903 | if (result) { | ||||
| 20904 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | ||||
| 20905 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | ||||
| 20906 | return false; | ||||
| 20907 | } | ||||
| 20908 | return true; | ||||
| 20909 | } else { | ||||
| 20910 | args.rval().setNull(); | ||||
| 20911 | return true; | ||||
| 20912 | } | ||||
| 20913 | } | ||||
| 20914 | |||||
| 20915 | static const JSJitInfo receiveNullableCallback_methodinfo = { | ||||
| 20916 | { (JSJitGetterOp)receiveNullableCallback }, | ||||
| 20917 | { prototypes::id::TestJSImplInterface }, | ||||
| 20918 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20919 | JSJitInfo::Method, | ||||
| 20920 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20921 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 20922 | false, /* isInfallible. False in setters. */ | ||||
| 20923 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20924 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20925 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20926 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20927 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20928 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 20929 | }; | ||||
| 20930 | |||||
| 20931 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 20932 | passOptionalNullableTreatAsNullCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 20933 | { | ||||
| 20934 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"); | ||||
| 20935 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20938( cx, "TestJSImplInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 20936 | "TestJSImplInterface", "passOptionalNullableTreatAsNullCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20938( cx, "TestJSImplInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 20937 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20938( cx, "TestJSImplInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 20938 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20938( cx, "TestJSImplInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 20939 | |||||
| 20940 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 20941 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 20942 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 20943 | if (objIsXray) { | ||||
| 20944 | unwrappedObj.emplace(cx, obj); | ||||
| 20945 | } | ||||
| 20946 | RootedCallback<RefPtr<binding_detail::FastTestTreatAsNullCallback>> arg0(cx); | ||||
| 20947 | if (args.hasDefined(0)) { | ||||
| 20948 | if (args[0].isObject()) { | ||||
| 20949 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 20950 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 20951 | arg0 = new binding_detail::FastTestTreatAsNullCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 20952 | } | ||||
| 20953 | } else { | ||||
| 20954 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | ||||
| 20955 | return false; | ||||
| 20956 | } | ||||
| 20957 | } else if (args[0].isNullOrUndefined()) { | ||||
| 20958 | arg0 = nullptr; | ||||
| 20959 | } else { | ||||
| 20960 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 20961 | return false; | ||||
| 20962 | } | ||||
| 20963 | } else { | ||||
| 20964 | arg0 = nullptr; | ||||
| 20965 | } | ||||
| 20966 | if (objIsXray) { | ||||
| 20967 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 20968 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 20969 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 20970 | if (!unwrappedObj.ref()) { | ||||
| 20971 | return false; | ||||
| 20972 | } | ||||
| 20973 | } | ||||
| 20974 | FastErrorResult rv; | ||||
| 20975 | // NOTE: This assert does NOT call the function. | ||||
| 20976 | 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"); | ||||
| 20977 | MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 20978 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue" )), 0))) { | ||||
| 20979 | return false; | ||||
| 20980 | } | ||||
| 20981 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 20981); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20981; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 20982 | args.rval().setUndefined(); | ||||
| 20983 | return true; | ||||
| 20984 | } | ||||
| 20985 | |||||
| 20986 | static const JSJitInfo passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo = { | ||||
| 20987 | { (JSJitGetterOp)passOptionalNullableTreatAsNullCallbackWithDefaultValue }, | ||||
| 20988 | { prototypes::id::TestJSImplInterface }, | ||||
| 20989 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 20990 | JSJitInfo::Method, | ||||
| 20991 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 20992 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 20993 | false, /* isInfallible. False in setters. */ | ||||
| 20994 | false, /* isMovable. Not relevant for setters. */ | ||||
| 20995 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 20996 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 20997 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 20998 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 20999 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21000 | }; | ||||
| 21001 | |||||
| 21002 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21003 | passAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21004 | { | ||||
| 21005 | BindingCallContext cx(cx_, "TestJSImplInterface.passAny"); | ||||
| 21006 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21009( cx, "TestJSImplInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 21007 | "TestJSImplInterface", "passAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21009( cx, "TestJSImplInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 21008 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21009( cx, "TestJSImplInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 21009 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21009( cx, "TestJSImplInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 21010 | |||||
| 21011 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21012 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAny", 1)) { | ||||
| 21013 | return false; | ||||
| 21014 | } | ||||
| 21015 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21016 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21017 | if (objIsXray) { | ||||
| 21018 | unwrappedObj.emplace(cx, obj); | ||||
| 21019 | } | ||||
| 21020 | JS::Rooted<JS::Value> arg0(cx); | ||||
| 21021 | #ifdef __clang__1 | ||||
| 21022 | #pragma clang diagnostic push | ||||
| 21023 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21024 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21025 | #endif // __clang__ | ||||
| 21026 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 21027 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 21028 | return false; | ||||
| 21029 | } | ||||
| 21030 | #ifdef __clang__1 | ||||
| 21031 | #pragma clang diagnostic pop | ||||
| 21032 | #endif // __clang__ | ||||
| 21033 | arg0 = args[0]; | ||||
| 21034 | if (objIsXray) { | ||||
| 21035 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21036 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21037 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21038 | if (!unwrappedObj.ref()) { | ||||
| 21039 | return false; | ||||
| 21040 | } | ||||
| 21041 | } | ||||
| 21042 | FastErrorResult rv; | ||||
| 21043 | // NOTE: This assert does NOT call the function. | ||||
| 21044 | 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"); | ||||
| 21045 | MOZ_KnownLive(self)(self)->PassAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21046 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny" )), 0))) { | ||||
| 21047 | return false; | ||||
| 21048 | } | ||||
| 21049 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21049); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21049; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21050 | args.rval().setUndefined(); | ||||
| 21051 | return true; | ||||
| 21052 | } | ||||
| 21053 | |||||
| 21054 | static const JSJitInfo passAny_methodinfo = { | ||||
| 21055 | { (JSJitGetterOp)passAny }, | ||||
| 21056 | { prototypes::id::TestJSImplInterface }, | ||||
| 21057 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21058 | JSJitInfo::Method, | ||||
| 21059 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21060 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21061 | false, /* isInfallible. False in setters. */ | ||||
| 21062 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21063 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21064 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21065 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21066 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21067 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21068 | }; | ||||
| 21069 | |||||
| 21070 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21071 | passVariadicAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21072 | { | ||||
| 21073 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicAny"); | ||||
| 21074 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21077( cx, "TestJSImplInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21075 | "TestJSImplInterface", "passVariadicAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21077( cx, "TestJSImplInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21076 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21077( cx, "TestJSImplInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21077 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21077( cx, "TestJSImplInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 21078 | |||||
| 21079 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21080 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21081 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21082 | if (objIsXray) { | ||||
| 21083 | unwrappedObj.emplace(cx, obj); | ||||
| 21084 | } | ||||
| 21085 | AutoSequence<JS::Value> arg0; | ||||
| 21086 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0); | ||||
| 21087 | if (args.length() > 0) { | ||||
| 21088 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 21089 | JS_ReportOutOfMemory(cx); | ||||
| 21090 | return false; | ||||
| 21091 | } | ||||
| 21092 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 21093 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 21094 | JS::Value& slot = *arg0.AppendElement(); | ||||
| 21095 | #ifdef __clang__1 | ||||
| 21096 | #pragma clang diagnostic push | ||||
| 21097 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21098 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21099 | #endif // __clang__ | ||||
| 21100 | if ((true) && !CallerSubsumes(args[variadicArg])) { | ||||
| 21101 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 21102 | return false; | ||||
| 21103 | } | ||||
| 21104 | #ifdef __clang__1 | ||||
| 21105 | #pragma clang diagnostic pop | ||||
| 21106 | #endif // __clang__ | ||||
| 21107 | slot = args[variadicArg]; | ||||
| 21108 | } | ||||
| 21109 | } | ||||
| 21110 | if (objIsXray) { | ||||
| 21111 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21112 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21113 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21114 | if (!unwrappedObj.ref()) { | ||||
| 21115 | return false; | ||||
| 21116 | } | ||||
| 21117 | } | ||||
| 21118 | FastErrorResult rv; | ||||
| 21119 | // NOTE: This assert does NOT call the function. | ||||
| 21120 | 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"); | ||||
| 21121 | MOZ_KnownLive(self)(self)->PassVariadicAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21122 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny" )), 0))) { | ||||
| 21123 | return false; | ||||
| 21124 | } | ||||
| 21125 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21125); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21125; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21126 | args.rval().setUndefined(); | ||||
| 21127 | return true; | ||||
| 21128 | } | ||||
| 21129 | |||||
| 21130 | static const JSJitInfo passVariadicAny_methodinfo = { | ||||
| 21131 | { (JSJitGetterOp)passVariadicAny }, | ||||
| 21132 | { prototypes::id::TestJSImplInterface }, | ||||
| 21133 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21134 | JSJitInfo::Method, | ||||
| 21135 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21136 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21137 | false, /* isInfallible. False in setters. */ | ||||
| 21138 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21139 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21140 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21141 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21142 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21143 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21144 | }; | ||||
| 21145 | |||||
| 21146 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21147 | passOptionalAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21148 | { | ||||
| 21149 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalAny"); | ||||
| 21150 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21153( cx, "TestJSImplInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21151 | "TestJSImplInterface", "passOptionalAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21153( cx, "TestJSImplInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21152 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21153( cx, "TestJSImplInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21153 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21153( cx, "TestJSImplInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 21154 | |||||
| 21155 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21156 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21157 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21158 | if (objIsXray) { | ||||
| 21159 | unwrappedObj.emplace(cx, obj); | ||||
| 21160 | } | ||||
| 21161 | JS::Rooted<JS::Value> arg0(cx); | ||||
| 21162 | if (args.hasDefined(0)) { | ||||
| 21163 | #ifdef __clang__1 | ||||
| 21164 | #pragma clang diagnostic push | ||||
| 21165 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21166 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21167 | #endif // __clang__ | ||||
| 21168 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 21169 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 21170 | return false; | ||||
| 21171 | } | ||||
| 21172 | #ifdef __clang__1 | ||||
| 21173 | #pragma clang diagnostic pop | ||||
| 21174 | #endif // __clang__ | ||||
| 21175 | arg0 = args[0]; | ||||
| 21176 | } else { | ||||
| 21177 | arg0 = JS::UndefinedValue(); | ||||
| 21178 | } | ||||
| 21179 | if (objIsXray) { | ||||
| 21180 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21181 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21182 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21183 | if (!unwrappedObj.ref()) { | ||||
| 21184 | return false; | ||||
| 21185 | } | ||||
| 21186 | } | ||||
| 21187 | FastErrorResult rv; | ||||
| 21188 | // NOTE: This assert does NOT call the function. | ||||
| 21189 | 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"); | ||||
| 21190 | MOZ_KnownLive(self)(self)->PassOptionalAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21191 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny" )), 0))) { | ||||
| 21192 | return false; | ||||
| 21193 | } | ||||
| 21194 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21194); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21194; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21195 | args.rval().setUndefined(); | ||||
| 21196 | return true; | ||||
| 21197 | } | ||||
| 21198 | |||||
| 21199 | static const JSJitInfo passOptionalAny_methodinfo = { | ||||
| 21200 | { (JSJitGetterOp)passOptionalAny }, | ||||
| 21201 | { prototypes::id::TestJSImplInterface }, | ||||
| 21202 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21203 | JSJitInfo::Method, | ||||
| 21204 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21205 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21206 | false, /* isInfallible. False in setters. */ | ||||
| 21207 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21208 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21209 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21210 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21211 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21212 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21213 | }; | ||||
| 21214 | |||||
| 21215 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21216 | passAnyDefaultNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21217 | { | ||||
| 21218 | BindingCallContext cx(cx_, "TestJSImplInterface.passAnyDefaultNull"); | ||||
| 21219 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestJSImplInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21220 | "TestJSImplInterface", "passAnyDefaultNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestJSImplInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21221 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestJSImplInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21222 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestJSImplInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 21223 | |||||
| 21224 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21225 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21226 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21227 | if (objIsXray) { | ||||
| 21228 | unwrappedObj.emplace(cx, obj); | ||||
| 21229 | } | ||||
| 21230 | JS::Rooted<JS::Value> arg0(cx); | ||||
| 21231 | if (args.hasDefined(0)) { | ||||
| 21232 | #ifdef __clang__1 | ||||
| 21233 | #pragma clang diagnostic push | ||||
| 21234 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21235 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21236 | #endif // __clang__ | ||||
| 21237 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 21238 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 21239 | return false; | ||||
| 21240 | } | ||||
| 21241 | #ifdef __clang__1 | ||||
| 21242 | #pragma clang diagnostic pop | ||||
| 21243 | #endif // __clang__ | ||||
| 21244 | arg0 = args[0]; | ||||
| 21245 | } else { | ||||
| 21246 | arg0 = JS::NullValue(); | ||||
| 21247 | } | ||||
| 21248 | if (objIsXray) { | ||||
| 21249 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21250 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21251 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21252 | if (!unwrappedObj.ref()) { | ||||
| 21253 | return false; | ||||
| 21254 | } | ||||
| 21255 | } | ||||
| 21256 | FastErrorResult rv; | ||||
| 21257 | // NOTE: This assert does NOT call the function. | ||||
| 21258 | 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"); | ||||
| 21259 | MOZ_KnownLive(self)(self)->PassAnyDefaultNull(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21260 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull" )), 0))) { | ||||
| 21261 | return false; | ||||
| 21262 | } | ||||
| 21263 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21263); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21263; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21264 | args.rval().setUndefined(); | ||||
| 21265 | return true; | ||||
| 21266 | } | ||||
| 21267 | |||||
| 21268 | static const JSJitInfo passAnyDefaultNull_methodinfo = { | ||||
| 21269 | { (JSJitGetterOp)passAnyDefaultNull }, | ||||
| 21270 | { prototypes::id::TestJSImplInterface }, | ||||
| 21271 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21272 | JSJitInfo::Method, | ||||
| 21273 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21274 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21275 | false, /* isInfallible. False in setters. */ | ||||
| 21276 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21277 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21278 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21279 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21280 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21281 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21282 | }; | ||||
| 21283 | |||||
| 21284 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21285 | passSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21286 | { | ||||
| 21287 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfAny"); | ||||
| 21288 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21291( cx, "TestJSImplInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21289 | "TestJSImplInterface", "passSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21291( cx, "TestJSImplInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21290 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21291( cx, "TestJSImplInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 21291 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21291( cx, "TestJSImplInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 21292 | |||||
| 21293 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21294 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfAny", 1)) { | ||||
| 21295 | return false; | ||||
| 21296 | } | ||||
| 21297 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21298 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21299 | if (objIsXray) { | ||||
| 21300 | unwrappedObj.emplace(cx, obj); | ||||
| 21301 | } | ||||
| 21302 | binding_detail::AutoSequence<JS::Value> arg0; | ||||
| 21303 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0); | ||||
| 21304 | if (args[0].isObject()) { | ||||
| 21305 | JS::ForOfIterator iter(cx); | ||||
| 21306 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21307 | return false; | ||||
| 21308 | } | ||||
| 21309 | if (!iter.valueIsIterable()) { | ||||
| 21310 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21311 | return false; | ||||
| 21312 | } | ||||
| 21313 | binding_detail::AutoSequence<JS::Value> &arr = arg0; | ||||
| 21314 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21315 | while (true) { | ||||
| 21316 | bool done; | ||||
| 21317 | if (!iter.next(&temp, &done)) { | ||||
| 21318 | return false; | ||||
| 21319 | } | ||||
| 21320 | if (done) { | ||||
| 21321 | break; | ||||
| 21322 | } | ||||
| 21323 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21324 | if (!slotPtr) { | ||||
| 21325 | JS_ReportOutOfMemory(cx); | ||||
| 21326 | return false; | ||||
| 21327 | } | ||||
| 21328 | JS::Value& slot = *slotPtr; | ||||
| 21329 | #ifdef __clang__1 | ||||
| 21330 | #pragma clang diagnostic push | ||||
| 21331 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21332 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21333 | #endif // __clang__ | ||||
| 21334 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 21335 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 21336 | return false; | ||||
| 21337 | } | ||||
| 21338 | #ifdef __clang__1 | ||||
| 21339 | #pragma clang diagnostic pop | ||||
| 21340 | #endif // __clang__ | ||||
| 21341 | slot = temp; | ||||
| 21342 | } | ||||
| 21343 | } else { | ||||
| 21344 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21345 | return false; | ||||
| 21346 | } | ||||
| 21347 | if (objIsXray) { | ||||
| 21348 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21349 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21350 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21351 | if (!unwrappedObj.ref()) { | ||||
| 21352 | return false; | ||||
| 21353 | } | ||||
| 21354 | } | ||||
| 21355 | FastErrorResult rv; | ||||
| 21356 | // NOTE: This assert does NOT call the function. | ||||
| 21357 | 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"); | ||||
| 21358 | MOZ_KnownLive(self)(self)->PassSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21359 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny" )), 0))) { | ||||
| 21360 | return false; | ||||
| 21361 | } | ||||
| 21362 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21362); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21362; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21363 | args.rval().setUndefined(); | ||||
| 21364 | return true; | ||||
| 21365 | } | ||||
| 21366 | |||||
| 21367 | static const JSJitInfo passSequenceOfAny_methodinfo = { | ||||
| 21368 | { (JSJitGetterOp)passSequenceOfAny }, | ||||
| 21369 | { prototypes::id::TestJSImplInterface }, | ||||
| 21370 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21371 | JSJitInfo::Method, | ||||
| 21372 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21373 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21374 | false, /* isInfallible. False in setters. */ | ||||
| 21375 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21376 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21377 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21378 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21379 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21380 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21381 | }; | ||||
| 21382 | |||||
| 21383 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21384 | passNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21385 | { | ||||
| 21386 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfAny"); | ||||
| 21387 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21390( cx, "TestJSImplInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21388 | "TestJSImplInterface", "passNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21390( cx, "TestJSImplInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21389 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21390( cx, "TestJSImplInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21390 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21390( cx, "TestJSImplInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21391 | |||||
| 21392 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21393 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfAny", 1)) { | ||||
| 21394 | return false; | ||||
| 21395 | } | ||||
| 21396 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21397 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21398 | if (objIsXray) { | ||||
| 21399 | unwrappedObj.emplace(cx, obj); | ||||
| 21400 | } | ||||
| 21401 | Nullable<Sequence<JS::Value>> arg0; | ||||
| 21402 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue()); | ||||
| 21403 | if (args[0].isObject()) { | ||||
| 21404 | JS::ForOfIterator iter(cx); | ||||
| 21405 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21406 | return false; | ||||
| 21407 | } | ||||
| 21408 | if (!iter.valueIsIterable()) { | ||||
| 21409 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21410 | return false; | ||||
| 21411 | } | ||||
| 21412 | Sequence<JS::Value> &arr = arg0.SetValue(); | ||||
| 21413 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21414 | while (true) { | ||||
| 21415 | bool done; | ||||
| 21416 | if (!iter.next(&temp, &done)) { | ||||
| 21417 | return false; | ||||
| 21418 | } | ||||
| 21419 | if (done) { | ||||
| 21420 | break; | ||||
| 21421 | } | ||||
| 21422 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21423 | if (!slotPtr) { | ||||
| 21424 | JS_ReportOutOfMemory(cx); | ||||
| 21425 | return false; | ||||
| 21426 | } | ||||
| 21427 | JS::Value& slot = *slotPtr; | ||||
| 21428 | #ifdef __clang__1 | ||||
| 21429 | #pragma clang diagnostic push | ||||
| 21430 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21431 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21432 | #endif // __clang__ | ||||
| 21433 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 21434 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 21435 | return false; | ||||
| 21436 | } | ||||
| 21437 | #ifdef __clang__1 | ||||
| 21438 | #pragma clang diagnostic pop | ||||
| 21439 | #endif // __clang__ | ||||
| 21440 | slot = temp; | ||||
| 21441 | } | ||||
| 21442 | } else if (args[0].isNullOrUndefined()) { | ||||
| 21443 | arg0.SetNull(); | ||||
| 21444 | } else { | ||||
| 21445 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21446 | return false; | ||||
| 21447 | } | ||||
| 21448 | if (objIsXray) { | ||||
| 21449 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21450 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21451 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21452 | if (!unwrappedObj.ref()) { | ||||
| 21453 | return false; | ||||
| 21454 | } | ||||
| 21455 | } | ||||
| 21456 | FastErrorResult rv; | ||||
| 21457 | // NOTE: This assert does NOT call the function. | ||||
| 21458 | 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"); | ||||
| 21459 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21460 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny" )), 0))) { | ||||
| 21461 | return false; | ||||
| 21462 | } | ||||
| 21463 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21463); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21463; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21464 | args.rval().setUndefined(); | ||||
| 21465 | return true; | ||||
| 21466 | } | ||||
| 21467 | |||||
| 21468 | static const JSJitInfo passNullableSequenceOfAny_methodinfo = { | ||||
| 21469 | { (JSJitGetterOp)passNullableSequenceOfAny }, | ||||
| 21470 | { prototypes::id::TestJSImplInterface }, | ||||
| 21471 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21472 | JSJitInfo::Method, | ||||
| 21473 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21474 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21475 | false, /* isInfallible. False in setters. */ | ||||
| 21476 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21477 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21478 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21479 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21480 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21481 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21482 | }; | ||||
| 21483 | |||||
| 21484 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21485 | passOptionalSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21486 | { | ||||
| 21487 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAny"); | ||||
| 21488 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21491( cx, "TestJSImplInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21489 | "TestJSImplInterface", "passOptionalSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21491( cx, "TestJSImplInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21490 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21491( cx, "TestJSImplInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21491 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21491( cx, "TestJSImplInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21492 | |||||
| 21493 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21494 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21495 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21496 | if (objIsXray) { | ||||
| 21497 | unwrappedObj.emplace(cx, obj); | ||||
| 21498 | } | ||||
| 21499 | Optional<Sequence<JS::Value>> arg0; | ||||
| 21500 | Maybe<SequenceRooter<JS::Value>> arg0_holder; | ||||
| 21501 | if (args.hasDefined(0)) { | ||||
| 21502 | arg0.Construct(); | ||||
| 21503 | arg0_holder.emplace(cx, &arg0.Value()); | ||||
| 21504 | if (args[0].isObject()) { | ||||
| 21505 | JS::ForOfIterator iter(cx); | ||||
| 21506 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21507 | return false; | ||||
| 21508 | } | ||||
| 21509 | if (!iter.valueIsIterable()) { | ||||
| 21510 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21511 | return false; | ||||
| 21512 | } | ||||
| 21513 | Sequence<JS::Value> &arr = arg0.Value(); | ||||
| 21514 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21515 | while (true) { | ||||
| 21516 | bool done; | ||||
| 21517 | if (!iter.next(&temp, &done)) { | ||||
| 21518 | return false; | ||||
| 21519 | } | ||||
| 21520 | if (done) { | ||||
| 21521 | break; | ||||
| 21522 | } | ||||
| 21523 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21524 | if (!slotPtr) { | ||||
| 21525 | JS_ReportOutOfMemory(cx); | ||||
| 21526 | return false; | ||||
| 21527 | } | ||||
| 21528 | JS::Value& slot = *slotPtr; | ||||
| 21529 | #ifdef __clang__1 | ||||
| 21530 | #pragma clang diagnostic push | ||||
| 21531 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21532 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21533 | #endif // __clang__ | ||||
| 21534 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 21535 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 21536 | return false; | ||||
| 21537 | } | ||||
| 21538 | #ifdef __clang__1 | ||||
| 21539 | #pragma clang diagnostic pop | ||||
| 21540 | #endif // __clang__ | ||||
| 21541 | slot = temp; | ||||
| 21542 | } | ||||
| 21543 | } else { | ||||
| 21544 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21545 | return false; | ||||
| 21546 | } | ||||
| 21547 | } | ||||
| 21548 | if (objIsXray) { | ||||
| 21549 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21550 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21551 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21552 | if (!unwrappedObj.ref()) { | ||||
| 21553 | return false; | ||||
| 21554 | } | ||||
| 21555 | } | ||||
| 21556 | FastErrorResult rv; | ||||
| 21557 | // NOTE: This assert does NOT call the function. | ||||
| 21558 | 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"); | ||||
| 21559 | MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21560 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny" )), 0))) { | ||||
| 21561 | return false; | ||||
| 21562 | } | ||||
| 21563 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21563); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21563; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21564 | args.rval().setUndefined(); | ||||
| 21565 | return true; | ||||
| 21566 | } | ||||
| 21567 | |||||
| 21568 | static const JSJitInfo passOptionalSequenceOfAny_methodinfo = { | ||||
| 21569 | { (JSJitGetterOp)passOptionalSequenceOfAny }, | ||||
| 21570 | { prototypes::id::TestJSImplInterface }, | ||||
| 21571 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21572 | JSJitInfo::Method, | ||||
| 21573 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21574 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21575 | false, /* isInfallible. False in setters. */ | ||||
| 21576 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21577 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21578 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21579 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21580 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21581 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21582 | }; | ||||
| 21583 | |||||
| 21584 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21585 | passOptionalNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21586 | { | ||||
| 21587 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfAny"); | ||||
| 21588 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21591( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21589 | "TestJSImplInterface", "passOptionalNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21591( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21590 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21591( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21591 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21591( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21592 | |||||
| 21593 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21594 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21595 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21596 | if (objIsXray) { | ||||
| 21597 | unwrappedObj.emplace(cx, obj); | ||||
| 21598 | } | ||||
| 21599 | Optional<Nullable<Sequence<JS::Value>>> arg0; | ||||
| 21600 | Maybe<SequenceRooter<JS::Value>> arg0_holder; | ||||
| 21601 | if (args.hasDefined(0)) { | ||||
| 21602 | arg0.Construct(); | ||||
| 21603 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 21604 | if (args[0].isObject()) { | ||||
| 21605 | JS::ForOfIterator iter(cx); | ||||
| 21606 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21607 | return false; | ||||
| 21608 | } | ||||
| 21609 | if (!iter.valueIsIterable()) { | ||||
| 21610 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21611 | return false; | ||||
| 21612 | } | ||||
| 21613 | Sequence<JS::Value> &arr = arg0.Value().SetValue(); | ||||
| 21614 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21615 | while (true) { | ||||
| 21616 | bool done; | ||||
| 21617 | if (!iter.next(&temp, &done)) { | ||||
| 21618 | return false; | ||||
| 21619 | } | ||||
| 21620 | if (done) { | ||||
| 21621 | break; | ||||
| 21622 | } | ||||
| 21623 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21624 | if (!slotPtr) { | ||||
| 21625 | JS_ReportOutOfMemory(cx); | ||||
| 21626 | return false; | ||||
| 21627 | } | ||||
| 21628 | JS::Value& slot = *slotPtr; | ||||
| 21629 | #ifdef __clang__1 | ||||
| 21630 | #pragma clang diagnostic push | ||||
| 21631 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21632 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21633 | #endif // __clang__ | ||||
| 21634 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 21635 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 21636 | return false; | ||||
| 21637 | } | ||||
| 21638 | #ifdef __clang__1 | ||||
| 21639 | #pragma clang diagnostic pop | ||||
| 21640 | #endif // __clang__ | ||||
| 21641 | slot = temp; | ||||
| 21642 | } | ||||
| 21643 | } else if (args[0].isNullOrUndefined()) { | ||||
| 21644 | arg0.Value().SetNull(); | ||||
| 21645 | } else { | ||||
| 21646 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21647 | return false; | ||||
| 21648 | } | ||||
| 21649 | } | ||||
| 21650 | if (objIsXray) { | ||||
| 21651 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21652 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21653 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21654 | if (!unwrappedObj.ref()) { | ||||
| 21655 | return false; | ||||
| 21656 | } | ||||
| 21657 | } | ||||
| 21658 | FastErrorResult rv; | ||||
| 21659 | // NOTE: This assert does NOT call the function. | ||||
| 21660 | 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"); | ||||
| 21661 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21662 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny" )), 0))) { | ||||
| 21663 | return false; | ||||
| 21664 | } | ||||
| 21665 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21665); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21665; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21666 | args.rval().setUndefined(); | ||||
| 21667 | return true; | ||||
| 21668 | } | ||||
| 21669 | |||||
| 21670 | static const JSJitInfo passOptionalNullableSequenceOfAny_methodinfo = { | ||||
| 21671 | { (JSJitGetterOp)passOptionalNullableSequenceOfAny }, | ||||
| 21672 | { prototypes::id::TestJSImplInterface }, | ||||
| 21673 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21674 | JSJitInfo::Method, | ||||
| 21675 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21676 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21677 | false, /* isInfallible. False in setters. */ | ||||
| 21678 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21679 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21680 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21681 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21682 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21683 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21684 | }; | ||||
| 21685 | |||||
| 21686 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21687 | passOptionalSequenceOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21688 | { | ||||
| 21689 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"); | ||||
| 21690 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21693( cx, "TestJSImplInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21691 | "TestJSImplInterface", "passOptionalSequenceOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21693( cx, "TestJSImplInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21692 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21693( cx, "TestJSImplInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21693 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21693( cx, "TestJSImplInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21694 | |||||
| 21695 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21696 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21697 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21698 | if (objIsXray) { | ||||
| 21699 | unwrappedObj.emplace(cx, obj); | ||||
| 21700 | } | ||||
| 21701 | Nullable<Sequence<JS::Value>> arg0; | ||||
| 21702 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue()); | ||||
| 21703 | if (args.hasDefined(0)) { | ||||
| 21704 | if (args[0].isObject()) { | ||||
| 21705 | JS::ForOfIterator iter(cx); | ||||
| 21706 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21707 | return false; | ||||
| 21708 | } | ||||
| 21709 | if (!iter.valueIsIterable()) { | ||||
| 21710 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21711 | return false; | ||||
| 21712 | } | ||||
| 21713 | Sequence<JS::Value> &arr = arg0.SetValue(); | ||||
| 21714 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21715 | while (true) { | ||||
| 21716 | bool done; | ||||
| 21717 | if (!iter.next(&temp, &done)) { | ||||
| 21718 | return false; | ||||
| 21719 | } | ||||
| 21720 | if (done) { | ||||
| 21721 | break; | ||||
| 21722 | } | ||||
| 21723 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21724 | if (!slotPtr) { | ||||
| 21725 | JS_ReportOutOfMemory(cx); | ||||
| 21726 | return false; | ||||
| 21727 | } | ||||
| 21728 | JS::Value& slot = *slotPtr; | ||||
| 21729 | #ifdef __clang__1 | ||||
| 21730 | #pragma clang diagnostic push | ||||
| 21731 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21732 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21733 | #endif // __clang__ | ||||
| 21734 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 21735 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 21736 | return false; | ||||
| 21737 | } | ||||
| 21738 | #ifdef __clang__1 | ||||
| 21739 | #pragma clang diagnostic pop | ||||
| 21740 | #endif // __clang__ | ||||
| 21741 | slot = temp; | ||||
| 21742 | } | ||||
| 21743 | } else if (args[0].isNullOrUndefined()) { | ||||
| 21744 | arg0.SetNull(); | ||||
| 21745 | } else { | ||||
| 21746 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21747 | return false; | ||||
| 21748 | } | ||||
| 21749 | } else { | ||||
| 21750 | arg0.SetNull(); | ||||
| 21751 | } | ||||
| 21752 | if (objIsXray) { | ||||
| 21753 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21754 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21755 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21756 | if (!unwrappedObj.ref()) { | ||||
| 21757 | return false; | ||||
| 21758 | } | ||||
| 21759 | } | ||||
| 21760 | FastErrorResult rv; | ||||
| 21761 | // NOTE: This assert does NOT call the function. | ||||
| 21762 | 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"); | ||||
| 21763 | MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21764 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue" )), 0))) { | ||||
| 21765 | return false; | ||||
| 21766 | } | ||||
| 21767 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21767); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21767; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21768 | args.rval().setUndefined(); | ||||
| 21769 | return true; | ||||
| 21770 | } | ||||
| 21771 | |||||
| 21772 | static const JSJitInfo passOptionalSequenceOfAnyWithDefaultValue_methodinfo = { | ||||
| 21773 | { (JSJitGetterOp)passOptionalSequenceOfAnyWithDefaultValue }, | ||||
| 21774 | { prototypes::id::TestJSImplInterface }, | ||||
| 21775 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21776 | JSJitInfo::Method, | ||||
| 21777 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21778 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21779 | false, /* isInfallible. False in setters. */ | ||||
| 21780 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21781 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21782 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21783 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21784 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21785 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21786 | }; | ||||
| 21787 | |||||
| 21788 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21789 | passSequenceOfSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21790 | { | ||||
| 21791 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequenceOfAny"); | ||||
| 21792 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21795( cx, "TestJSImplInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21793 | "TestJSImplInterface", "passSequenceOfSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21795( cx, "TestJSImplInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21794 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21795( cx, "TestJSImplInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21795 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21795( cx, "TestJSImplInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21796 | |||||
| 21797 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21798 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny", 1)) { | ||||
| 21799 | return false; | ||||
| 21800 | } | ||||
| 21801 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21802 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21803 | if (objIsXray) { | ||||
| 21804 | unwrappedObj.emplace(cx, obj); | ||||
| 21805 | } | ||||
| 21806 | binding_detail::AutoSequence<Sequence<JS::Value>> arg0; | ||||
| 21807 | SequenceRooter<Sequence<JS::Value>> arg0_holder(cx, &arg0); | ||||
| 21808 | if (args[0].isObject()) { | ||||
| 21809 | JS::ForOfIterator iter(cx); | ||||
| 21810 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21811 | return false; | ||||
| 21812 | } | ||||
| 21813 | if (!iter.valueIsIterable()) { | ||||
| 21814 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21815 | return false; | ||||
| 21816 | } | ||||
| 21817 | binding_detail::AutoSequence<Sequence<JS::Value>> &arr = arg0; | ||||
| 21818 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21819 | while (true) { | ||||
| 21820 | bool done; | ||||
| 21821 | if (!iter.next(&temp, &done)) { | ||||
| 21822 | return false; | ||||
| 21823 | } | ||||
| 21824 | if (done) { | ||||
| 21825 | break; | ||||
| 21826 | } | ||||
| 21827 | Sequence<JS::Value>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21828 | if (!slotPtr) { | ||||
| 21829 | JS_ReportOutOfMemory(cx); | ||||
| 21830 | return false; | ||||
| 21831 | } | ||||
| 21832 | Sequence<JS::Value>& slot = *slotPtr; | ||||
| 21833 | if (temp.isObject()) { | ||||
| 21834 | JS::ForOfIterator iter1(cx); | ||||
| 21835 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21836 | return false; | ||||
| 21837 | } | ||||
| 21838 | if (!iter1.valueIsIterable()) { | ||||
| 21839 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 21840 | return false; | ||||
| 21841 | } | ||||
| 21842 | Sequence<JS::Value> &arr1 = slot; | ||||
| 21843 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 21844 | while (true) { | ||||
| 21845 | bool done1; | ||||
| 21846 | if (!iter1.next(&temp1, &done1)) { | ||||
| 21847 | return false; | ||||
| 21848 | } | ||||
| 21849 | if (done1) { | ||||
| 21850 | break; | ||||
| 21851 | } | ||||
| 21852 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | ||||
| 21853 | if (!slotPtr1) { | ||||
| 21854 | JS_ReportOutOfMemory(cx); | ||||
| 21855 | return false; | ||||
| 21856 | } | ||||
| 21857 | JS::Value& slot1 = *slotPtr1; | ||||
| 21858 | #ifdef __clang__1 | ||||
| 21859 | #pragma clang diagnostic push | ||||
| 21860 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21861 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21862 | #endif // __clang__ | ||||
| 21863 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 21864 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 21865 | return false; | ||||
| 21866 | } | ||||
| 21867 | #ifdef __clang__1 | ||||
| 21868 | #pragma clang diagnostic pop | ||||
| 21869 | #endif // __clang__ | ||||
| 21870 | slot1 = temp1; | ||||
| 21871 | } | ||||
| 21872 | } else { | ||||
| 21873 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 21874 | return false; | ||||
| 21875 | } | ||||
| 21876 | } | ||||
| 21877 | } else { | ||||
| 21878 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21879 | return false; | ||||
| 21880 | } | ||||
| 21881 | if (objIsXray) { | ||||
| 21882 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 21883 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 21884 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 21885 | if (!unwrappedObj.ref()) { | ||||
| 21886 | return false; | ||||
| 21887 | } | ||||
| 21888 | } | ||||
| 21889 | FastErrorResult rv; | ||||
| 21890 | // NOTE: This assert does NOT call the function. | ||||
| 21891 | 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"); | ||||
| 21892 | MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 21893 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny" )), 0))) { | ||||
| 21894 | return false; | ||||
| 21895 | } | ||||
| 21896 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 21896); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21896; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 21897 | args.rval().setUndefined(); | ||||
| 21898 | return true; | ||||
| 21899 | } | ||||
| 21900 | |||||
| 21901 | static const JSJitInfo passSequenceOfSequenceOfAny_methodinfo = { | ||||
| 21902 | { (JSJitGetterOp)passSequenceOfSequenceOfAny }, | ||||
| 21903 | { prototypes::id::TestJSImplInterface }, | ||||
| 21904 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 21905 | JSJitInfo::Method, | ||||
| 21906 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 21907 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 21908 | false, /* isInfallible. False in setters. */ | ||||
| 21909 | false, /* isMovable. Not relevant for setters. */ | ||||
| 21910 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 21911 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 21912 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 21913 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 21914 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 21915 | }; | ||||
| 21916 | |||||
| 21917 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 21918 | passSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 21919 | { | ||||
| 21920 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"); | ||||
| 21921 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21924( cx, "TestJSImplInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21922 | "TestJSImplInterface", "passSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21924( cx, "TestJSImplInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21923 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21924( cx, "TestJSImplInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 21924 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21924( cx, "TestJSImplInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 21925 | |||||
| 21926 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 21927 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", 1)) { | ||||
| 21928 | return false; | ||||
| 21929 | } | ||||
| 21930 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 21931 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 21932 | if (objIsXray) { | ||||
| 21933 | unwrappedObj.emplace(cx, obj); | ||||
| 21934 | } | ||||
| 21935 | binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> arg0; | ||||
| 21936 | SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0); | ||||
| 21937 | if (args[0].isObject()) { | ||||
| 21938 | JS::ForOfIterator iter(cx); | ||||
| 21939 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21940 | return false; | ||||
| 21941 | } | ||||
| 21942 | if (!iter.valueIsIterable()) { | ||||
| 21943 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 21944 | return false; | ||||
| 21945 | } | ||||
| 21946 | binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> &arr = arg0; | ||||
| 21947 | JS::Rooted<JS::Value> temp(cx); | ||||
| 21948 | while (true) { | ||||
| 21949 | bool done; | ||||
| 21950 | if (!iter.next(&temp, &done)) { | ||||
| 21951 | return false; | ||||
| 21952 | } | ||||
| 21953 | if (done) { | ||||
| 21954 | break; | ||||
| 21955 | } | ||||
| 21956 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 21957 | if (!slotPtr) { | ||||
| 21958 | JS_ReportOutOfMemory(cx); | ||||
| 21959 | return false; | ||||
| 21960 | } | ||||
| 21961 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | ||||
| 21962 | if (temp.isObject()) { | ||||
| 21963 | JS::ForOfIterator iter1(cx); | ||||
| 21964 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 21965 | return false; | ||||
| 21966 | } | ||||
| 21967 | if (!iter1.valueIsIterable()) { | ||||
| 21968 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 21969 | return false; | ||||
| 21970 | } | ||||
| 21971 | Sequence<JS::Value> &arr1 = slot.SetValue(); | ||||
| 21972 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 21973 | while (true) { | ||||
| 21974 | bool done1; | ||||
| 21975 | if (!iter1.next(&temp1, &done1)) { | ||||
| 21976 | return false; | ||||
| 21977 | } | ||||
| 21978 | if (done1) { | ||||
| 21979 | break; | ||||
| 21980 | } | ||||
| 21981 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | ||||
| 21982 | if (!slotPtr1) { | ||||
| 21983 | JS_ReportOutOfMemory(cx); | ||||
| 21984 | return false; | ||||
| 21985 | } | ||||
| 21986 | JS::Value& slot1 = *slotPtr1; | ||||
| 21987 | #ifdef __clang__1 | ||||
| 21988 | #pragma clang diagnostic push | ||||
| 21989 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 21990 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 21991 | #endif // __clang__ | ||||
| 21992 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 21993 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 21994 | return false; | ||||
| 21995 | } | ||||
| 21996 | #ifdef __clang__1 | ||||
| 21997 | #pragma clang diagnostic pop | ||||
| 21998 | #endif // __clang__ | ||||
| 21999 | slot1 = temp1; | ||||
| 22000 | } | ||||
| 22001 | } else if (temp.isNullOrUndefined()) { | ||||
| 22002 | slot.SetNull(); | ||||
| 22003 | } else { | ||||
| 22004 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 22005 | return false; | ||||
| 22006 | } | ||||
| 22007 | } | ||||
| 22008 | } else { | ||||
| 22009 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 22010 | return false; | ||||
| 22011 | } | ||||
| 22012 | if (objIsXray) { | ||||
| 22013 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22014 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22015 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22016 | if (!unwrappedObj.ref()) { | ||||
| 22017 | return false; | ||||
| 22018 | } | ||||
| 22019 | } | ||||
| 22020 | FastErrorResult rv; | ||||
| 22021 | // NOTE: This assert does NOT call the function. | ||||
| 22022 | 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"); | ||||
| 22023 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22024 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny" )), 0))) { | ||||
| 22025 | return false; | ||||
| 22026 | } | ||||
| 22027 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22027); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22027; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22028 | args.rval().setUndefined(); | ||||
| 22029 | return true; | ||||
| 22030 | } | ||||
| 22031 | |||||
| 22032 | static const JSJitInfo passSequenceOfNullableSequenceOfAny_methodinfo = { | ||||
| 22033 | { (JSJitGetterOp)passSequenceOfNullableSequenceOfAny }, | ||||
| 22034 | { prototypes::id::TestJSImplInterface }, | ||||
| 22035 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22036 | JSJitInfo::Method, | ||||
| 22037 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22038 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22039 | false, /* isInfallible. False in setters. */ | ||||
| 22040 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22041 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22042 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22043 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22044 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22045 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22046 | }; | ||||
| 22047 | |||||
| 22048 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22049 | passNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22050 | { | ||||
| 22051 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"); | ||||
| 22052 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22055( cx, "TestJSImplInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22053 | "TestJSImplInterface", "passNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22055( cx, "TestJSImplInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22054 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22055( cx, "TestJSImplInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22055 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22055( cx, "TestJSImplInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 22056 | |||||
| 22057 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22058 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", 1)) { | ||||
| 22059 | return false; | ||||
| 22060 | } | ||||
| 22061 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22062 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22063 | if (objIsXray) { | ||||
| 22064 | unwrappedObj.emplace(cx, obj); | ||||
| 22065 | } | ||||
| 22066 | Nullable<Sequence<Nullable<Sequence<JS::Value>>>> arg0; | ||||
| 22067 | SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0.SetValue()); | ||||
| 22068 | if (args[0].isObject()) { | ||||
| 22069 | JS::ForOfIterator iter(cx); | ||||
| 22070 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 22071 | return false; | ||||
| 22072 | } | ||||
| 22073 | if (!iter.valueIsIterable()) { | ||||
| 22074 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 22075 | return false; | ||||
| 22076 | } | ||||
| 22077 | Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.SetValue(); | ||||
| 22078 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22079 | while (true) { | ||||
| 22080 | bool done; | ||||
| 22081 | if (!iter.next(&temp, &done)) { | ||||
| 22082 | return false; | ||||
| 22083 | } | ||||
| 22084 | if (done) { | ||||
| 22085 | break; | ||||
| 22086 | } | ||||
| 22087 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 22088 | if (!slotPtr) { | ||||
| 22089 | JS_ReportOutOfMemory(cx); | ||||
| 22090 | return false; | ||||
| 22091 | } | ||||
| 22092 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | ||||
| 22093 | if (temp.isObject()) { | ||||
| 22094 | JS::ForOfIterator iter1(cx); | ||||
| 22095 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 22096 | return false; | ||||
| 22097 | } | ||||
| 22098 | if (!iter1.valueIsIterable()) { | ||||
| 22099 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 22100 | return false; | ||||
| 22101 | } | ||||
| 22102 | Sequence<JS::Value> &arr1 = slot.SetValue(); | ||||
| 22103 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 22104 | while (true) { | ||||
| 22105 | bool done1; | ||||
| 22106 | if (!iter1.next(&temp1, &done1)) { | ||||
| 22107 | return false; | ||||
| 22108 | } | ||||
| 22109 | if (done1) { | ||||
| 22110 | break; | ||||
| 22111 | } | ||||
| 22112 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | ||||
| 22113 | if (!slotPtr1) { | ||||
| 22114 | JS_ReportOutOfMemory(cx); | ||||
| 22115 | return false; | ||||
| 22116 | } | ||||
| 22117 | JS::Value& slot1 = *slotPtr1; | ||||
| 22118 | #ifdef __clang__1 | ||||
| 22119 | #pragma clang diagnostic push | ||||
| 22120 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22121 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22122 | #endif // __clang__ | ||||
| 22123 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 22124 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 22125 | return false; | ||||
| 22126 | } | ||||
| 22127 | #ifdef __clang__1 | ||||
| 22128 | #pragma clang diagnostic pop | ||||
| 22129 | #endif // __clang__ | ||||
| 22130 | slot1 = temp1; | ||||
| 22131 | } | ||||
| 22132 | } else if (temp.isNullOrUndefined()) { | ||||
| 22133 | slot.SetNull(); | ||||
| 22134 | } else { | ||||
| 22135 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 22136 | return false; | ||||
| 22137 | } | ||||
| 22138 | } | ||||
| 22139 | } else if (args[0].isNullOrUndefined()) { | ||||
| 22140 | arg0.SetNull(); | ||||
| 22141 | } else { | ||||
| 22142 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 22143 | return false; | ||||
| 22144 | } | ||||
| 22145 | if (objIsXray) { | ||||
| 22146 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22147 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22148 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22149 | if (!unwrappedObj.ref()) { | ||||
| 22150 | return false; | ||||
| 22151 | } | ||||
| 22152 | } | ||||
| 22153 | FastErrorResult rv; | ||||
| 22154 | // NOTE: This assert does NOT call the function. | ||||
| 22155 | 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"); | ||||
| 22156 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22157 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny" )), 0))) { | ||||
| 22158 | return false; | ||||
| 22159 | } | ||||
| 22160 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22160); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22160; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22161 | args.rval().setUndefined(); | ||||
| 22162 | return true; | ||||
| 22163 | } | ||||
| 22164 | |||||
| 22165 | static const JSJitInfo passNullableSequenceOfNullableSequenceOfAny_methodinfo = { | ||||
| 22166 | { (JSJitGetterOp)passNullableSequenceOfNullableSequenceOfAny }, | ||||
| 22167 | { prototypes::id::TestJSImplInterface }, | ||||
| 22168 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22169 | JSJitInfo::Method, | ||||
| 22170 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22171 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22172 | false, /* isInfallible. False in setters. */ | ||||
| 22173 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22174 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22175 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22176 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22177 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22178 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22179 | }; | ||||
| 22180 | |||||
| 22181 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22182 | passOptionalNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22183 | { | ||||
| 22184 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"); | ||||
| 22185 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22188( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 22186 | "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22188( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 22187 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22188( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 22188 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22188( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 22189 | |||||
| 22190 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22191 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22192 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22193 | if (objIsXray) { | ||||
| 22194 | unwrappedObj.emplace(cx, obj); | ||||
| 22195 | } | ||||
| 22196 | Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>> arg0; | ||||
| 22197 | Maybe<SequenceRooter<Nullable<Sequence<JS::Value>>>> arg0_holder; | ||||
| 22198 | if (args.hasDefined(0)) { | ||||
| 22199 | arg0.Construct(); | ||||
| 22200 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 22201 | if (args[0].isObject()) { | ||||
| 22202 | JS::ForOfIterator iter(cx); | ||||
| 22203 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 22204 | return false; | ||||
| 22205 | } | ||||
| 22206 | if (!iter.valueIsIterable()) { | ||||
| 22207 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 22208 | return false; | ||||
| 22209 | } | ||||
| 22210 | Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.Value().SetValue(); | ||||
| 22211 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22212 | while (true) { | ||||
| 22213 | bool done; | ||||
| 22214 | if (!iter.next(&temp, &done)) { | ||||
| 22215 | return false; | ||||
| 22216 | } | ||||
| 22217 | if (done) { | ||||
| 22218 | break; | ||||
| 22219 | } | ||||
| 22220 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 22221 | if (!slotPtr) { | ||||
| 22222 | JS_ReportOutOfMemory(cx); | ||||
| 22223 | return false; | ||||
| 22224 | } | ||||
| 22225 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | ||||
| 22226 | if (temp.isObject()) { | ||||
| 22227 | JS::ForOfIterator iter1(cx); | ||||
| 22228 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 22229 | return false; | ||||
| 22230 | } | ||||
| 22231 | if (!iter1.valueIsIterable()) { | ||||
| 22232 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 22233 | return false; | ||||
| 22234 | } | ||||
| 22235 | Sequence<JS::Value> &arr1 = slot.SetValue(); | ||||
| 22236 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 22237 | while (true) { | ||||
| 22238 | bool done1; | ||||
| 22239 | if (!iter1.next(&temp1, &done1)) { | ||||
| 22240 | return false; | ||||
| 22241 | } | ||||
| 22242 | if (done1) { | ||||
| 22243 | break; | ||||
| 22244 | } | ||||
| 22245 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | ||||
| 22246 | if (!slotPtr1) { | ||||
| 22247 | JS_ReportOutOfMemory(cx); | ||||
| 22248 | return false; | ||||
| 22249 | } | ||||
| 22250 | JS::Value& slot1 = *slotPtr1; | ||||
| 22251 | #ifdef __clang__1 | ||||
| 22252 | #pragma clang diagnostic push | ||||
| 22253 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22254 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22255 | #endif // __clang__ | ||||
| 22256 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 22257 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 22258 | return false; | ||||
| 22259 | } | ||||
| 22260 | #ifdef __clang__1 | ||||
| 22261 | #pragma clang diagnostic pop | ||||
| 22262 | #endif // __clang__ | ||||
| 22263 | slot1 = temp1; | ||||
| 22264 | } | ||||
| 22265 | } else if (temp.isNullOrUndefined()) { | ||||
| 22266 | slot.SetNull(); | ||||
| 22267 | } else { | ||||
| 22268 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 22269 | return false; | ||||
| 22270 | } | ||||
| 22271 | } | ||||
| 22272 | } else if (args[0].isNullOrUndefined()) { | ||||
| 22273 | arg0.Value().SetNull(); | ||||
| 22274 | } else { | ||||
| 22275 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 22276 | return false; | ||||
| 22277 | } | ||||
| 22278 | } | ||||
| 22279 | if (objIsXray) { | ||||
| 22280 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22281 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22282 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22283 | if (!unwrappedObj.ref()) { | ||||
| 22284 | return false; | ||||
| 22285 | } | ||||
| 22286 | } | ||||
| 22287 | FastErrorResult rv; | ||||
| 22288 | // NOTE: This assert does NOT call the function. | ||||
| 22289 | 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"); | ||||
| 22290 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22291 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny" )), 0))) { | ||||
| 22292 | return false; | ||||
| 22293 | } | ||||
| 22294 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22294); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22294; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22295 | args.rval().setUndefined(); | ||||
| 22296 | return true; | ||||
| 22297 | } | ||||
| 22298 | |||||
| 22299 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo = { | ||||
| 22300 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfAny }, | ||||
| 22301 | { prototypes::id::TestJSImplInterface }, | ||||
| 22302 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22303 | JSJitInfo::Method, | ||||
| 22304 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22305 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22306 | false, /* isInfallible. False in setters. */ | ||||
| 22307 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22308 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22309 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22310 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22311 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22312 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22313 | }; | ||||
| 22314 | |||||
| 22315 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22316 | passRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22317 | { | ||||
| 22318 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfAny"); | ||||
| 22319 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22322( cx, "TestJSImplInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22320 | "TestJSImplInterface", "passRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22322( cx, "TestJSImplInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22321 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22322( cx, "TestJSImplInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22322 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22322( cx, "TestJSImplInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 22323 | |||||
| 22324 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22325 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfAny", 1)) { | ||||
| 22326 | return false; | ||||
| 22327 | } | ||||
| 22328 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22329 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22330 | if (objIsXray) { | ||||
| 22331 | unwrappedObj.emplace(cx, obj); | ||||
| 22332 | } | ||||
| 22333 | Record<nsString, JS::Value> arg0; | ||||
| 22334 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0); | ||||
| 22335 | if (args[0].isObject()) { | ||||
| 22336 | auto& recordEntries = arg0.Entries(); | ||||
| 22337 | |||||
| 22338 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 22339 | JS::RootedVector<jsid> ids(cx); | ||||
| 22340 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 22341 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 22342 | return false; | ||||
| 22343 | } | ||||
| 22344 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 22345 | JS_ReportOutOfMemory(cx); | ||||
| 22346 | return false; | ||||
| 22347 | } | ||||
| 22348 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 22349 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22350 | JS::Rooted<jsid> curId(cx); | ||||
| 22351 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 22352 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 22353 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 22354 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 22355 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 22356 | // around. | ||||
| 22357 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 22358 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 22359 | curId = ids[i]; | ||||
| 22360 | |||||
| 22361 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 22362 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 22363 | &desc)) { | ||||
| 22364 | return false; | ||||
| 22365 | } | ||||
| 22366 | |||||
| 22367 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 22368 | continue; | ||||
| 22369 | } | ||||
| 22370 | |||||
| 22371 | idVal = js::IdToValue(curId); | ||||
| 22372 | nsString propName; | ||||
| 22373 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 22374 | // to do. | ||||
| 22375 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 22376 | return false; | ||||
| 22377 | } | ||||
| 22378 | |||||
| 22379 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 22380 | return false; | ||||
| 22381 | } | ||||
| 22382 | |||||
| 22383 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 22384 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 22385 | // Find the existing entry. | ||||
| 22386 | auto idx = recordEntries.IndexOf(propName); | ||||
| 22387 | 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", 22388); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22388; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 22388 | "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", 22388); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22388; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 22389 | // Now blow it away to make it look like it was just added | ||||
| 22390 | // to the array, because it's not obvious that it's | ||||
| 22391 | // safe to write to its already-initialized mValue via our | ||||
| 22392 | // normal codegen conversions. For example, the value | ||||
| 22393 | // could be a union and this would change its type, but | ||||
| 22394 | // codegen assumes we won't do that. | ||||
| 22395 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 22396 | } else { | ||||
| 22397 | // Safe to do an infallible append here, because we did a | ||||
| 22398 | // SetCapacity above to the right capacity. | ||||
| 22399 | entry = recordEntries.AppendElement(); | ||||
| 22400 | } | ||||
| 22401 | entry->mKey = propName; | ||||
| 22402 | JS::Value& slot = entry->mValue; | ||||
| 22403 | #ifdef __clang__1 | ||||
| 22404 | #pragma clang diagnostic push | ||||
| 22405 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22406 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22407 | #endif // __clang__ | ||||
| 22408 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 22409 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 22410 | return false; | ||||
| 22411 | } | ||||
| 22412 | #ifdef __clang__1 | ||||
| 22413 | #pragma clang diagnostic pop | ||||
| 22414 | #endif // __clang__ | ||||
| 22415 | slot = temp; | ||||
| 22416 | } | ||||
| 22417 | } else { | ||||
| 22418 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 22419 | return false; | ||||
| 22420 | } | ||||
| 22421 | if (objIsXray) { | ||||
| 22422 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22423 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22424 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22425 | if (!unwrappedObj.ref()) { | ||||
| 22426 | return false; | ||||
| 22427 | } | ||||
| 22428 | } | ||||
| 22429 | FastErrorResult rv; | ||||
| 22430 | // NOTE: This assert does NOT call the function. | ||||
| 22431 | 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"); | ||||
| 22432 | MOZ_KnownLive(self)(self)->PassRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22433 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny" )), 0))) { | ||||
| 22434 | return false; | ||||
| 22435 | } | ||||
| 22436 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22436); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22436; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22437 | args.rval().setUndefined(); | ||||
| 22438 | return true; | ||||
| 22439 | } | ||||
| 22440 | |||||
| 22441 | static const JSJitInfo passRecordOfAny_methodinfo = { | ||||
| 22442 | { (JSJitGetterOp)passRecordOfAny }, | ||||
| 22443 | { prototypes::id::TestJSImplInterface }, | ||||
| 22444 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22445 | JSJitInfo::Method, | ||||
| 22446 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22447 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22448 | false, /* isInfallible. False in setters. */ | ||||
| 22449 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22450 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22451 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22452 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22453 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22454 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22455 | }; | ||||
| 22456 | |||||
| 22457 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22458 | passNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22459 | { | ||||
| 22460 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfAny"); | ||||
| 22461 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22464( cx, "TestJSImplInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22462 | "TestJSImplInterface", "passNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22464( cx, "TestJSImplInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22463 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22464( cx, "TestJSImplInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22464 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22464( cx, "TestJSImplInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 22465 | |||||
| 22466 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22467 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfAny", 1)) { | ||||
| 22468 | return false; | ||||
| 22469 | } | ||||
| 22470 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22471 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22472 | if (objIsXray) { | ||||
| 22473 | unwrappedObj.emplace(cx, obj); | ||||
| 22474 | } | ||||
| 22475 | Nullable<Record<nsString, JS::Value>> arg0; | ||||
| 22476 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue()); | ||||
| 22477 | if (args[0].isObject()) { | ||||
| 22478 | auto& recordEntries = arg0.SetValue().Entries(); | ||||
| 22479 | |||||
| 22480 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 22481 | JS::RootedVector<jsid> ids(cx); | ||||
| 22482 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 22483 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 22484 | return false; | ||||
| 22485 | } | ||||
| 22486 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 22487 | JS_ReportOutOfMemory(cx); | ||||
| 22488 | return false; | ||||
| 22489 | } | ||||
| 22490 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 22491 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22492 | JS::Rooted<jsid> curId(cx); | ||||
| 22493 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 22494 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 22495 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 22496 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 22497 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 22498 | // around. | ||||
| 22499 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 22500 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 22501 | curId = ids[i]; | ||||
| 22502 | |||||
| 22503 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 22504 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 22505 | &desc)) { | ||||
| 22506 | return false; | ||||
| 22507 | } | ||||
| 22508 | |||||
| 22509 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 22510 | continue; | ||||
| 22511 | } | ||||
| 22512 | |||||
| 22513 | idVal = js::IdToValue(curId); | ||||
| 22514 | nsString propName; | ||||
| 22515 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 22516 | // to do. | ||||
| 22517 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 22518 | return false; | ||||
| 22519 | } | ||||
| 22520 | |||||
| 22521 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 22522 | return false; | ||||
| 22523 | } | ||||
| 22524 | |||||
| 22525 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 22526 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 22527 | // Find the existing entry. | ||||
| 22528 | auto idx = recordEntries.IndexOf(propName); | ||||
| 22529 | 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", 22530); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22530; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 22530 | "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", 22530); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22530; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 22531 | // Now blow it away to make it look like it was just added | ||||
| 22532 | // to the array, because it's not obvious that it's | ||||
| 22533 | // safe to write to its already-initialized mValue via our | ||||
| 22534 | // normal codegen conversions. For example, the value | ||||
| 22535 | // could be a union and this would change its type, but | ||||
| 22536 | // codegen assumes we won't do that. | ||||
| 22537 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 22538 | } else { | ||||
| 22539 | // Safe to do an infallible append here, because we did a | ||||
| 22540 | // SetCapacity above to the right capacity. | ||||
| 22541 | entry = recordEntries.AppendElement(); | ||||
| 22542 | } | ||||
| 22543 | entry->mKey = propName; | ||||
| 22544 | JS::Value& slot = entry->mValue; | ||||
| 22545 | #ifdef __clang__1 | ||||
| 22546 | #pragma clang diagnostic push | ||||
| 22547 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22548 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22549 | #endif // __clang__ | ||||
| 22550 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 22551 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 22552 | return false; | ||||
| 22553 | } | ||||
| 22554 | #ifdef __clang__1 | ||||
| 22555 | #pragma clang diagnostic pop | ||||
| 22556 | #endif // __clang__ | ||||
| 22557 | slot = temp; | ||||
| 22558 | } | ||||
| 22559 | } else if (args[0].isNullOrUndefined()) { | ||||
| 22560 | arg0.SetNull(); | ||||
| 22561 | } else { | ||||
| 22562 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 22563 | return false; | ||||
| 22564 | } | ||||
| 22565 | if (objIsXray) { | ||||
| 22566 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22567 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22568 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22569 | if (!unwrappedObj.ref()) { | ||||
| 22570 | return false; | ||||
| 22571 | } | ||||
| 22572 | } | ||||
| 22573 | FastErrorResult rv; | ||||
| 22574 | // NOTE: This assert does NOT call the function. | ||||
| 22575 | 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"); | ||||
| 22576 | MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22577 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny" )), 0))) { | ||||
| 22578 | return false; | ||||
| 22579 | } | ||||
| 22580 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22580; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22581 | args.rval().setUndefined(); | ||||
| 22582 | return true; | ||||
| 22583 | } | ||||
| 22584 | |||||
| 22585 | static const JSJitInfo passNullableRecordOfAny_methodinfo = { | ||||
| 22586 | { (JSJitGetterOp)passNullableRecordOfAny }, | ||||
| 22587 | { prototypes::id::TestJSImplInterface }, | ||||
| 22588 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22589 | JSJitInfo::Method, | ||||
| 22590 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22591 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22592 | false, /* isInfallible. False in setters. */ | ||||
| 22593 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22594 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22595 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22596 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22597 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22598 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22599 | }; | ||||
| 22600 | |||||
| 22601 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22602 | passOptionalRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22603 | { | ||||
| 22604 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAny"); | ||||
| 22605 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22608( cx, "TestJSImplInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22606 | "TestJSImplInterface", "passOptionalRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22608( cx, "TestJSImplInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22607 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22608( cx, "TestJSImplInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 22608 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22608( cx, "TestJSImplInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 22609 | |||||
| 22610 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22611 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22612 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22613 | if (objIsXray) { | ||||
| 22614 | unwrappedObj.emplace(cx, obj); | ||||
| 22615 | } | ||||
| 22616 | Optional<Record<nsString, JS::Value>> arg0; | ||||
| 22617 | Maybe<RecordRooter<nsString, JS::Value>> arg0_holder; | ||||
| 22618 | if (args.hasDefined(0)) { | ||||
| 22619 | arg0.Construct(); | ||||
| 22620 | arg0_holder.emplace(cx, &arg0.Value()); | ||||
| 22621 | if (args[0].isObject()) { | ||||
| 22622 | auto& recordEntries = arg0.Value().Entries(); | ||||
| 22623 | |||||
| 22624 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 22625 | JS::RootedVector<jsid> ids(cx); | ||||
| 22626 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 22627 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 22628 | return false; | ||||
| 22629 | } | ||||
| 22630 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 22631 | JS_ReportOutOfMemory(cx); | ||||
| 22632 | return false; | ||||
| 22633 | } | ||||
| 22634 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 22635 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22636 | JS::Rooted<jsid> curId(cx); | ||||
| 22637 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 22638 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 22639 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 22640 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 22641 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 22642 | // around. | ||||
| 22643 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 22644 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 22645 | curId = ids[i]; | ||||
| 22646 | |||||
| 22647 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 22648 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 22649 | &desc)) { | ||||
| 22650 | return false; | ||||
| 22651 | } | ||||
| 22652 | |||||
| 22653 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 22654 | continue; | ||||
| 22655 | } | ||||
| 22656 | |||||
| 22657 | idVal = js::IdToValue(curId); | ||||
| 22658 | nsString propName; | ||||
| 22659 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 22660 | // to do. | ||||
| 22661 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 22662 | return false; | ||||
| 22663 | } | ||||
| 22664 | |||||
| 22665 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 22666 | return false; | ||||
| 22667 | } | ||||
| 22668 | |||||
| 22669 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 22670 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 22671 | // Find the existing entry. | ||||
| 22672 | auto idx = recordEntries.IndexOf(propName); | ||||
| 22673 | 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", 22674); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22674; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 22674 | "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", 22674); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22674; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 22675 | // Now blow it away to make it look like it was just added | ||||
| 22676 | // to the array, because it's not obvious that it's | ||||
| 22677 | // safe to write to its already-initialized mValue via our | ||||
| 22678 | // normal codegen conversions. For example, the value | ||||
| 22679 | // could be a union and this would change its type, but | ||||
| 22680 | // codegen assumes we won't do that. | ||||
| 22681 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 22682 | } else { | ||||
| 22683 | // Safe to do an infallible append here, because we did a | ||||
| 22684 | // SetCapacity above to the right capacity. | ||||
| 22685 | entry = recordEntries.AppendElement(); | ||||
| 22686 | } | ||||
| 22687 | entry->mKey = propName; | ||||
| 22688 | JS::Value& slot = entry->mValue; | ||||
| 22689 | #ifdef __clang__1 | ||||
| 22690 | #pragma clang diagnostic push | ||||
| 22691 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22692 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22693 | #endif // __clang__ | ||||
| 22694 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 22695 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 22696 | return false; | ||||
| 22697 | } | ||||
| 22698 | #ifdef __clang__1 | ||||
| 22699 | #pragma clang diagnostic pop | ||||
| 22700 | #endif // __clang__ | ||||
| 22701 | slot = temp; | ||||
| 22702 | } | ||||
| 22703 | } else { | ||||
| 22704 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 22705 | return false; | ||||
| 22706 | } | ||||
| 22707 | } | ||||
| 22708 | if (objIsXray) { | ||||
| 22709 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22710 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22711 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22712 | if (!unwrappedObj.ref()) { | ||||
| 22713 | return false; | ||||
| 22714 | } | ||||
| 22715 | } | ||||
| 22716 | FastErrorResult rv; | ||||
| 22717 | // NOTE: This assert does NOT call the function. | ||||
| 22718 | 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"); | ||||
| 22719 | MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22720 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny" )), 0))) { | ||||
| 22721 | return false; | ||||
| 22722 | } | ||||
| 22723 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22723); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22723; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22724 | args.rval().setUndefined(); | ||||
| 22725 | return true; | ||||
| 22726 | } | ||||
| 22727 | |||||
| 22728 | static const JSJitInfo passOptionalRecordOfAny_methodinfo = { | ||||
| 22729 | { (JSJitGetterOp)passOptionalRecordOfAny }, | ||||
| 22730 | { prototypes::id::TestJSImplInterface }, | ||||
| 22731 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22732 | JSJitInfo::Method, | ||||
| 22733 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22734 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22735 | false, /* isInfallible. False in setters. */ | ||||
| 22736 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22737 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22738 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22739 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22740 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22741 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22742 | }; | ||||
| 22743 | |||||
| 22744 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22745 | passOptionalNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22746 | { | ||||
| 22747 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfAny"); | ||||
| 22748 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22751( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22749 | "TestJSImplInterface", "passOptionalNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22751( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22750 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22751( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22751 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22751( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 22752 | |||||
| 22753 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22754 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22755 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22756 | if (objIsXray) { | ||||
| 22757 | unwrappedObj.emplace(cx, obj); | ||||
| 22758 | } | ||||
| 22759 | Optional<Nullable<Record<nsString, JS::Value>>> arg0; | ||||
| 22760 | Maybe<RecordRooter<nsString, JS::Value>> arg0_holder; | ||||
| 22761 | if (args.hasDefined(0)) { | ||||
| 22762 | arg0.Construct(); | ||||
| 22763 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 22764 | if (args[0].isObject()) { | ||||
| 22765 | auto& recordEntries = arg0.Value().SetValue().Entries(); | ||||
| 22766 | |||||
| 22767 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 22768 | JS::RootedVector<jsid> ids(cx); | ||||
| 22769 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 22770 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 22771 | return false; | ||||
| 22772 | } | ||||
| 22773 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 22774 | JS_ReportOutOfMemory(cx); | ||||
| 22775 | return false; | ||||
| 22776 | } | ||||
| 22777 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 22778 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22779 | JS::Rooted<jsid> curId(cx); | ||||
| 22780 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 22781 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 22782 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 22783 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 22784 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 22785 | // around. | ||||
| 22786 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 22787 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 22788 | curId = ids[i]; | ||||
| 22789 | |||||
| 22790 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 22791 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 22792 | &desc)) { | ||||
| 22793 | return false; | ||||
| 22794 | } | ||||
| 22795 | |||||
| 22796 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 22797 | continue; | ||||
| 22798 | } | ||||
| 22799 | |||||
| 22800 | idVal = js::IdToValue(curId); | ||||
| 22801 | nsString propName; | ||||
| 22802 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 22803 | // to do. | ||||
| 22804 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 22805 | return false; | ||||
| 22806 | } | ||||
| 22807 | |||||
| 22808 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 22809 | return false; | ||||
| 22810 | } | ||||
| 22811 | |||||
| 22812 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 22813 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 22814 | // Find the existing entry. | ||||
| 22815 | auto idx = recordEntries.IndexOf(propName); | ||||
| 22816 | 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", 22817); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22817; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 22817 | "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", 22817); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22817; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 22818 | // Now blow it away to make it look like it was just added | ||||
| 22819 | // to the array, because it's not obvious that it's | ||||
| 22820 | // safe to write to its already-initialized mValue via our | ||||
| 22821 | // normal codegen conversions. For example, the value | ||||
| 22822 | // could be a union and this would change its type, but | ||||
| 22823 | // codegen assumes we won't do that. | ||||
| 22824 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 22825 | } else { | ||||
| 22826 | // Safe to do an infallible append here, because we did a | ||||
| 22827 | // SetCapacity above to the right capacity. | ||||
| 22828 | entry = recordEntries.AppendElement(); | ||||
| 22829 | } | ||||
| 22830 | entry->mKey = propName; | ||||
| 22831 | JS::Value& slot = entry->mValue; | ||||
| 22832 | #ifdef __clang__1 | ||||
| 22833 | #pragma clang diagnostic push | ||||
| 22834 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22835 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22836 | #endif // __clang__ | ||||
| 22837 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 22838 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 22839 | return false; | ||||
| 22840 | } | ||||
| 22841 | #ifdef __clang__1 | ||||
| 22842 | #pragma clang diagnostic pop | ||||
| 22843 | #endif // __clang__ | ||||
| 22844 | slot = temp; | ||||
| 22845 | } | ||||
| 22846 | } else if (args[0].isNullOrUndefined()) { | ||||
| 22847 | arg0.Value().SetNull(); | ||||
| 22848 | } else { | ||||
| 22849 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 22850 | return false; | ||||
| 22851 | } | ||||
| 22852 | } | ||||
| 22853 | if (objIsXray) { | ||||
| 22854 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 22855 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 22856 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 22857 | if (!unwrappedObj.ref()) { | ||||
| 22858 | return false; | ||||
| 22859 | } | ||||
| 22860 | } | ||||
| 22861 | FastErrorResult rv; | ||||
| 22862 | // NOTE: This assert does NOT call the function. | ||||
| 22863 | 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"); | ||||
| 22864 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 22865 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny" )), 0))) { | ||||
| 22866 | return false; | ||||
| 22867 | } | ||||
| 22868 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 22868); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22868; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 22869 | args.rval().setUndefined(); | ||||
| 22870 | return true; | ||||
| 22871 | } | ||||
| 22872 | |||||
| 22873 | static const JSJitInfo passOptionalNullableRecordOfAny_methodinfo = { | ||||
| 22874 | { (JSJitGetterOp)passOptionalNullableRecordOfAny }, | ||||
| 22875 | { prototypes::id::TestJSImplInterface }, | ||||
| 22876 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 22877 | JSJitInfo::Method, | ||||
| 22878 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 22879 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 22880 | false, /* isInfallible. False in setters. */ | ||||
| 22881 | false, /* isMovable. Not relevant for setters. */ | ||||
| 22882 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 22883 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 22884 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 22885 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 22886 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 22887 | }; | ||||
| 22888 | |||||
| 22889 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 22890 | passOptionalRecordOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 22891 | { | ||||
| 22892 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"); | ||||
| 22893 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22896( cx, "TestJSImplInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22894 | "TestJSImplInterface", "passOptionalRecordOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22896( cx, "TestJSImplInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22895 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22896( cx, "TestJSImplInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 22896 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22896( cx, "TestJSImplInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 22897 | |||||
| 22898 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 22899 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 22900 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 22901 | if (objIsXray) { | ||||
| 22902 | unwrappedObj.emplace(cx, obj); | ||||
| 22903 | } | ||||
| 22904 | Nullable<Record<nsString, JS::Value>> arg0; | ||||
| 22905 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue()); | ||||
| 22906 | if (args.hasDefined(0)) { | ||||
| 22907 | if (args[0].isObject()) { | ||||
| 22908 | auto& recordEntries = arg0.SetValue().Entries(); | ||||
| 22909 | |||||
| 22910 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 22911 | JS::RootedVector<jsid> ids(cx); | ||||
| 22912 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 22913 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 22914 | return false; | ||||
| 22915 | } | ||||
| 22916 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 22917 | JS_ReportOutOfMemory(cx); | ||||
| 22918 | return false; | ||||
| 22919 | } | ||||
| 22920 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 22921 | JS::Rooted<JS::Value> temp(cx); | ||||
| 22922 | JS::Rooted<jsid> curId(cx); | ||||
| 22923 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 22924 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 22925 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 22926 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 22927 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 22928 | // around. | ||||
| 22929 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 22930 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 22931 | curId = ids[i]; | ||||
| 22932 | |||||
| 22933 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 22934 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 22935 | &desc)) { | ||||
| 22936 | return false; | ||||
| 22937 | } | ||||
| 22938 | |||||
| 22939 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 22940 | continue; | ||||
| 22941 | } | ||||
| 22942 | |||||
| 22943 | idVal = js::IdToValue(curId); | ||||
| 22944 | nsString propName; | ||||
| 22945 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 22946 | // to do. | ||||
| 22947 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 22948 | return false; | ||||
| 22949 | } | ||||
| 22950 | |||||
| 22951 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 22952 | return false; | ||||
| 22953 | } | ||||
| 22954 | |||||
| 22955 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 22956 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 22957 | // Find the existing entry. | ||||
| 22958 | auto idx = recordEntries.IndexOf(propName); | ||||
| 22959 | 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", 22960); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22960; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 22960 | "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", 22960); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 22960; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 22961 | // Now blow it away to make it look like it was just added | ||||
| 22962 | // to the array, because it's not obvious that it's | ||||
| 22963 | // safe to write to its already-initialized mValue via our | ||||
| 22964 | // normal codegen conversions. For example, the value | ||||
| 22965 | // could be a union and this would change its type, but | ||||
| 22966 | // codegen assumes we won't do that. | ||||
| 22967 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 22968 | } else { | ||||
| 22969 | // Safe to do an infallible append here, because we did a | ||||
| 22970 | // SetCapacity above to the right capacity. | ||||
| 22971 | entry = recordEntries.AppendElement(); | ||||
| 22972 | } | ||||
| 22973 | entry->mKey = propName; | ||||
| 22974 | JS::Value& slot = entry->mValue; | ||||
| 22975 | #ifdef __clang__1 | ||||
| 22976 | #pragma clang diagnostic push | ||||
| 22977 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 22978 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 22979 | #endif // __clang__ | ||||
| 22980 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 22981 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 22982 | return false; | ||||
| 22983 | } | ||||
| 22984 | #ifdef __clang__1 | ||||
| 22985 | #pragma clang diagnostic pop | ||||
| 22986 | #endif // __clang__ | ||||
| 22987 | slot = temp; | ||||
| 22988 | } | ||||
| 22989 | } else if (args[0].isNullOrUndefined()) { | ||||
| 22990 | arg0.SetNull(); | ||||
| 22991 | } else { | ||||
| 22992 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 22993 | return false; | ||||
| 22994 | } | ||||
| 22995 | } else { | ||||
| 22996 | arg0.SetNull(); | ||||
| 22997 | } | ||||
| 22998 | if (objIsXray) { | ||||
| 22999 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 23000 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 23001 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 23002 | if (!unwrappedObj.ref()) { | ||||
| 23003 | return false; | ||||
| 23004 | } | ||||
| 23005 | } | ||||
| 23006 | FastErrorResult rv; | ||||
| 23007 | // NOTE: This assert does NOT call the function. | ||||
| 23008 | 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"); | ||||
| 23009 | MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 23010 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue" )), 0))) { | ||||
| 23011 | return false; | ||||
| 23012 | } | ||||
| 23013 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 23013); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23013; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 23014 | args.rval().setUndefined(); | ||||
| 23015 | return true; | ||||
| 23016 | } | ||||
| 23017 | |||||
| 23018 | static const JSJitInfo passOptionalRecordOfAnyWithDefaultValue_methodinfo = { | ||||
| 23019 | { (JSJitGetterOp)passOptionalRecordOfAnyWithDefaultValue }, | ||||
| 23020 | { prototypes::id::TestJSImplInterface }, | ||||
| 23021 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 23022 | JSJitInfo::Method, | ||||
| 23023 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 23024 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 23025 | false, /* isInfallible. False in setters. */ | ||||
| 23026 | false, /* isMovable. Not relevant for setters. */ | ||||
| 23027 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 23028 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 23029 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 23030 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 23031 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 23032 | }; | ||||
| 23033 | |||||
| 23034 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 23035 | passRecordOfRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 23036 | { | ||||
| 23037 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfRecordOfAny"); | ||||
| 23038 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23041( cx, "TestJSImplInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 23039 | "TestJSImplInterface", "passRecordOfRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23041( cx, "TestJSImplInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 23040 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23041( cx, "TestJSImplInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 23041 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23041( cx, "TestJSImplInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 23042 | |||||
| 23043 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 23044 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfRecordOfAny", 1)) { | ||||
| 23045 | return false; | ||||
| 23046 | } | ||||
| 23047 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 23048 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 23049 | if (objIsXray) { | ||||
| 23050 | unwrappedObj.emplace(cx, obj); | ||||
| 23051 | } | ||||
| 23052 | Record<nsString, Record<nsString, JS::Value>> arg0; | ||||
| 23053 | RecordRooter<nsString, Record<nsString, JS::Value>> arg0_holder(cx, &arg0); | ||||
| 23054 | if (args[0].isObject()) { | ||||
| 23055 | auto& recordEntries = arg0.Entries(); | ||||
| 23056 | |||||
| 23057 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 23058 | JS::RootedVector<jsid> ids(cx); | ||||
| 23059 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23060 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23061 | return false; | ||||
| 23062 | } | ||||
| 23063 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23064 | JS_ReportOutOfMemory(cx); | ||||
| 23065 | return false; | ||||
| 23066 | } | ||||
| 23067 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23068 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23069 | JS::Rooted<jsid> curId(cx); | ||||
| 23070 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23071 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23072 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23073 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23074 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23075 | // around. | ||||
| 23076 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23077 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23078 | curId = ids[i]; | ||||
| 23079 | |||||
| 23080 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23081 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23082 | &desc)) { | ||||
| 23083 | return false; | ||||
| 23084 | } | ||||
| 23085 | |||||
| 23086 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23087 | continue; | ||||
| 23088 | } | ||||
| 23089 | |||||
| 23090 | idVal = js::IdToValue(curId); | ||||
| 23091 | nsString propName; | ||||
| 23092 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23093 | // to do. | ||||
| 23094 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 23095 | return false; | ||||
| 23096 | } | ||||
| 23097 | |||||
| 23098 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23099 | return false; | ||||
| 23100 | } | ||||
| 23101 | |||||
| 23102 | Record<nsString, Record<nsString, JS::Value>>::EntryType* entry; | ||||
| 23103 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23104 | // Find the existing entry. | ||||
| 23105 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23106 | 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", 23107); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23107; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23107 | "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", 23107); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23107; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23108 | // Now blow it away to make it look like it was just added | ||||
| 23109 | // to the array, because it's not obvious that it's | ||||
| 23110 | // safe to write to its already-initialized mValue via our | ||||
| 23111 | // normal codegen conversions. For example, the value | ||||
| 23112 | // could be a union and this would change its type, but | ||||
| 23113 | // codegen assumes we won't do that. | ||||
| 23114 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23115 | } else { | ||||
| 23116 | // Safe to do an infallible append here, because we did a | ||||
| 23117 | // SetCapacity above to the right capacity. | ||||
| 23118 | entry = recordEntries.AppendElement(); | ||||
| 23119 | } | ||||
| 23120 | entry->mKey = propName; | ||||
| 23121 | Record<nsString, JS::Value>& slot = entry->mValue; | ||||
| 23122 | if (temp.isObject()) { | ||||
| 23123 | auto& recordEntries = slot.Entries(); | ||||
| 23124 | |||||
| 23125 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | ||||
| 23126 | JS::RootedVector<jsid> ids(cx); | ||||
| 23127 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23128 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23129 | return false; | ||||
| 23130 | } | ||||
| 23131 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23132 | JS_ReportOutOfMemory(cx); | ||||
| 23133 | return false; | ||||
| 23134 | } | ||||
| 23135 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23136 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23137 | JS::Rooted<jsid> curId(cx); | ||||
| 23138 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23139 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23140 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23141 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23142 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23143 | // around. | ||||
| 23144 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23145 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23146 | curId = ids[i]; | ||||
| 23147 | |||||
| 23148 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23149 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23150 | &desc)) { | ||||
| 23151 | return false; | ||||
| 23152 | } | ||||
| 23153 | |||||
| 23154 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23155 | continue; | ||||
| 23156 | } | ||||
| 23157 | |||||
| 23158 | idVal = js::IdToValue(curId); | ||||
| 23159 | nsString propName; | ||||
| 23160 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23161 | // to do. | ||||
| 23162 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | ||||
| 23163 | return false; | ||||
| 23164 | } | ||||
| 23165 | |||||
| 23166 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23167 | return false; | ||||
| 23168 | } | ||||
| 23169 | |||||
| 23170 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 23171 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23172 | // Find the existing entry. | ||||
| 23173 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23174 | 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", 23175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23175; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23175 | "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", 23175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23175; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23176 | // Now blow it away to make it look like it was just added | ||||
| 23177 | // to the array, because it's not obvious that it's | ||||
| 23178 | // safe to write to its already-initialized mValue via our | ||||
| 23179 | // normal codegen conversions. For example, the value | ||||
| 23180 | // could be a union and this would change its type, but | ||||
| 23181 | // codegen assumes we won't do that. | ||||
| 23182 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23183 | } else { | ||||
| 23184 | // Safe to do an infallible append here, because we did a | ||||
| 23185 | // SetCapacity above to the right capacity. | ||||
| 23186 | entry = recordEntries.AppendElement(); | ||||
| 23187 | } | ||||
| 23188 | entry->mKey = propName; | ||||
| 23189 | JS::Value& slot = entry->mValue; | ||||
| 23190 | #ifdef __clang__1 | ||||
| 23191 | #pragma clang diagnostic push | ||||
| 23192 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 23193 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 23194 | #endif // __clang__ | ||||
| 23195 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 23196 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1"); | ||||
| 23197 | return false; | ||||
| 23198 | } | ||||
| 23199 | #ifdef __clang__1 | ||||
| 23200 | #pragma clang diagnostic pop | ||||
| 23201 | #endif // __clang__ | ||||
| 23202 | slot = temp; | ||||
| 23203 | } | ||||
| 23204 | } else { | ||||
| 23205 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 23206 | return false; | ||||
| 23207 | } | ||||
| 23208 | } | ||||
| 23209 | } else { | ||||
| 23210 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 23211 | return false; | ||||
| 23212 | } | ||||
| 23213 | if (objIsXray) { | ||||
| 23214 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 23215 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 23216 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 23217 | if (!unwrappedObj.ref()) { | ||||
| 23218 | return false; | ||||
| 23219 | } | ||||
| 23220 | } | ||||
| 23221 | FastErrorResult rv; | ||||
| 23222 | // NOTE: This assert does NOT call the function. | ||||
| 23223 | 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"); | ||||
| 23224 | MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 23225 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny" )), 0))) { | ||||
| 23226 | return false; | ||||
| 23227 | } | ||||
| 23228 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 23228); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23228; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 23229 | args.rval().setUndefined(); | ||||
| 23230 | return true; | ||||
| 23231 | } | ||||
| 23232 | |||||
| 23233 | static const JSJitInfo passRecordOfRecordOfAny_methodinfo = { | ||||
| 23234 | { (JSJitGetterOp)passRecordOfRecordOfAny }, | ||||
| 23235 | { prototypes::id::TestJSImplInterface }, | ||||
| 23236 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 23237 | JSJitInfo::Method, | ||||
| 23238 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 23239 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 23240 | false, /* isInfallible. False in setters. */ | ||||
| 23241 | false, /* isMovable. Not relevant for setters. */ | ||||
| 23242 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 23243 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 23244 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 23245 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 23246 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 23247 | }; | ||||
| 23248 | |||||
| 23249 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 23250 | passRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 23251 | { | ||||
| 23252 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableRecordOfAny"); | ||||
| 23253 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23256( cx, "TestJSImplInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23254 | "TestJSImplInterface", "passRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23256( cx, "TestJSImplInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23255 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23256( cx, "TestJSImplInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23256 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23256( cx, "TestJSImplInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 23257 | |||||
| 23258 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 23259 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny", 1)) { | ||||
| 23260 | return false; | ||||
| 23261 | } | ||||
| 23262 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 23263 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 23264 | if (objIsXray) { | ||||
| 23265 | unwrappedObj.emplace(cx, obj); | ||||
| 23266 | } | ||||
| 23267 | Record<nsString, Nullable<Record<nsString, JS::Value>>> arg0; | ||||
| 23268 | RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0); | ||||
| 23269 | if (args[0].isObject()) { | ||||
| 23270 | auto& recordEntries = arg0.Entries(); | ||||
| 23271 | |||||
| 23272 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 23273 | JS::RootedVector<jsid> ids(cx); | ||||
| 23274 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23275 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23276 | return false; | ||||
| 23277 | } | ||||
| 23278 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23279 | JS_ReportOutOfMemory(cx); | ||||
| 23280 | return false; | ||||
| 23281 | } | ||||
| 23282 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23283 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23284 | JS::Rooted<jsid> curId(cx); | ||||
| 23285 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23286 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23287 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23288 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23289 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23290 | // around. | ||||
| 23291 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23292 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23293 | curId = ids[i]; | ||||
| 23294 | |||||
| 23295 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23296 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23297 | &desc)) { | ||||
| 23298 | return false; | ||||
| 23299 | } | ||||
| 23300 | |||||
| 23301 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23302 | continue; | ||||
| 23303 | } | ||||
| 23304 | |||||
| 23305 | idVal = js::IdToValue(curId); | ||||
| 23306 | nsString propName; | ||||
| 23307 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23308 | // to do. | ||||
| 23309 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 23310 | return false; | ||||
| 23311 | } | ||||
| 23312 | |||||
| 23313 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23314 | return false; | ||||
| 23315 | } | ||||
| 23316 | |||||
| 23317 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | ||||
| 23318 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23319 | // Find the existing entry. | ||||
| 23320 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23321 | 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", 23322); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23322; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23322 | "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", 23322); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23322; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23323 | // Now blow it away to make it look like it was just added | ||||
| 23324 | // to the array, because it's not obvious that it's | ||||
| 23325 | // safe to write to its already-initialized mValue via our | ||||
| 23326 | // normal codegen conversions. For example, the value | ||||
| 23327 | // could be a union and this would change its type, but | ||||
| 23328 | // codegen assumes we won't do that. | ||||
| 23329 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23330 | } else { | ||||
| 23331 | // Safe to do an infallible append here, because we did a | ||||
| 23332 | // SetCapacity above to the right capacity. | ||||
| 23333 | entry = recordEntries.AppendElement(); | ||||
| 23334 | } | ||||
| 23335 | entry->mKey = propName; | ||||
| 23336 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | ||||
| 23337 | if (temp.isObject()) { | ||||
| 23338 | auto& recordEntries = slot.SetValue().Entries(); | ||||
| 23339 | |||||
| 23340 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | ||||
| 23341 | JS::RootedVector<jsid> ids(cx); | ||||
| 23342 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23343 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23344 | return false; | ||||
| 23345 | } | ||||
| 23346 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23347 | JS_ReportOutOfMemory(cx); | ||||
| 23348 | return false; | ||||
| 23349 | } | ||||
| 23350 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23351 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23352 | JS::Rooted<jsid> curId(cx); | ||||
| 23353 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23354 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23355 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23356 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23357 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23358 | // around. | ||||
| 23359 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23360 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23361 | curId = ids[i]; | ||||
| 23362 | |||||
| 23363 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23364 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23365 | &desc)) { | ||||
| 23366 | return false; | ||||
| 23367 | } | ||||
| 23368 | |||||
| 23369 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23370 | continue; | ||||
| 23371 | } | ||||
| 23372 | |||||
| 23373 | idVal = js::IdToValue(curId); | ||||
| 23374 | nsString propName; | ||||
| 23375 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23376 | // to do. | ||||
| 23377 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | ||||
| 23378 | return false; | ||||
| 23379 | } | ||||
| 23380 | |||||
| 23381 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23382 | return false; | ||||
| 23383 | } | ||||
| 23384 | |||||
| 23385 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 23386 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23387 | // Find the existing entry. | ||||
| 23388 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23389 | 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", 23390); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23390; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23390 | "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", 23390); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23390; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23391 | // Now blow it away to make it look like it was just added | ||||
| 23392 | // to the array, because it's not obvious that it's | ||||
| 23393 | // safe to write to its already-initialized mValue via our | ||||
| 23394 | // normal codegen conversions. For example, the value | ||||
| 23395 | // could be a union and this would change its type, but | ||||
| 23396 | // codegen assumes we won't do that. | ||||
| 23397 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23398 | } else { | ||||
| 23399 | // Safe to do an infallible append here, because we did a | ||||
| 23400 | // SetCapacity above to the right capacity. | ||||
| 23401 | entry = recordEntries.AppendElement(); | ||||
| 23402 | } | ||||
| 23403 | entry->mKey = propName; | ||||
| 23404 | JS::Value& slot = entry->mValue; | ||||
| 23405 | #ifdef __clang__1 | ||||
| 23406 | #pragma clang diagnostic push | ||||
| 23407 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 23408 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 23409 | #endif // __clang__ | ||||
| 23410 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 23411 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1"); | ||||
| 23412 | return false; | ||||
| 23413 | } | ||||
| 23414 | #ifdef __clang__1 | ||||
| 23415 | #pragma clang diagnostic pop | ||||
| 23416 | #endif // __clang__ | ||||
| 23417 | slot = temp; | ||||
| 23418 | } | ||||
| 23419 | } else if (temp.isNullOrUndefined()) { | ||||
| 23420 | slot.SetNull(); | ||||
| 23421 | } else { | ||||
| 23422 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 23423 | return false; | ||||
| 23424 | } | ||||
| 23425 | } | ||||
| 23426 | } else { | ||||
| 23427 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 23428 | return false; | ||||
| 23429 | } | ||||
| 23430 | if (objIsXray) { | ||||
| 23431 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 23432 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 23433 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 23434 | if (!unwrappedObj.ref()) { | ||||
| 23435 | return false; | ||||
| 23436 | } | ||||
| 23437 | } | ||||
| 23438 | FastErrorResult rv; | ||||
| 23439 | // NOTE: This assert does NOT call the function. | ||||
| 23440 | 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"); | ||||
| 23441 | MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 23442 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny" )), 0))) { | ||||
| 23443 | return false; | ||||
| 23444 | } | ||||
| 23445 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 23445); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23445; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 23446 | args.rval().setUndefined(); | ||||
| 23447 | return true; | ||||
| 23448 | } | ||||
| 23449 | |||||
| 23450 | static const JSJitInfo passRecordOfNullableRecordOfAny_methodinfo = { | ||||
| 23451 | { (JSJitGetterOp)passRecordOfNullableRecordOfAny }, | ||||
| 23452 | { prototypes::id::TestJSImplInterface }, | ||||
| 23453 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 23454 | JSJitInfo::Method, | ||||
| 23455 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 23456 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 23457 | false, /* isInfallible. False in setters. */ | ||||
| 23458 | false, /* isMovable. Not relevant for setters. */ | ||||
| 23459 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 23460 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 23461 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 23462 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 23463 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 23464 | }; | ||||
| 23465 | |||||
| 23466 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 23467 | passNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 23468 | { | ||||
| 23469 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"); | ||||
| 23470 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23473( cx, "TestJSImplInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23471 | "TestJSImplInterface", "passNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23473( cx, "TestJSImplInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23472 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23473( cx, "TestJSImplInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23473 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23473( cx, "TestJSImplInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 23474 | |||||
| 23475 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 23476 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", 1)) { | ||||
| 23477 | return false; | ||||
| 23478 | } | ||||
| 23479 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 23480 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 23481 | if (objIsXray) { | ||||
| 23482 | unwrappedObj.emplace(cx, obj); | ||||
| 23483 | } | ||||
| 23484 | Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>> arg0; | ||||
| 23485 | RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0.SetValue()); | ||||
| 23486 | if (args[0].isObject()) { | ||||
| 23487 | auto& recordEntries = arg0.SetValue().Entries(); | ||||
| 23488 | |||||
| 23489 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 23490 | JS::RootedVector<jsid> ids(cx); | ||||
| 23491 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23492 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23493 | return false; | ||||
| 23494 | } | ||||
| 23495 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23496 | JS_ReportOutOfMemory(cx); | ||||
| 23497 | return false; | ||||
| 23498 | } | ||||
| 23499 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23500 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23501 | JS::Rooted<jsid> curId(cx); | ||||
| 23502 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23503 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23504 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23505 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23506 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23507 | // around. | ||||
| 23508 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23509 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23510 | curId = ids[i]; | ||||
| 23511 | |||||
| 23512 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23513 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23514 | &desc)) { | ||||
| 23515 | return false; | ||||
| 23516 | } | ||||
| 23517 | |||||
| 23518 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23519 | continue; | ||||
| 23520 | } | ||||
| 23521 | |||||
| 23522 | idVal = js::IdToValue(curId); | ||||
| 23523 | nsString propName; | ||||
| 23524 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23525 | // to do. | ||||
| 23526 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 23527 | return false; | ||||
| 23528 | } | ||||
| 23529 | |||||
| 23530 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23531 | return false; | ||||
| 23532 | } | ||||
| 23533 | |||||
| 23534 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | ||||
| 23535 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23536 | // Find the existing entry. | ||||
| 23537 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23538 | 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", 23539); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23539; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23539 | "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", 23539); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23539; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23540 | // Now blow it away to make it look like it was just added | ||||
| 23541 | // to the array, because it's not obvious that it's | ||||
| 23542 | // safe to write to its already-initialized mValue via our | ||||
| 23543 | // normal codegen conversions. For example, the value | ||||
| 23544 | // could be a union and this would change its type, but | ||||
| 23545 | // codegen assumes we won't do that. | ||||
| 23546 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23547 | } else { | ||||
| 23548 | // Safe to do an infallible append here, because we did a | ||||
| 23549 | // SetCapacity above to the right capacity. | ||||
| 23550 | entry = recordEntries.AppendElement(); | ||||
| 23551 | } | ||||
| 23552 | entry->mKey = propName; | ||||
| 23553 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | ||||
| 23554 | if (temp.isObject()) { | ||||
| 23555 | auto& recordEntries = slot.SetValue().Entries(); | ||||
| 23556 | |||||
| 23557 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | ||||
| 23558 | JS::RootedVector<jsid> ids(cx); | ||||
| 23559 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23560 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23561 | return false; | ||||
| 23562 | } | ||||
| 23563 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23564 | JS_ReportOutOfMemory(cx); | ||||
| 23565 | return false; | ||||
| 23566 | } | ||||
| 23567 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23568 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23569 | JS::Rooted<jsid> curId(cx); | ||||
| 23570 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23571 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23572 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23573 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23574 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23575 | // around. | ||||
| 23576 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23577 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23578 | curId = ids[i]; | ||||
| 23579 | |||||
| 23580 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23581 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23582 | &desc)) { | ||||
| 23583 | return false; | ||||
| 23584 | } | ||||
| 23585 | |||||
| 23586 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23587 | continue; | ||||
| 23588 | } | ||||
| 23589 | |||||
| 23590 | idVal = js::IdToValue(curId); | ||||
| 23591 | nsString propName; | ||||
| 23592 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23593 | // to do. | ||||
| 23594 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | ||||
| 23595 | return false; | ||||
| 23596 | } | ||||
| 23597 | |||||
| 23598 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23599 | return false; | ||||
| 23600 | } | ||||
| 23601 | |||||
| 23602 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 23603 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23604 | // Find the existing entry. | ||||
| 23605 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23606 | 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", 23607); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23607; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23607 | "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", 23607); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23607; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23608 | // Now blow it away to make it look like it was just added | ||||
| 23609 | // to the array, because it's not obvious that it's | ||||
| 23610 | // safe to write to its already-initialized mValue via our | ||||
| 23611 | // normal codegen conversions. For example, the value | ||||
| 23612 | // could be a union and this would change its type, but | ||||
| 23613 | // codegen assumes we won't do that. | ||||
| 23614 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23615 | } else { | ||||
| 23616 | // Safe to do an infallible append here, because we did a | ||||
| 23617 | // SetCapacity above to the right capacity. | ||||
| 23618 | entry = recordEntries.AppendElement(); | ||||
| 23619 | } | ||||
| 23620 | entry->mKey = propName; | ||||
| 23621 | JS::Value& slot = entry->mValue; | ||||
| 23622 | #ifdef __clang__1 | ||||
| 23623 | #pragma clang diagnostic push | ||||
| 23624 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 23625 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 23626 | #endif // __clang__ | ||||
| 23627 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 23628 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1"); | ||||
| 23629 | return false; | ||||
| 23630 | } | ||||
| 23631 | #ifdef __clang__1 | ||||
| 23632 | #pragma clang diagnostic pop | ||||
| 23633 | #endif // __clang__ | ||||
| 23634 | slot = temp; | ||||
| 23635 | } | ||||
| 23636 | } else if (temp.isNullOrUndefined()) { | ||||
| 23637 | slot.SetNull(); | ||||
| 23638 | } else { | ||||
| 23639 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 23640 | return false; | ||||
| 23641 | } | ||||
| 23642 | } | ||||
| 23643 | } else if (args[0].isNullOrUndefined()) { | ||||
| 23644 | arg0.SetNull(); | ||||
| 23645 | } else { | ||||
| 23646 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 23647 | return false; | ||||
| 23648 | } | ||||
| 23649 | if (objIsXray) { | ||||
| 23650 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 23651 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 23652 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 23653 | if (!unwrappedObj.ref()) { | ||||
| 23654 | return false; | ||||
| 23655 | } | ||||
| 23656 | } | ||||
| 23657 | FastErrorResult rv; | ||||
| 23658 | // NOTE: This assert does NOT call the function. | ||||
| 23659 | 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"); | ||||
| 23660 | MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 23661 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny" )), 0))) { | ||||
| 23662 | return false; | ||||
| 23663 | } | ||||
| 23664 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 23664); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23664; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 23665 | args.rval().setUndefined(); | ||||
| 23666 | return true; | ||||
| 23667 | } | ||||
| 23668 | |||||
| 23669 | static const JSJitInfo passNullableRecordOfNullableRecordOfAny_methodinfo = { | ||||
| 23670 | { (JSJitGetterOp)passNullableRecordOfNullableRecordOfAny }, | ||||
| 23671 | { prototypes::id::TestJSImplInterface }, | ||||
| 23672 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 23673 | JSJitInfo::Method, | ||||
| 23674 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 23675 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 23676 | false, /* isInfallible. False in setters. */ | ||||
| 23677 | false, /* isMovable. Not relevant for setters. */ | ||||
| 23678 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 23679 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 23680 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 23681 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 23682 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 23683 | }; | ||||
| 23684 | |||||
| 23685 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 23686 | passOptionalNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 23687 | { | ||||
| 23688 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"); | ||||
| 23689 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23692( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23690 | "TestJSImplInterface", "passOptionalNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23692( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23691 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23692( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23692 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23692( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 23693 | |||||
| 23694 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 23695 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 23696 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 23697 | if (objIsXray) { | ||||
| 23698 | unwrappedObj.emplace(cx, obj); | ||||
| 23699 | } | ||||
| 23700 | Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>> arg0; | ||||
| 23701 | Maybe<RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>>> arg0_holder; | ||||
| 23702 | if (args.hasDefined(0)) { | ||||
| 23703 | arg0.Construct(); | ||||
| 23704 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 23705 | if (args[0].isObject()) { | ||||
| 23706 | auto& recordEntries = arg0.Value().SetValue().Entries(); | ||||
| 23707 | |||||
| 23708 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 23709 | JS::RootedVector<jsid> ids(cx); | ||||
| 23710 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23711 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23712 | return false; | ||||
| 23713 | } | ||||
| 23714 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23715 | JS_ReportOutOfMemory(cx); | ||||
| 23716 | return false; | ||||
| 23717 | } | ||||
| 23718 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23719 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23720 | JS::Rooted<jsid> curId(cx); | ||||
| 23721 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23722 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23723 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23724 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23725 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23726 | // around. | ||||
| 23727 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23728 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23729 | curId = ids[i]; | ||||
| 23730 | |||||
| 23731 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23732 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23733 | &desc)) { | ||||
| 23734 | return false; | ||||
| 23735 | } | ||||
| 23736 | |||||
| 23737 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23738 | continue; | ||||
| 23739 | } | ||||
| 23740 | |||||
| 23741 | idVal = js::IdToValue(curId); | ||||
| 23742 | nsString propName; | ||||
| 23743 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23744 | // to do. | ||||
| 23745 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 23746 | return false; | ||||
| 23747 | } | ||||
| 23748 | |||||
| 23749 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23750 | return false; | ||||
| 23751 | } | ||||
| 23752 | |||||
| 23753 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | ||||
| 23754 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23755 | // Find the existing entry. | ||||
| 23756 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23757 | 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", 23758); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23758; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23758 | "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", 23758); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23758; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23759 | // Now blow it away to make it look like it was just added | ||||
| 23760 | // to the array, because it's not obvious that it's | ||||
| 23761 | // safe to write to its already-initialized mValue via our | ||||
| 23762 | // normal codegen conversions. For example, the value | ||||
| 23763 | // could be a union and this would change its type, but | ||||
| 23764 | // codegen assumes we won't do that. | ||||
| 23765 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23766 | } else { | ||||
| 23767 | // Safe to do an infallible append here, because we did a | ||||
| 23768 | // SetCapacity above to the right capacity. | ||||
| 23769 | entry = recordEntries.AppendElement(); | ||||
| 23770 | } | ||||
| 23771 | entry->mKey = propName; | ||||
| 23772 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | ||||
| 23773 | if (temp.isObject()) { | ||||
| 23774 | auto& recordEntries = slot.SetValue().Entries(); | ||||
| 23775 | |||||
| 23776 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | ||||
| 23777 | JS::RootedVector<jsid> ids(cx); | ||||
| 23778 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23779 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23780 | return false; | ||||
| 23781 | } | ||||
| 23782 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23783 | JS_ReportOutOfMemory(cx); | ||||
| 23784 | return false; | ||||
| 23785 | } | ||||
| 23786 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23787 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23788 | JS::Rooted<jsid> curId(cx); | ||||
| 23789 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23790 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23791 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23792 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23793 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23794 | // around. | ||||
| 23795 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23796 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23797 | curId = ids[i]; | ||||
| 23798 | |||||
| 23799 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23800 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23801 | &desc)) { | ||||
| 23802 | return false; | ||||
| 23803 | } | ||||
| 23804 | |||||
| 23805 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23806 | continue; | ||||
| 23807 | } | ||||
| 23808 | |||||
| 23809 | idVal = js::IdToValue(curId); | ||||
| 23810 | nsString propName; | ||||
| 23811 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23812 | // to do. | ||||
| 23813 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | ||||
| 23814 | return false; | ||||
| 23815 | } | ||||
| 23816 | |||||
| 23817 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23818 | return false; | ||||
| 23819 | } | ||||
| 23820 | |||||
| 23821 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 23822 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23823 | // Find the existing entry. | ||||
| 23824 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23825 | 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", 23826); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23826; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23826 | "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", 23826); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23826; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23827 | // Now blow it away to make it look like it was just added | ||||
| 23828 | // to the array, because it's not obvious that it's | ||||
| 23829 | // safe to write to its already-initialized mValue via our | ||||
| 23830 | // normal codegen conversions. For example, the value | ||||
| 23831 | // could be a union and this would change its type, but | ||||
| 23832 | // codegen assumes we won't do that. | ||||
| 23833 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23834 | } else { | ||||
| 23835 | // Safe to do an infallible append here, because we did a | ||||
| 23836 | // SetCapacity above to the right capacity. | ||||
| 23837 | entry = recordEntries.AppendElement(); | ||||
| 23838 | } | ||||
| 23839 | entry->mKey = propName; | ||||
| 23840 | JS::Value& slot = entry->mValue; | ||||
| 23841 | #ifdef __clang__1 | ||||
| 23842 | #pragma clang diagnostic push | ||||
| 23843 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 23844 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 23845 | #endif // __clang__ | ||||
| 23846 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 23847 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1"); | ||||
| 23848 | return false; | ||||
| 23849 | } | ||||
| 23850 | #ifdef __clang__1 | ||||
| 23851 | #pragma clang diagnostic pop | ||||
| 23852 | #endif // __clang__ | ||||
| 23853 | slot = temp; | ||||
| 23854 | } | ||||
| 23855 | } else if (temp.isNullOrUndefined()) { | ||||
| 23856 | slot.SetNull(); | ||||
| 23857 | } else { | ||||
| 23858 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 23859 | return false; | ||||
| 23860 | } | ||||
| 23861 | } | ||||
| 23862 | } else if (args[0].isNullOrUndefined()) { | ||||
| 23863 | arg0.Value().SetNull(); | ||||
| 23864 | } else { | ||||
| 23865 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 23866 | return false; | ||||
| 23867 | } | ||||
| 23868 | } | ||||
| 23869 | if (objIsXray) { | ||||
| 23870 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 23871 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 23872 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 23873 | if (!unwrappedObj.ref()) { | ||||
| 23874 | return false; | ||||
| 23875 | } | ||||
| 23876 | } | ||||
| 23877 | FastErrorResult rv; | ||||
| 23878 | // NOTE: This assert does NOT call the function. | ||||
| 23879 | 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"); | ||||
| 23880 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 23881 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny" )), 0))) { | ||||
| 23882 | return false; | ||||
| 23883 | } | ||||
| 23884 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 23884); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23884; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 23885 | args.rval().setUndefined(); | ||||
| 23886 | return true; | ||||
| 23887 | } | ||||
| 23888 | |||||
| 23889 | static const JSJitInfo passOptionalNullableRecordOfNullableRecordOfAny_methodinfo = { | ||||
| 23890 | { (JSJitGetterOp)passOptionalNullableRecordOfNullableRecordOfAny }, | ||||
| 23891 | { prototypes::id::TestJSImplInterface }, | ||||
| 23892 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 23893 | JSJitInfo::Method, | ||||
| 23894 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 23895 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 23896 | false, /* isInfallible. False in setters. */ | ||||
| 23897 | false, /* isMovable. Not relevant for setters. */ | ||||
| 23898 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 23899 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 23900 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 23901 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 23902 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 23903 | }; | ||||
| 23904 | |||||
| 23905 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 23906 | passOptionalNullableRecordOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 23907 | { | ||||
| 23908 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"); | ||||
| 23909 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23912( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23910 | "TestJSImplInterface", "passOptionalNullableRecordOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23912( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23911 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23912( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 23912 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23912( cx, "TestJSImplInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 23913 | |||||
| 23914 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 23915 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 23916 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 23917 | if (objIsXray) { | ||||
| 23918 | unwrappedObj.emplace(cx, obj); | ||||
| 23919 | } | ||||
| 23920 | Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>> arg0; | ||||
| 23921 | Maybe<RecordRooter<nsString, Nullable<Sequence<JS::Value>>>> arg0_holder; | ||||
| 23922 | if (args.hasDefined(0)) { | ||||
| 23923 | arg0.Construct(); | ||||
| 23924 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 23925 | if (args[0].isObject()) { | ||||
| 23926 | auto& recordEntries = arg0.Value().SetValue().Entries(); | ||||
| 23927 | |||||
| 23928 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 23929 | JS::RootedVector<jsid> ids(cx); | ||||
| 23930 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 23931 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 23932 | return false; | ||||
| 23933 | } | ||||
| 23934 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 23935 | JS_ReportOutOfMemory(cx); | ||||
| 23936 | return false; | ||||
| 23937 | } | ||||
| 23938 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 23939 | JS::Rooted<JS::Value> temp(cx); | ||||
| 23940 | JS::Rooted<jsid> curId(cx); | ||||
| 23941 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 23942 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 23943 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 23944 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 23945 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 23946 | // around. | ||||
| 23947 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 23948 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 23949 | curId = ids[i]; | ||||
| 23950 | |||||
| 23951 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 23952 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 23953 | &desc)) { | ||||
| 23954 | return false; | ||||
| 23955 | } | ||||
| 23956 | |||||
| 23957 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 23958 | continue; | ||||
| 23959 | } | ||||
| 23960 | |||||
| 23961 | idVal = js::IdToValue(curId); | ||||
| 23962 | nsString propName; | ||||
| 23963 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 23964 | // to do. | ||||
| 23965 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 23966 | return false; | ||||
| 23967 | } | ||||
| 23968 | |||||
| 23969 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 23970 | return false; | ||||
| 23971 | } | ||||
| 23972 | |||||
| 23973 | Record<nsString, Nullable<Sequence<JS::Value>>>::EntryType* entry; | ||||
| 23974 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 23975 | // Find the existing entry. | ||||
| 23976 | auto idx = recordEntries.IndexOf(propName); | ||||
| 23977 | 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", 23978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23978; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 23978 | "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", 23978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 23978; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 23979 | // Now blow it away to make it look like it was just added | ||||
| 23980 | // to the array, because it's not obvious that it's | ||||
| 23981 | // safe to write to its already-initialized mValue via our | ||||
| 23982 | // normal codegen conversions. For example, the value | ||||
| 23983 | // could be a union and this would change its type, but | ||||
| 23984 | // codegen assumes we won't do that. | ||||
| 23985 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 23986 | } else { | ||||
| 23987 | // Safe to do an infallible append here, because we did a | ||||
| 23988 | // SetCapacity above to the right capacity. | ||||
| 23989 | entry = recordEntries.AppendElement(); | ||||
| 23990 | } | ||||
| 23991 | entry->mKey = propName; | ||||
| 23992 | Nullable<Sequence<JS::Value>>& slot = entry->mValue; | ||||
| 23993 | if (temp.isObject()) { | ||||
| 23994 | JS::ForOfIterator iter1(cx); | ||||
| 23995 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 23996 | return false; | ||||
| 23997 | } | ||||
| 23998 | if (!iter1.valueIsIterable()) { | ||||
| 23999 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence"); | ||||
| 24000 | return false; | ||||
| 24001 | } | ||||
| 24002 | Sequence<JS::Value> &arr1 = slot.SetValue(); | ||||
| 24003 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 24004 | while (true) { | ||||
| 24005 | bool done1; | ||||
| 24006 | if (!iter1.next(&temp1, &done1)) { | ||||
| 24007 | return false; | ||||
| 24008 | } | ||||
| 24009 | if (done1) { | ||||
| 24010 | break; | ||||
| 24011 | } | ||||
| 24012 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | ||||
| 24013 | if (!slotPtr1) { | ||||
| 24014 | JS_ReportOutOfMemory(cx); | ||||
| 24015 | return false; | ||||
| 24016 | } | ||||
| 24017 | JS::Value& slot1 = *slotPtr1; | ||||
| 24018 | #ifdef __clang__1 | ||||
| 24019 | #pragma clang diagnostic push | ||||
| 24020 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24021 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24022 | #endif // __clang__ | ||||
| 24023 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 24024 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of value in argument 1"); | ||||
| 24025 | return false; | ||||
| 24026 | } | ||||
| 24027 | #ifdef __clang__1 | ||||
| 24028 | #pragma clang diagnostic pop | ||||
| 24029 | #endif // __clang__ | ||||
| 24030 | slot1 = temp1; | ||||
| 24031 | } | ||||
| 24032 | } else if (temp.isNullOrUndefined()) { | ||||
| 24033 | slot.SetNull(); | ||||
| 24034 | } else { | ||||
| 24035 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence"); | ||||
| 24036 | return false; | ||||
| 24037 | } | ||||
| 24038 | } | ||||
| 24039 | } else if (args[0].isNullOrUndefined()) { | ||||
| 24040 | arg0.Value().SetNull(); | ||||
| 24041 | } else { | ||||
| 24042 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24043 | return false; | ||||
| 24044 | } | ||||
| 24045 | } | ||||
| 24046 | if (objIsXray) { | ||||
| 24047 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24048 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24049 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24050 | if (!unwrappedObj.ref()) { | ||||
| 24051 | return false; | ||||
| 24052 | } | ||||
| 24053 | } | ||||
| 24054 | FastErrorResult rv; | ||||
| 24055 | // NOTE: This assert does NOT call the function. | ||||
| 24056 | 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"); | ||||
| 24057 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24058 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny" )), 0))) { | ||||
| 24059 | return false; | ||||
| 24060 | } | ||||
| 24061 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24062 | args.rval().setUndefined(); | ||||
| 24063 | return true; | ||||
| 24064 | } | ||||
| 24065 | |||||
| 24066 | static const JSJitInfo passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo = { | ||||
| 24067 | { (JSJitGetterOp)passOptionalNullableRecordOfNullableSequenceOfAny }, | ||||
| 24068 | { prototypes::id::TestJSImplInterface }, | ||||
| 24069 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24070 | JSJitInfo::Method, | ||||
| 24071 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24072 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24073 | false, /* isInfallible. False in setters. */ | ||||
| 24074 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24075 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24076 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24077 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24078 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24079 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24080 | }; | ||||
| 24081 | |||||
| 24082 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24083 | passOptionalNullableSequenceOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24084 | { | ||||
| 24085 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"); | ||||
| 24086 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24089( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24087 | "TestJSImplInterface", "passOptionalNullableSequenceOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24089( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24088 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24089( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24089 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24089( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 24090 | |||||
| 24091 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24092 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24093 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24094 | if (objIsXray) { | ||||
| 24095 | unwrappedObj.emplace(cx, obj); | ||||
| 24096 | } | ||||
| 24097 | Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>> arg0; | ||||
| 24098 | Maybe<SequenceRooter<Nullable<Record<nsString, JS::Value>>>> arg0_holder; | ||||
| 24099 | if (args.hasDefined(0)) { | ||||
| 24100 | arg0.Construct(); | ||||
| 24101 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 24102 | if (args[0].isObject()) { | ||||
| 24103 | JS::ForOfIterator iter(cx); | ||||
| 24104 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 24105 | return false; | ||||
| 24106 | } | ||||
| 24107 | if (!iter.valueIsIterable()) { | ||||
| 24108 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 24109 | return false; | ||||
| 24110 | } | ||||
| 24111 | Sequence<Nullable<Record<nsString, JS::Value>>> &arr = arg0.Value().SetValue(); | ||||
| 24112 | JS::Rooted<JS::Value> temp(cx); | ||||
| 24113 | while (true) { | ||||
| 24114 | bool done; | ||||
| 24115 | if (!iter.next(&temp, &done)) { | ||||
| 24116 | return false; | ||||
| 24117 | } | ||||
| 24118 | if (done) { | ||||
| 24119 | break; | ||||
| 24120 | } | ||||
| 24121 | Nullable<Record<nsString, JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 24122 | if (!slotPtr) { | ||||
| 24123 | JS_ReportOutOfMemory(cx); | ||||
| 24124 | return false; | ||||
| 24125 | } | ||||
| 24126 | Nullable<Record<nsString, JS::Value>>& slot = *slotPtr; | ||||
| 24127 | if (temp.isObject()) { | ||||
| 24128 | auto& recordEntries = slot.SetValue().Entries(); | ||||
| 24129 | |||||
| 24130 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | ||||
| 24131 | JS::RootedVector<jsid> ids(cx); | ||||
| 24132 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 24133 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 24134 | return false; | ||||
| 24135 | } | ||||
| 24136 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 24137 | JS_ReportOutOfMemory(cx); | ||||
| 24138 | return false; | ||||
| 24139 | } | ||||
| 24140 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 24141 | JS::Rooted<JS::Value> temp(cx); | ||||
| 24142 | JS::Rooted<jsid> curId(cx); | ||||
| 24143 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 24144 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 24145 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 24146 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 24147 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 24148 | // around. | ||||
| 24149 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 24150 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 24151 | curId = ids[i]; | ||||
| 24152 | |||||
| 24153 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 24154 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 24155 | &desc)) { | ||||
| 24156 | return false; | ||||
| 24157 | } | ||||
| 24158 | |||||
| 24159 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 24160 | continue; | ||||
| 24161 | } | ||||
| 24162 | |||||
| 24163 | idVal = js::IdToValue(curId); | ||||
| 24164 | nsString propName; | ||||
| 24165 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 24166 | // to do. | ||||
| 24167 | if (!ConvertJSValueToString(cx, idVal, "key of element of argument 1", propName)) { | ||||
| 24168 | return false; | ||||
| 24169 | } | ||||
| 24170 | |||||
| 24171 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 24172 | return false; | ||||
| 24173 | } | ||||
| 24174 | |||||
| 24175 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 24176 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 24177 | // Find the existing entry. | ||||
| 24178 | auto idx = recordEntries.IndexOf(propName); | ||||
| 24179 | 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", 24180); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 24180; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 24180 | "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", 24180); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 24180; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 24181 | // Now blow it away to make it look like it was just added | ||||
| 24182 | // to the array, because it's not obvious that it's | ||||
| 24183 | // safe to write to its already-initialized mValue via our | ||||
| 24184 | // normal codegen conversions. For example, the value | ||||
| 24185 | // could be a union and this would change its type, but | ||||
| 24186 | // codegen assumes we won't do that. | ||||
| 24187 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 24188 | } else { | ||||
| 24189 | // Safe to do an infallible append here, because we did a | ||||
| 24190 | // SetCapacity above to the right capacity. | ||||
| 24191 | entry = recordEntries.AppendElement(); | ||||
| 24192 | } | ||||
| 24193 | entry->mKey = propName; | ||||
| 24194 | JS::Value& slot = entry->mValue; | ||||
| 24195 | #ifdef __clang__1 | ||||
| 24196 | #pragma clang diagnostic push | ||||
| 24197 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24198 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24199 | #endif // __clang__ | ||||
| 24200 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 24201 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in element of argument 1"); | ||||
| 24202 | return false; | ||||
| 24203 | } | ||||
| 24204 | #ifdef __clang__1 | ||||
| 24205 | #pragma clang diagnostic pop | ||||
| 24206 | #endif // __clang__ | ||||
| 24207 | slot = temp; | ||||
| 24208 | } | ||||
| 24209 | } else if (temp.isNullOrUndefined()) { | ||||
| 24210 | slot.SetNull(); | ||||
| 24211 | } else { | ||||
| 24212 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 24213 | return false; | ||||
| 24214 | } | ||||
| 24215 | } | ||||
| 24216 | } else if (args[0].isNullOrUndefined()) { | ||||
| 24217 | arg0.Value().SetNull(); | ||||
| 24218 | } else { | ||||
| 24219 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 24220 | return false; | ||||
| 24221 | } | ||||
| 24222 | } | ||||
| 24223 | if (objIsXray) { | ||||
| 24224 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24225 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24226 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24227 | if (!unwrappedObj.ref()) { | ||||
| 24228 | return false; | ||||
| 24229 | } | ||||
| 24230 | } | ||||
| 24231 | FastErrorResult rv; | ||||
| 24232 | // NOTE: This assert does NOT call the function. | ||||
| 24233 | 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"); | ||||
| 24234 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24235 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny" )), 0))) { | ||||
| 24236 | return false; | ||||
| 24237 | } | ||||
| 24238 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24238); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24238; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24239 | args.rval().setUndefined(); | ||||
| 24240 | return true; | ||||
| 24241 | } | ||||
| 24242 | |||||
| 24243 | static const JSJitInfo passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo = { | ||||
| 24244 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableRecordOfAny }, | ||||
| 24245 | { prototypes::id::TestJSImplInterface }, | ||||
| 24246 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24247 | JSJitInfo::Method, | ||||
| 24248 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24249 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24250 | false, /* isInfallible. False in setters. */ | ||||
| 24251 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24252 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24253 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24254 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24255 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24256 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24257 | }; | ||||
| 24258 | |||||
| 24259 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24260 | receiveAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24261 | { | ||||
| 24262 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24265( cx, "TestJSImplInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24263 | "TestJSImplInterface", "receiveAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24265( cx, "TestJSImplInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24264 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24265( cx, "TestJSImplInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24265 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24265( cx, "TestJSImplInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24266 | |||||
| 24267 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24268 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24269 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24270 | if (objIsXray) { | ||||
| 24271 | unwrappedObj.emplace(cx, obj); | ||||
| 24272 | } | ||||
| 24273 | if (objIsXray) { | ||||
| 24274 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24275 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24276 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24277 | if (!unwrappedObj.ref()) { | ||||
| 24278 | return false; | ||||
| 24279 | } | ||||
| 24280 | } | ||||
| 24281 | FastErrorResult rv; | ||||
| 24282 | JS::Rooted<JS::Value> result(cx); | ||||
| 24283 | // NOTE: This assert does NOT call the function. | ||||
| 24284 | 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"); | ||||
| 24285 | MOZ_KnownLive(self)(self)->ReceiveAny(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24286 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny" )), 0))) { | ||||
| 24287 | return false; | ||||
| 24288 | } | ||||
| 24289 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24289); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24289; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24290 | JS::ExposeValueToActiveJS(result); | ||||
| 24291 | args.rval().set(result); | ||||
| 24292 | if (!MaybeWrapValue(cx, args.rval())) { | ||||
| 24293 | return false; | ||||
| 24294 | } | ||||
| 24295 | return true; | ||||
| 24296 | } | ||||
| 24297 | |||||
| 24298 | static const JSJitInfo receiveAny_methodinfo = { | ||||
| 24299 | { (JSJitGetterOp)receiveAny }, | ||||
| 24300 | { prototypes::id::TestJSImplInterface }, | ||||
| 24301 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24302 | JSJitInfo::Method, | ||||
| 24303 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24304 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 24305 | false, /* isInfallible. False in setters. */ | ||||
| 24306 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24307 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24308 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24309 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24310 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24311 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24312 | }; | ||||
| 24313 | |||||
| 24314 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24315 | passObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24316 | { | ||||
| 24317 | BindingCallContext cx(cx_, "TestJSImplInterface.passObject"); | ||||
| 24318 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24321( cx, "TestJSImplInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24319 | "TestJSImplInterface", "passObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24321( cx, "TestJSImplInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24320 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24321( cx, "TestJSImplInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24321 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24321( cx, "TestJSImplInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24322 | |||||
| 24323 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24324 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passObject", 1)) { | ||||
| 24325 | return false; | ||||
| 24326 | } | ||||
| 24327 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24328 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24329 | if (objIsXray) { | ||||
| 24330 | unwrappedObj.emplace(cx, obj); | ||||
| 24331 | } | ||||
| 24332 | JS::Rooted<JSObject*> arg0(cx); | ||||
| 24333 | if (args[0].isObject()) { | ||||
| 24334 | #ifdef __clang__1 | ||||
| 24335 | #pragma clang diagnostic push | ||||
| 24336 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24337 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24338 | #endif // __clang__ | ||||
| 24339 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 24340 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24341 | return false; | ||||
| 24342 | } | ||||
| 24343 | #ifdef __clang__1 | ||||
| 24344 | #pragma clang diagnostic pop | ||||
| 24345 | #endif // __clang__ | ||||
| 24346 | arg0 = &args[0].toObject(); | ||||
| 24347 | } else { | ||||
| 24348 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24349 | return false; | ||||
| 24350 | } | ||||
| 24351 | if (objIsXray) { | ||||
| 24352 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24353 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24354 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24355 | if (!unwrappedObj.ref()) { | ||||
| 24356 | return false; | ||||
| 24357 | } | ||||
| 24358 | } | ||||
| 24359 | FastErrorResult rv; | ||||
| 24360 | // NOTE: This assert does NOT call the function. | ||||
| 24361 | 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"); | ||||
| 24362 | MOZ_KnownLive(self)(self)->PassObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24363 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject" )), 0))) { | ||||
| 24364 | return false; | ||||
| 24365 | } | ||||
| 24366 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24366); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24366; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24367 | args.rval().setUndefined(); | ||||
| 24368 | return true; | ||||
| 24369 | } | ||||
| 24370 | |||||
| 24371 | static const JSJitInfo passObject_methodinfo = { | ||||
| 24372 | { (JSJitGetterOp)passObject }, | ||||
| 24373 | { prototypes::id::TestJSImplInterface }, | ||||
| 24374 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24375 | JSJitInfo::Method, | ||||
| 24376 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24377 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24378 | false, /* isInfallible. False in setters. */ | ||||
| 24379 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24380 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24381 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24382 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24383 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24384 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24385 | }; | ||||
| 24386 | |||||
| 24387 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24388 | passVariadicObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24389 | { | ||||
| 24390 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicObject"); | ||||
| 24391 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24394( cx, "TestJSImplInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24392 | "TestJSImplInterface", "passVariadicObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24394( cx, "TestJSImplInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24393 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24394( cx, "TestJSImplInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24394 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24394( cx, "TestJSImplInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24395 | |||||
| 24396 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24397 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24398 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24399 | if (objIsXray) { | ||||
| 24400 | unwrappedObj.emplace(cx, obj); | ||||
| 24401 | } | ||||
| 24402 | AutoSequence<JSObject*> arg0; | ||||
| 24403 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | ||||
| 24404 | if (args.length() > 0) { | ||||
| 24405 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 24406 | JS_ReportOutOfMemory(cx); | ||||
| 24407 | return false; | ||||
| 24408 | } | ||||
| 24409 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 24410 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 24411 | JSObject*& slot = *arg0.AppendElement(nullptr); | ||||
| 24412 | if (args[variadicArg].isObject()) { | ||||
| 24413 | #ifdef __clang__1 | ||||
| 24414 | #pragma clang diagnostic push | ||||
| 24415 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24416 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24417 | #endif // __clang__ | ||||
| 24418 | if ((true) && !CallerSubsumes(args[variadicArg])) { | ||||
| 24419 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24420 | return false; | ||||
| 24421 | } | ||||
| 24422 | #ifdef __clang__1 | ||||
| 24423 | #pragma clang diagnostic pop | ||||
| 24424 | #endif // __clang__ | ||||
| 24425 | slot = &args[variadicArg].toObject(); | ||||
| 24426 | } else { | ||||
| 24427 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24428 | return false; | ||||
| 24429 | } | ||||
| 24430 | } | ||||
| 24431 | } | ||||
| 24432 | if (objIsXray) { | ||||
| 24433 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24434 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24435 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24436 | if (!unwrappedObj.ref()) { | ||||
| 24437 | return false; | ||||
| 24438 | } | ||||
| 24439 | } | ||||
| 24440 | FastErrorResult rv; | ||||
| 24441 | // NOTE: This assert does NOT call the function. | ||||
| 24442 | 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"); | ||||
| 24443 | MOZ_KnownLive(self)(self)->PassVariadicObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24444 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject" )), 0))) { | ||||
| 24445 | return false; | ||||
| 24446 | } | ||||
| 24447 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24447); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24447; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24448 | args.rval().setUndefined(); | ||||
| 24449 | return true; | ||||
| 24450 | } | ||||
| 24451 | |||||
| 24452 | static const JSJitInfo passVariadicObject_methodinfo = { | ||||
| 24453 | { (JSJitGetterOp)passVariadicObject }, | ||||
| 24454 | { prototypes::id::TestJSImplInterface }, | ||||
| 24455 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24456 | JSJitInfo::Method, | ||||
| 24457 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24458 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24459 | false, /* isInfallible. False in setters. */ | ||||
| 24460 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24461 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24462 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24463 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24464 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24465 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24466 | }; | ||||
| 24467 | |||||
| 24468 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24469 | passNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24470 | { | ||||
| 24471 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableObject"); | ||||
| 24472 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24475( cx, "TestJSImplInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24473 | "TestJSImplInterface", "passNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24475( cx, "TestJSImplInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24474 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24475( cx, "TestJSImplInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24475 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24475( cx, "TestJSImplInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24476 | |||||
| 24477 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24478 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableObject", 1)) { | ||||
| 24479 | return false; | ||||
| 24480 | } | ||||
| 24481 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24482 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24483 | if (objIsXray) { | ||||
| 24484 | unwrappedObj.emplace(cx, obj); | ||||
| 24485 | } | ||||
| 24486 | JS::Rooted<JSObject*> arg0(cx); | ||||
| 24487 | if (args[0].isObject()) { | ||||
| 24488 | #ifdef __clang__1 | ||||
| 24489 | #pragma clang diagnostic push | ||||
| 24490 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24491 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24492 | #endif // __clang__ | ||||
| 24493 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 24494 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24495 | return false; | ||||
| 24496 | } | ||||
| 24497 | #ifdef __clang__1 | ||||
| 24498 | #pragma clang diagnostic pop | ||||
| 24499 | #endif // __clang__ | ||||
| 24500 | arg0 = &args[0].toObject(); | ||||
| 24501 | } else if (args[0].isNullOrUndefined()) { | ||||
| 24502 | arg0 = nullptr; | ||||
| 24503 | } else { | ||||
| 24504 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24505 | return false; | ||||
| 24506 | } | ||||
| 24507 | if (objIsXray) { | ||||
| 24508 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24509 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24510 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24511 | if (!unwrappedObj.ref()) { | ||||
| 24512 | return false; | ||||
| 24513 | } | ||||
| 24514 | } | ||||
| 24515 | FastErrorResult rv; | ||||
| 24516 | // NOTE: This assert does NOT call the function. | ||||
| 24517 | 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"); | ||||
| 24518 | MOZ_KnownLive(self)(self)->PassNullableObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24519 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject" )), 0))) { | ||||
| 24520 | return false; | ||||
| 24521 | } | ||||
| 24522 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24522); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24522; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24523 | args.rval().setUndefined(); | ||||
| 24524 | return true; | ||||
| 24525 | } | ||||
| 24526 | |||||
| 24527 | static const JSJitInfo passNullableObject_methodinfo = { | ||||
| 24528 | { (JSJitGetterOp)passNullableObject }, | ||||
| 24529 | { prototypes::id::TestJSImplInterface }, | ||||
| 24530 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24531 | JSJitInfo::Method, | ||||
| 24532 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24533 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24534 | false, /* isInfallible. False in setters. */ | ||||
| 24535 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24536 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24537 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24538 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24539 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24540 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24541 | }; | ||||
| 24542 | |||||
| 24543 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24544 | passVariadicNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24545 | { | ||||
| 24546 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableObject"); | ||||
| 24547 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24550( cx, "TestJSImplInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24548 | "TestJSImplInterface", "passVariadicNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24550( cx, "TestJSImplInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24549 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24550( cx, "TestJSImplInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24550 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24550( cx, "TestJSImplInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 24551 | |||||
| 24552 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24553 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24554 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24555 | if (objIsXray) { | ||||
| 24556 | unwrappedObj.emplace(cx, obj); | ||||
| 24557 | } | ||||
| 24558 | AutoSequence<JSObject*> arg0; | ||||
| 24559 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | ||||
| 24560 | if (args.length() > 0) { | ||||
| 24561 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 24562 | JS_ReportOutOfMemory(cx); | ||||
| 24563 | return false; | ||||
| 24564 | } | ||||
| 24565 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 24566 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 24567 | JSObject*& slot = *arg0.AppendElement(nullptr); | ||||
| 24568 | if (args[variadicArg].isObject()) { | ||||
| 24569 | #ifdef __clang__1 | ||||
| 24570 | #pragma clang diagnostic push | ||||
| 24571 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24572 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24573 | #endif // __clang__ | ||||
| 24574 | if ((true) && !CallerSubsumes(args[variadicArg])) { | ||||
| 24575 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24576 | return false; | ||||
| 24577 | } | ||||
| 24578 | #ifdef __clang__1 | ||||
| 24579 | #pragma clang diagnostic pop | ||||
| 24580 | #endif // __clang__ | ||||
| 24581 | slot = &args[variadicArg].toObject(); | ||||
| 24582 | } else { | ||||
| 24583 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24584 | return false; | ||||
| 24585 | } | ||||
| 24586 | } | ||||
| 24587 | } | ||||
| 24588 | if (objIsXray) { | ||||
| 24589 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24590 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24591 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24592 | if (!unwrappedObj.ref()) { | ||||
| 24593 | return false; | ||||
| 24594 | } | ||||
| 24595 | } | ||||
| 24596 | FastErrorResult rv; | ||||
| 24597 | // NOTE: This assert does NOT call the function. | ||||
| 24598 | 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"); | ||||
| 24599 | MOZ_KnownLive(self)(self)->PassVariadicNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24600 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject" )), 0))) { | ||||
| 24601 | return false; | ||||
| 24602 | } | ||||
| 24603 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24603); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24603; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24604 | args.rval().setUndefined(); | ||||
| 24605 | return true; | ||||
| 24606 | } | ||||
| 24607 | |||||
| 24608 | static const JSJitInfo passVariadicNullableObject_methodinfo = { | ||||
| 24609 | { (JSJitGetterOp)passVariadicNullableObject }, | ||||
| 24610 | { prototypes::id::TestJSImplInterface }, | ||||
| 24611 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24612 | JSJitInfo::Method, | ||||
| 24613 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24614 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24615 | false, /* isInfallible. False in setters. */ | ||||
| 24616 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24617 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24618 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24619 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24620 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24621 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24622 | }; | ||||
| 24623 | |||||
| 24624 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24625 | passOptionalObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24626 | { | ||||
| 24627 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObject"); | ||||
| 24628 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24631( cx, "TestJSImplInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24629 | "TestJSImplInterface", "passOptionalObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24631( cx, "TestJSImplInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24630 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24631( cx, "TestJSImplInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24631 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24631( cx, "TestJSImplInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24632 | |||||
| 24633 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24634 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24635 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24636 | if (objIsXray) { | ||||
| 24637 | unwrappedObj.emplace(cx, obj); | ||||
| 24638 | } | ||||
| 24639 | Optional<JS::Handle<JSObject*>> arg0; | ||||
| 24640 | if (args.hasDefined(0)) { | ||||
| 24641 | arg0.Construct(cx); | ||||
| 24642 | if (args[0].isObject()) { | ||||
| 24643 | #ifdef __clang__1 | ||||
| 24644 | #pragma clang diagnostic push | ||||
| 24645 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24646 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24647 | #endif // __clang__ | ||||
| 24648 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 24649 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24650 | return false; | ||||
| 24651 | } | ||||
| 24652 | #ifdef __clang__1 | ||||
| 24653 | #pragma clang diagnostic pop | ||||
| 24654 | #endif // __clang__ | ||||
| 24655 | arg0.Value() = &args[0].toObject(); | ||||
| 24656 | } else { | ||||
| 24657 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24658 | return false; | ||||
| 24659 | } | ||||
| 24660 | } | ||||
| 24661 | if (objIsXray) { | ||||
| 24662 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24663 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24664 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24665 | if (!unwrappedObj.ref()) { | ||||
| 24666 | return false; | ||||
| 24667 | } | ||||
| 24668 | } | ||||
| 24669 | FastErrorResult rv; | ||||
| 24670 | // NOTE: This assert does NOT call the function. | ||||
| 24671 | 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"); | ||||
| 24672 | MOZ_KnownLive(self)(self)->PassOptionalObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24673 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject" )), 0))) { | ||||
| 24674 | return false; | ||||
| 24675 | } | ||||
| 24676 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24676); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24676; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24677 | args.rval().setUndefined(); | ||||
| 24678 | return true; | ||||
| 24679 | } | ||||
| 24680 | |||||
| 24681 | static const JSJitInfo passOptionalObject_methodinfo = { | ||||
| 24682 | { (JSJitGetterOp)passOptionalObject }, | ||||
| 24683 | { prototypes::id::TestJSImplInterface }, | ||||
| 24684 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24685 | JSJitInfo::Method, | ||||
| 24686 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24687 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24688 | false, /* isInfallible. False in setters. */ | ||||
| 24689 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24690 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24691 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24692 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24693 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24694 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24695 | }; | ||||
| 24696 | |||||
| 24697 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24698 | passOptionalNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24699 | { | ||||
| 24700 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObject"); | ||||
| 24701 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24704( cx, "TestJSImplInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24702 | "TestJSImplInterface", "passOptionalNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24704( cx, "TestJSImplInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24703 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24704( cx, "TestJSImplInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24704 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24704( cx, "TestJSImplInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 24705 | |||||
| 24706 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24707 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24708 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24709 | if (objIsXray) { | ||||
| 24710 | unwrappedObj.emplace(cx, obj); | ||||
| 24711 | } | ||||
| 24712 | Optional<JS::Handle<JSObject*>> arg0; | ||||
| 24713 | if (args.hasDefined(0)) { | ||||
| 24714 | arg0.Construct(cx); | ||||
| 24715 | if (args[0].isObject()) { | ||||
| 24716 | #ifdef __clang__1 | ||||
| 24717 | #pragma clang diagnostic push | ||||
| 24718 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24719 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24720 | #endif // __clang__ | ||||
| 24721 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 24722 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24723 | return false; | ||||
| 24724 | } | ||||
| 24725 | #ifdef __clang__1 | ||||
| 24726 | #pragma clang diagnostic pop | ||||
| 24727 | #endif // __clang__ | ||||
| 24728 | arg0.Value() = &args[0].toObject(); | ||||
| 24729 | } else if (args[0].isNullOrUndefined()) { | ||||
| 24730 | arg0.Value() = nullptr; | ||||
| 24731 | } else { | ||||
| 24732 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24733 | return false; | ||||
| 24734 | } | ||||
| 24735 | } | ||||
| 24736 | if (objIsXray) { | ||||
| 24737 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24738 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24739 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24740 | if (!unwrappedObj.ref()) { | ||||
| 24741 | return false; | ||||
| 24742 | } | ||||
| 24743 | } | ||||
| 24744 | FastErrorResult rv; | ||||
| 24745 | // NOTE: This assert does NOT call the function. | ||||
| 24746 | 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"); | ||||
| 24747 | MOZ_KnownLive(self)(self)->PassOptionalNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24748 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject" )), 0))) { | ||||
| 24749 | return false; | ||||
| 24750 | } | ||||
| 24751 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24751; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24752 | args.rval().setUndefined(); | ||||
| 24753 | return true; | ||||
| 24754 | } | ||||
| 24755 | |||||
| 24756 | static const JSJitInfo passOptionalNullableObject_methodinfo = { | ||||
| 24757 | { (JSJitGetterOp)passOptionalNullableObject }, | ||||
| 24758 | { prototypes::id::TestJSImplInterface }, | ||||
| 24759 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24760 | JSJitInfo::Method, | ||||
| 24761 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24762 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24763 | false, /* isInfallible. False in setters. */ | ||||
| 24764 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24765 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24766 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24767 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24768 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24769 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24770 | }; | ||||
| 24771 | |||||
| 24772 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24773 | passOptionalNullableObjectWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24774 | { | ||||
| 24775 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"); | ||||
| 24776 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24779( cx, "TestJSImplInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24777 | "TestJSImplInterface", "passOptionalNullableObjectWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24779( cx, "TestJSImplInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24778 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24779( cx, "TestJSImplInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24779 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24779( cx, "TestJSImplInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 24780 | |||||
| 24781 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24782 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24783 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24784 | if (objIsXray) { | ||||
| 24785 | unwrappedObj.emplace(cx, obj); | ||||
| 24786 | } | ||||
| 24787 | JS::Rooted<JSObject*> arg0(cx); | ||||
| 24788 | if (args.hasDefined(0)) { | ||||
| 24789 | if (args[0].isObject()) { | ||||
| 24790 | #ifdef __clang__1 | ||||
| 24791 | #pragma clang diagnostic push | ||||
| 24792 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24793 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24794 | #endif // __clang__ | ||||
| 24795 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 24796 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 24797 | return false; | ||||
| 24798 | } | ||||
| 24799 | #ifdef __clang__1 | ||||
| 24800 | #pragma clang diagnostic pop | ||||
| 24801 | #endif // __clang__ | ||||
| 24802 | arg0 = &args[0].toObject(); | ||||
| 24803 | } else if (args[0].isNullOrUndefined()) { | ||||
| 24804 | arg0 = nullptr; | ||||
| 24805 | } else { | ||||
| 24806 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 24807 | return false; | ||||
| 24808 | } | ||||
| 24809 | } else { | ||||
| 24810 | arg0 = nullptr; | ||||
| 24811 | } | ||||
| 24812 | if (objIsXray) { | ||||
| 24813 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24814 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24815 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24816 | if (!unwrappedObj.ref()) { | ||||
| 24817 | return false; | ||||
| 24818 | } | ||||
| 24819 | } | ||||
| 24820 | FastErrorResult rv; | ||||
| 24821 | // NOTE: This assert does NOT call the function. | ||||
| 24822 | 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"); | ||||
| 24823 | MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24824 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue" )), 0))) { | ||||
| 24825 | return false; | ||||
| 24826 | } | ||||
| 24827 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24827); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24827; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24828 | args.rval().setUndefined(); | ||||
| 24829 | return true; | ||||
| 24830 | } | ||||
| 24831 | |||||
| 24832 | static const JSJitInfo passOptionalNullableObjectWithDefaultValue_methodinfo = { | ||||
| 24833 | { (JSJitGetterOp)passOptionalNullableObjectWithDefaultValue }, | ||||
| 24834 | { prototypes::id::TestJSImplInterface }, | ||||
| 24835 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24836 | JSJitInfo::Method, | ||||
| 24837 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24838 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24839 | false, /* isInfallible. False in setters. */ | ||||
| 24840 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24841 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24842 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24843 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24844 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24845 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24846 | }; | ||||
| 24847 | |||||
| 24848 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24849 | passSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24850 | { | ||||
| 24851 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfObject"); | ||||
| 24852 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24855( cx, "TestJSImplInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24853 | "TestJSImplInterface", "passSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24855( cx, "TestJSImplInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24854 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24855( cx, "TestJSImplInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 24855 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24855( cx, "TestJSImplInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 24856 | |||||
| 24857 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24858 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfObject", 1)) { | ||||
| 24859 | return false; | ||||
| 24860 | } | ||||
| 24861 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24862 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24863 | if (objIsXray) { | ||||
| 24864 | unwrappedObj.emplace(cx, obj); | ||||
| 24865 | } | ||||
| 24866 | binding_detail::AutoSequence<JSObject*> arg0; | ||||
| 24867 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | ||||
| 24868 | if (args[0].isObject()) { | ||||
| 24869 | JS::ForOfIterator iter(cx); | ||||
| 24870 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 24871 | return false; | ||||
| 24872 | } | ||||
| 24873 | if (!iter.valueIsIterable()) { | ||||
| 24874 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 24875 | return false; | ||||
| 24876 | } | ||||
| 24877 | binding_detail::AutoSequence<JSObject*> &arr = arg0; | ||||
| 24878 | JS::Rooted<JS::Value> temp(cx); | ||||
| 24879 | while (true) { | ||||
| 24880 | bool done; | ||||
| 24881 | if (!iter.next(&temp, &done)) { | ||||
| 24882 | return false; | ||||
| 24883 | } | ||||
| 24884 | if (done) { | ||||
| 24885 | break; | ||||
| 24886 | } | ||||
| 24887 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | ||||
| 24888 | if (!slotPtr) { | ||||
| 24889 | JS_ReportOutOfMemory(cx); | ||||
| 24890 | return false; | ||||
| 24891 | } | ||||
| 24892 | JSObject*& slot = *slotPtr; | ||||
| 24893 | if (temp.isObject()) { | ||||
| 24894 | #ifdef __clang__1 | ||||
| 24895 | #pragma clang diagnostic push | ||||
| 24896 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 24897 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 24898 | #endif // __clang__ | ||||
| 24899 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 24900 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 24901 | return false; | ||||
| 24902 | } | ||||
| 24903 | #ifdef __clang__1 | ||||
| 24904 | #pragma clang diagnostic pop | ||||
| 24905 | #endif // __clang__ | ||||
| 24906 | slot = &temp.toObject(); | ||||
| 24907 | } else { | ||||
| 24908 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 24909 | return false; | ||||
| 24910 | } | ||||
| 24911 | } | ||||
| 24912 | } else { | ||||
| 24913 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 24914 | return false; | ||||
| 24915 | } | ||||
| 24916 | if (objIsXray) { | ||||
| 24917 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 24918 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 24919 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 24920 | if (!unwrappedObj.ref()) { | ||||
| 24921 | return false; | ||||
| 24922 | } | ||||
| 24923 | } | ||||
| 24924 | FastErrorResult rv; | ||||
| 24925 | // NOTE: This assert does NOT call the function. | ||||
| 24926 | 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"); | ||||
| 24927 | MOZ_KnownLive(self)(self)->PassSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 24928 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject" )), 0))) { | ||||
| 24929 | return false; | ||||
| 24930 | } | ||||
| 24931 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 24931); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 24931; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 24932 | args.rval().setUndefined(); | ||||
| 24933 | return true; | ||||
| 24934 | } | ||||
| 24935 | |||||
| 24936 | static const JSJitInfo passSequenceOfObject_methodinfo = { | ||||
| 24937 | { (JSJitGetterOp)passSequenceOfObject }, | ||||
| 24938 | { prototypes::id::TestJSImplInterface }, | ||||
| 24939 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 24940 | JSJitInfo::Method, | ||||
| 24941 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 24942 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 24943 | false, /* isInfallible. False in setters. */ | ||||
| 24944 | false, /* isMovable. Not relevant for setters. */ | ||||
| 24945 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 24946 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 24947 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 24948 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 24949 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 24950 | }; | ||||
| 24951 | |||||
| 24952 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 24953 | passSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 24954 | { | ||||
| 24955 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableObject"); | ||||
| 24956 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24959( cx, "TestJSImplInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24957 | "TestJSImplInterface", "passSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24959( cx, "TestJSImplInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24958 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24959( cx, "TestJSImplInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 24959 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24959( cx, "TestJSImplInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 24960 | |||||
| 24961 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 24962 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableObject", 1)) { | ||||
| 24963 | return false; | ||||
| 24964 | } | ||||
| 24965 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 24966 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 24967 | if (objIsXray) { | ||||
| 24968 | unwrappedObj.emplace(cx, obj); | ||||
| 24969 | } | ||||
| 24970 | binding_detail::AutoSequence<JSObject*> arg0; | ||||
| 24971 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | ||||
| 24972 | if (args[0].isObject()) { | ||||
| 24973 | JS::ForOfIterator iter(cx); | ||||
| 24974 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 24975 | return false; | ||||
| 24976 | } | ||||
| 24977 | if (!iter.valueIsIterable()) { | ||||
| 24978 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 24979 | return false; | ||||
| 24980 | } | ||||
| 24981 | binding_detail::AutoSequence<JSObject*> &arr = arg0; | ||||
| 24982 | JS::Rooted<JS::Value> temp(cx); | ||||
| 24983 | while (true) { | ||||
| 24984 | bool done; | ||||
| 24985 | if (!iter.next(&temp, &done)) { | ||||
| 24986 | return false; | ||||
| 24987 | } | ||||
| 24988 | if (done) { | ||||
| 24989 | break; | ||||
| 24990 | } | ||||
| 24991 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | ||||
| 24992 | if (!slotPtr) { | ||||
| 24993 | JS_ReportOutOfMemory(cx); | ||||
| 24994 | return false; | ||||
| 24995 | } | ||||
| 24996 | JSObject*& slot = *slotPtr; | ||||
| 24997 | if (temp.isObject()) { | ||||
| 24998 | #ifdef __clang__1 | ||||
| 24999 | #pragma clang diagnostic push | ||||
| 25000 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 25001 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 25002 | #endif // __clang__ | ||||
| 25003 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 25004 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 25005 | return false; | ||||
| 25006 | } | ||||
| 25007 | #ifdef __clang__1 | ||||
| 25008 | #pragma clang diagnostic pop | ||||
| 25009 | #endif // __clang__ | ||||
| 25010 | slot = &temp.toObject(); | ||||
| 25011 | } else if (temp.isNullOrUndefined()) { | ||||
| 25012 | slot = nullptr; | ||||
| 25013 | } else { | ||||
| 25014 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 25015 | return false; | ||||
| 25016 | } | ||||
| 25017 | } | ||||
| 25018 | } else { | ||||
| 25019 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25020 | return false; | ||||
| 25021 | } | ||||
| 25022 | if (objIsXray) { | ||||
| 25023 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25024 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25025 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25026 | if (!unwrappedObj.ref()) { | ||||
| 25027 | return false; | ||||
| 25028 | } | ||||
| 25029 | } | ||||
| 25030 | FastErrorResult rv; | ||||
| 25031 | // NOTE: This assert does NOT call the function. | ||||
| 25032 | 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"); | ||||
| 25033 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25034 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject" )), 0))) { | ||||
| 25035 | return false; | ||||
| 25036 | } | ||||
| 25037 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25037; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25038 | args.rval().setUndefined(); | ||||
| 25039 | return true; | ||||
| 25040 | } | ||||
| 25041 | |||||
| 25042 | static const JSJitInfo passSequenceOfNullableObject_methodinfo = { | ||||
| 25043 | { (JSJitGetterOp)passSequenceOfNullableObject }, | ||||
| 25044 | { prototypes::id::TestJSImplInterface }, | ||||
| 25045 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25046 | JSJitInfo::Method, | ||||
| 25047 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25048 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25049 | false, /* isInfallible. False in setters. */ | ||||
| 25050 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25051 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25052 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25053 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25054 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25055 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25056 | }; | ||||
| 25057 | |||||
| 25058 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25059 | passNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25060 | { | ||||
| 25061 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfObject"); | ||||
| 25062 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25065( cx, "TestJSImplInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 25063 | "TestJSImplInterface", "passNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25065( cx, "TestJSImplInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 25064 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25065( cx, "TestJSImplInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 25065 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25065( cx, "TestJSImplInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 25066 | |||||
| 25067 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25068 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfObject", 1)) { | ||||
| 25069 | return false; | ||||
| 25070 | } | ||||
| 25071 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25072 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25073 | if (objIsXray) { | ||||
| 25074 | unwrappedObj.emplace(cx, obj); | ||||
| 25075 | } | ||||
| 25076 | Nullable<Sequence<JSObject*>> arg0; | ||||
| 25077 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0.SetValue()); | ||||
| 25078 | if (args[0].isObject()) { | ||||
| 25079 | JS::ForOfIterator iter(cx); | ||||
| 25080 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 25081 | return false; | ||||
| 25082 | } | ||||
| 25083 | if (!iter.valueIsIterable()) { | ||||
| 25084 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25085 | return false; | ||||
| 25086 | } | ||||
| 25087 | Sequence<JSObject*> &arr = arg0.SetValue(); | ||||
| 25088 | JS::Rooted<JS::Value> temp(cx); | ||||
| 25089 | while (true) { | ||||
| 25090 | bool done; | ||||
| 25091 | if (!iter.next(&temp, &done)) { | ||||
| 25092 | return false; | ||||
| 25093 | } | ||||
| 25094 | if (done) { | ||||
| 25095 | break; | ||||
| 25096 | } | ||||
| 25097 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | ||||
| 25098 | if (!slotPtr) { | ||||
| 25099 | JS_ReportOutOfMemory(cx); | ||||
| 25100 | return false; | ||||
| 25101 | } | ||||
| 25102 | JSObject*& slot = *slotPtr; | ||||
| 25103 | if (temp.isObject()) { | ||||
| 25104 | #ifdef __clang__1 | ||||
| 25105 | #pragma clang diagnostic push | ||||
| 25106 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 25107 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 25108 | #endif // __clang__ | ||||
| 25109 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 25110 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1"); | ||||
| 25111 | return false; | ||||
| 25112 | } | ||||
| 25113 | #ifdef __clang__1 | ||||
| 25114 | #pragma clang diagnostic pop | ||||
| 25115 | #endif // __clang__ | ||||
| 25116 | slot = &temp.toObject(); | ||||
| 25117 | } else { | ||||
| 25118 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | ||||
| 25119 | return false; | ||||
| 25120 | } | ||||
| 25121 | } | ||||
| 25122 | } else if (args[0].isNullOrUndefined()) { | ||||
| 25123 | arg0.SetNull(); | ||||
| 25124 | } else { | ||||
| 25125 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25126 | return false; | ||||
| 25127 | } | ||||
| 25128 | if (objIsXray) { | ||||
| 25129 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25130 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25131 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25132 | if (!unwrappedObj.ref()) { | ||||
| 25133 | return false; | ||||
| 25134 | } | ||||
| 25135 | } | ||||
| 25136 | FastErrorResult rv; | ||||
| 25137 | // NOTE: This assert does NOT call the function. | ||||
| 25138 | 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"); | ||||
| 25139 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25140 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject" )), 0))) { | ||||
| 25141 | return false; | ||||
| 25142 | } | ||||
| 25143 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25143); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25143; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25144 | args.rval().setUndefined(); | ||||
| 25145 | return true; | ||||
| 25146 | } | ||||
| 25147 | |||||
| 25148 | static const JSJitInfo passNullableSequenceOfObject_methodinfo = { | ||||
| 25149 | { (JSJitGetterOp)passNullableSequenceOfObject }, | ||||
| 25150 | { prototypes::id::TestJSImplInterface }, | ||||
| 25151 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25152 | JSJitInfo::Method, | ||||
| 25153 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25154 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25155 | false, /* isInfallible. False in setters. */ | ||||
| 25156 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25157 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25158 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25159 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25160 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25161 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25162 | }; | ||||
| 25163 | |||||
| 25164 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25165 | passOptionalNullableSequenceOfNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25166 | { | ||||
| 25167 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"); | ||||
| 25168 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25171( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25169 | "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25171( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25170 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25171( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25171 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25171( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 25172 | |||||
| 25173 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25174 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25175 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25176 | if (objIsXray) { | ||||
| 25177 | unwrappedObj.emplace(cx, obj); | ||||
| 25178 | } | ||||
| 25179 | Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0; | ||||
| 25180 | Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder; | ||||
| 25181 | if (args.hasDefined(0)) { | ||||
| 25182 | arg0.Construct(); | ||||
| 25183 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 25184 | if (args[0].isObject()) { | ||||
| 25185 | JS::ForOfIterator iter(cx); | ||||
| 25186 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 25187 | return false; | ||||
| 25188 | } | ||||
| 25189 | if (!iter.valueIsIterable()) { | ||||
| 25190 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25191 | return false; | ||||
| 25192 | } | ||||
| 25193 | Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue(); | ||||
| 25194 | JS::Rooted<JS::Value> temp(cx); | ||||
| 25195 | while (true) { | ||||
| 25196 | bool done; | ||||
| 25197 | if (!iter.next(&temp, &done)) { | ||||
| 25198 | return false; | ||||
| 25199 | } | ||||
| 25200 | if (done) { | ||||
| 25201 | break; | ||||
| 25202 | } | ||||
| 25203 | Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 25204 | if (!slotPtr) { | ||||
| 25205 | JS_ReportOutOfMemory(cx); | ||||
| 25206 | return false; | ||||
| 25207 | } | ||||
| 25208 | Nullable<Sequence<JSObject*>>& slot = *slotPtr; | ||||
| 25209 | if (temp.isObject()) { | ||||
| 25210 | JS::ForOfIterator iter1(cx); | ||||
| 25211 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 25212 | return false; | ||||
| 25213 | } | ||||
| 25214 | if (!iter1.valueIsIterable()) { | ||||
| 25215 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 25216 | return false; | ||||
| 25217 | } | ||||
| 25218 | Sequence<JSObject*> &arr1 = slot.SetValue(); | ||||
| 25219 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 25220 | while (true) { | ||||
| 25221 | bool done1; | ||||
| 25222 | if (!iter1.next(&temp1, &done1)) { | ||||
| 25223 | return false; | ||||
| 25224 | } | ||||
| 25225 | if (done1) { | ||||
| 25226 | break; | ||||
| 25227 | } | ||||
| 25228 | JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible); | ||||
| 25229 | if (!slotPtr1) { | ||||
| 25230 | JS_ReportOutOfMemory(cx); | ||||
| 25231 | return false; | ||||
| 25232 | } | ||||
| 25233 | JSObject*& slot1 = *slotPtr1; | ||||
| 25234 | if (temp1.isObject()) { | ||||
| 25235 | #ifdef __clang__1 | ||||
| 25236 | #pragma clang diagnostic push | ||||
| 25237 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 25238 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 25239 | #endif // __clang__ | ||||
| 25240 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 25241 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 25242 | return false; | ||||
| 25243 | } | ||||
| 25244 | #ifdef __clang__1 | ||||
| 25245 | #pragma clang diagnostic pop | ||||
| 25246 | #endif // __clang__ | ||||
| 25247 | slot1 = &temp1.toObject(); | ||||
| 25248 | } else { | ||||
| 25249 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1"); | ||||
| 25250 | return false; | ||||
| 25251 | } | ||||
| 25252 | } | ||||
| 25253 | } else if (temp.isNullOrUndefined()) { | ||||
| 25254 | slot.SetNull(); | ||||
| 25255 | } else { | ||||
| 25256 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 25257 | return false; | ||||
| 25258 | } | ||||
| 25259 | } | ||||
| 25260 | } else if (args[0].isNullOrUndefined()) { | ||||
| 25261 | arg0.Value().SetNull(); | ||||
| 25262 | } else { | ||||
| 25263 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25264 | return false; | ||||
| 25265 | } | ||||
| 25266 | } | ||||
| 25267 | if (objIsXray) { | ||||
| 25268 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25269 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25270 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25271 | if (!unwrappedObj.ref()) { | ||||
| 25272 | return false; | ||||
| 25273 | } | ||||
| 25274 | } | ||||
| 25275 | FastErrorResult rv; | ||||
| 25276 | // NOTE: This assert does NOT call the function. | ||||
| 25277 | 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"); | ||||
| 25278 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25279 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject" )), 0))) { | ||||
| 25280 | return false; | ||||
| 25281 | } | ||||
| 25282 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25282); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25282; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25283 | args.rval().setUndefined(); | ||||
| 25284 | return true; | ||||
| 25285 | } | ||||
| 25286 | |||||
| 25287 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo = { | ||||
| 25288 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfObject }, | ||||
| 25289 | { prototypes::id::TestJSImplInterface }, | ||||
| 25290 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25291 | JSJitInfo::Method, | ||||
| 25292 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25293 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25294 | false, /* isInfallible. False in setters. */ | ||||
| 25295 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25296 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25297 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25298 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25299 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25300 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25301 | }; | ||||
| 25302 | |||||
| 25303 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25304 | passOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25305 | { | ||||
| 25306 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"); | ||||
| 25307 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25310( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25308 | "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25310( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25309 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25310( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25310 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25310( cx, "TestJSImplInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 25311 | |||||
| 25312 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25313 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25314 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25315 | if (objIsXray) { | ||||
| 25316 | unwrappedObj.emplace(cx, obj); | ||||
| 25317 | } | ||||
| 25318 | Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0; | ||||
| 25319 | Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder; | ||||
| 25320 | if (args.hasDefined(0)) { | ||||
| 25321 | arg0.Construct(); | ||||
| 25322 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | ||||
| 25323 | if (args[0].isObject()) { | ||||
| 25324 | JS::ForOfIterator iter(cx); | ||||
| 25325 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 25326 | return false; | ||||
| 25327 | } | ||||
| 25328 | if (!iter.valueIsIterable()) { | ||||
| 25329 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25330 | return false; | ||||
| 25331 | } | ||||
| 25332 | Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue(); | ||||
| 25333 | JS::Rooted<JS::Value> temp(cx); | ||||
| 25334 | while (true) { | ||||
| 25335 | bool done; | ||||
| 25336 | if (!iter.next(&temp, &done)) { | ||||
| 25337 | return false; | ||||
| 25338 | } | ||||
| 25339 | if (done) { | ||||
| 25340 | break; | ||||
| 25341 | } | ||||
| 25342 | Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 25343 | if (!slotPtr) { | ||||
| 25344 | JS_ReportOutOfMemory(cx); | ||||
| 25345 | return false; | ||||
| 25346 | } | ||||
| 25347 | Nullable<Sequence<JSObject*>>& slot = *slotPtr; | ||||
| 25348 | if (temp.isObject()) { | ||||
| 25349 | JS::ForOfIterator iter1(cx); | ||||
| 25350 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 25351 | return false; | ||||
| 25352 | } | ||||
| 25353 | if (!iter1.valueIsIterable()) { | ||||
| 25354 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 25355 | return false; | ||||
| 25356 | } | ||||
| 25357 | Sequence<JSObject*> &arr1 = slot.SetValue(); | ||||
| 25358 | JS::Rooted<JS::Value> temp1(cx); | ||||
| 25359 | while (true) { | ||||
| 25360 | bool done1; | ||||
| 25361 | if (!iter1.next(&temp1, &done1)) { | ||||
| 25362 | return false; | ||||
| 25363 | } | ||||
| 25364 | if (done1) { | ||||
| 25365 | break; | ||||
| 25366 | } | ||||
| 25367 | JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible); | ||||
| 25368 | if (!slotPtr1) { | ||||
| 25369 | JS_ReportOutOfMemory(cx); | ||||
| 25370 | return false; | ||||
| 25371 | } | ||||
| 25372 | JSObject*& slot1 = *slotPtr1; | ||||
| 25373 | if (temp1.isObject()) { | ||||
| 25374 | #ifdef __clang__1 | ||||
| 25375 | #pragma clang diagnostic push | ||||
| 25376 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 25377 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 25378 | #endif // __clang__ | ||||
| 25379 | if ((true) && !CallerSubsumes(temp1)) { | ||||
| 25380 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1"); | ||||
| 25381 | return false; | ||||
| 25382 | } | ||||
| 25383 | #ifdef __clang__1 | ||||
| 25384 | #pragma clang diagnostic pop | ||||
| 25385 | #endif // __clang__ | ||||
| 25386 | slot1 = &temp1.toObject(); | ||||
| 25387 | } else if (temp1.isNullOrUndefined()) { | ||||
| 25388 | slot1 = nullptr; | ||||
| 25389 | } else { | ||||
| 25390 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1"); | ||||
| 25391 | return false; | ||||
| 25392 | } | ||||
| 25393 | } | ||||
| 25394 | } else if (temp.isNullOrUndefined()) { | ||||
| 25395 | slot.SetNull(); | ||||
| 25396 | } else { | ||||
| 25397 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | ||||
| 25398 | return false; | ||||
| 25399 | } | ||||
| 25400 | } | ||||
| 25401 | } else if (args[0].isNullOrUndefined()) { | ||||
| 25402 | arg0.Value().SetNull(); | ||||
| 25403 | } else { | ||||
| 25404 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 25405 | return false; | ||||
| 25406 | } | ||||
| 25407 | } | ||||
| 25408 | if (objIsXray) { | ||||
| 25409 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25410 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25411 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25412 | if (!unwrappedObj.ref()) { | ||||
| 25413 | return false; | ||||
| 25414 | } | ||||
| 25415 | } | ||||
| 25416 | FastErrorResult rv; | ||||
| 25417 | // NOTE: This assert does NOT call the function. | ||||
| 25418 | 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"); | ||||
| 25419 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25420 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject" )), 0))) { | ||||
| 25421 | return false; | ||||
| 25422 | } | ||||
| 25423 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25423); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25423; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25424 | args.rval().setUndefined(); | ||||
| 25425 | return true; | ||||
| 25426 | } | ||||
| 25427 | |||||
| 25428 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo = { | ||||
| 25429 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfNullableObject }, | ||||
| 25430 | { prototypes::id::TestJSImplInterface }, | ||||
| 25431 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25432 | JSJitInfo::Method, | ||||
| 25433 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25434 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25435 | false, /* isInfallible. False in setters. */ | ||||
| 25436 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25437 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25438 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25439 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25440 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25441 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25442 | }; | ||||
| 25443 | |||||
| 25444 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25445 | passRecordOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25446 | { | ||||
| 25447 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfObject"); | ||||
| 25448 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25451( cx, "TestJSImplInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25449 | "TestJSImplInterface", "passRecordOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25451( cx, "TestJSImplInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25450 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25451( cx, "TestJSImplInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25451 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25451( cx, "TestJSImplInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25452 | |||||
| 25453 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25454 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfObject", 1)) { | ||||
| 25455 | return false; | ||||
| 25456 | } | ||||
| 25457 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25458 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25459 | if (objIsXray) { | ||||
| 25460 | unwrappedObj.emplace(cx, obj); | ||||
| 25461 | } | ||||
| 25462 | Record<nsString, JSObject*> arg0; | ||||
| 25463 | RecordRooter<nsString, JSObject*> arg0_holder(cx, &arg0); | ||||
| 25464 | if (args[0].isObject()) { | ||||
| 25465 | auto& recordEntries = arg0.Entries(); | ||||
| 25466 | |||||
| 25467 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 25468 | JS::RootedVector<jsid> ids(cx); | ||||
| 25469 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 25470 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 25471 | return false; | ||||
| 25472 | } | ||||
| 25473 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 25474 | JS_ReportOutOfMemory(cx); | ||||
| 25475 | return false; | ||||
| 25476 | } | ||||
| 25477 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 25478 | JS::Rooted<JS::Value> temp(cx); | ||||
| 25479 | JS::Rooted<jsid> curId(cx); | ||||
| 25480 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 25481 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 25482 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 25483 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 25484 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 25485 | // around. | ||||
| 25486 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 25487 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 25488 | curId = ids[i]; | ||||
| 25489 | |||||
| 25490 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 25491 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 25492 | &desc)) { | ||||
| 25493 | return false; | ||||
| 25494 | } | ||||
| 25495 | |||||
| 25496 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 25497 | continue; | ||||
| 25498 | } | ||||
| 25499 | |||||
| 25500 | idVal = js::IdToValue(curId); | ||||
| 25501 | nsString propName; | ||||
| 25502 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 25503 | // to do. | ||||
| 25504 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 25505 | return false; | ||||
| 25506 | } | ||||
| 25507 | |||||
| 25508 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 25509 | return false; | ||||
| 25510 | } | ||||
| 25511 | |||||
| 25512 | Record<nsString, JSObject*>::EntryType* entry; | ||||
| 25513 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 25514 | // Find the existing entry. | ||||
| 25515 | auto idx = recordEntries.IndexOf(propName); | ||||
| 25516 | 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", 25517); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 25517; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 25517 | "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", 25517); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 25517; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 25518 | // Now blow it away to make it look like it was just added | ||||
| 25519 | // to the array, because it's not obvious that it's | ||||
| 25520 | // safe to write to its already-initialized mValue via our | ||||
| 25521 | // normal codegen conversions. For example, the value | ||||
| 25522 | // could be a union and this would change its type, but | ||||
| 25523 | // codegen assumes we won't do that. | ||||
| 25524 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 25525 | } else { | ||||
| 25526 | // Safe to do an infallible append here, because we did a | ||||
| 25527 | // SetCapacity above to the right capacity. | ||||
| 25528 | entry = recordEntries.AppendElement(); | ||||
| 25529 | } | ||||
| 25530 | entry->mKey = propName; | ||||
| 25531 | JSObject*& slot = entry->mValue; | ||||
| 25532 | if (temp.isObject()) { | ||||
| 25533 | #ifdef __clang__1 | ||||
| 25534 | #pragma clang diagnostic push | ||||
| 25535 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 25536 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 25537 | #endif // __clang__ | ||||
| 25538 | if ((true) && !CallerSubsumes(temp)) { | ||||
| 25539 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1"); | ||||
| 25540 | return false; | ||||
| 25541 | } | ||||
| 25542 | #ifdef __clang__1 | ||||
| 25543 | #pragma clang diagnostic pop | ||||
| 25544 | #endif // __clang__ | ||||
| 25545 | slot = &temp.toObject(); | ||||
| 25546 | } else { | ||||
| 25547 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | ||||
| 25548 | return false; | ||||
| 25549 | } | ||||
| 25550 | } | ||||
| 25551 | } else { | ||||
| 25552 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 25553 | return false; | ||||
| 25554 | } | ||||
| 25555 | if (objIsXray) { | ||||
| 25556 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25557 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25558 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25559 | if (!unwrappedObj.ref()) { | ||||
| 25560 | return false; | ||||
| 25561 | } | ||||
| 25562 | } | ||||
| 25563 | FastErrorResult rv; | ||||
| 25564 | // NOTE: This assert does NOT call the function. | ||||
| 25565 | 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"); | ||||
| 25566 | MOZ_KnownLive(self)(self)->PassRecordOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25567 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject" )), 0))) { | ||||
| 25568 | return false; | ||||
| 25569 | } | ||||
| 25570 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25570); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25570; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25571 | args.rval().setUndefined(); | ||||
| 25572 | return true; | ||||
| 25573 | } | ||||
| 25574 | |||||
| 25575 | static const JSJitInfo passRecordOfObject_methodinfo = { | ||||
| 25576 | { (JSJitGetterOp)passRecordOfObject }, | ||||
| 25577 | { prototypes::id::TestJSImplInterface }, | ||||
| 25578 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25579 | JSJitInfo::Method, | ||||
| 25580 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25581 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25582 | false, /* isInfallible. False in setters. */ | ||||
| 25583 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25584 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25585 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25586 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25587 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25588 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25589 | }; | ||||
| 25590 | |||||
| 25591 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25592 | receiveObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25593 | { | ||||
| 25594 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25597( cx, "TestJSImplInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25595 | "TestJSImplInterface", "receiveObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25597( cx, "TestJSImplInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25596 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25597( cx, "TestJSImplInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25597 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25597( cx, "TestJSImplInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25598 | |||||
| 25599 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25600 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25601 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25602 | if (objIsXray) { | ||||
| 25603 | unwrappedObj.emplace(cx, obj); | ||||
| 25604 | } | ||||
| 25605 | if (objIsXray) { | ||||
| 25606 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25607 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25608 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25609 | if (!unwrappedObj.ref()) { | ||||
| 25610 | return false; | ||||
| 25611 | } | ||||
| 25612 | } | ||||
| 25613 | FastErrorResult rv; | ||||
| 25614 | JS::Rooted<JSObject*> result(cx); | ||||
| 25615 | // NOTE: This assert does NOT call the function. | ||||
| 25616 | 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"); | ||||
| 25617 | MOZ_KnownLive(self)(self)->ReceiveObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25618 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject" )), 0))) { | ||||
| 25619 | return false; | ||||
| 25620 | } | ||||
| 25621 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25621); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25621; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25622 | JS::ExposeObjectToActiveJS(result); | ||||
| 25623 | args.rval().setObject(*result); | ||||
| 25624 | if (!MaybeWrapObjectValue(cx, args.rval())) { | ||||
| 25625 | return false; | ||||
| 25626 | } | ||||
| 25627 | return true; | ||||
| 25628 | } | ||||
| 25629 | |||||
| 25630 | static const JSJitInfo receiveObject_methodinfo = { | ||||
| 25631 | { (JSJitGetterOp)receiveObject }, | ||||
| 25632 | { prototypes::id::TestJSImplInterface }, | ||||
| 25633 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25634 | JSJitInfo::Method, | ||||
| 25635 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25636 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 25637 | false, /* isInfallible. False in setters. */ | ||||
| 25638 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25639 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25640 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25641 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25642 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25643 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25644 | }; | ||||
| 25645 | |||||
| 25646 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25647 | receiveNullableObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25648 | { | ||||
| 25649 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25652( cx, "TestJSImplInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25650 | "TestJSImplInterface", "receiveNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25652( cx, "TestJSImplInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25651 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25652( cx, "TestJSImplInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25652 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25652( cx, "TestJSImplInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25653 | |||||
| 25654 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25655 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25656 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25657 | if (objIsXray) { | ||||
| 25658 | unwrappedObj.emplace(cx, obj); | ||||
| 25659 | } | ||||
| 25660 | if (objIsXray) { | ||||
| 25661 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25662 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25663 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25664 | if (!unwrappedObj.ref()) { | ||||
| 25665 | return false; | ||||
| 25666 | } | ||||
| 25667 | } | ||||
| 25668 | FastErrorResult rv; | ||||
| 25669 | JS::Rooted<JSObject*> result(cx); | ||||
| 25670 | // NOTE: This assert does NOT call the function. | ||||
| 25671 | 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"); | ||||
| 25672 | MOZ_KnownLive(self)(self)->ReceiveNullableObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25673 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject" )), 0))) { | ||||
| 25674 | return false; | ||||
| 25675 | } | ||||
| 25676 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25676); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25676; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25677 | if (result) { | ||||
| 25678 | JS::ExposeObjectToActiveJS(result); | ||||
| 25679 | } | ||||
| 25680 | args.rval().setObjectOrNull(result); | ||||
| 25681 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | ||||
| 25682 | return false; | ||||
| 25683 | } | ||||
| 25684 | return true; | ||||
| 25685 | } | ||||
| 25686 | |||||
| 25687 | static const JSJitInfo receiveNullableObject_methodinfo = { | ||||
| 25688 | { (JSJitGetterOp)receiveNullableObject }, | ||||
| 25689 | { prototypes::id::TestJSImplInterface }, | ||||
| 25690 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25691 | JSJitInfo::Method, | ||||
| 25692 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25693 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 25694 | false, /* isInfallible. False in setters. */ | ||||
| 25695 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25696 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25697 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25698 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25699 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25700 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25701 | }; | ||||
| 25702 | |||||
| 25703 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25704 | passUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25705 | { | ||||
| 25706 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion"); | ||||
| 25707 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25710( cx, "TestJSImplInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25708 | "TestJSImplInterface", "passUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25710( cx, "TestJSImplInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25709 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25710( cx, "TestJSImplInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 25710 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25710( cx, "TestJSImplInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 25711 | |||||
| 25712 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25713 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion", 1)) { | ||||
| 25714 | return false; | ||||
| 25715 | } | ||||
| 25716 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25717 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25718 | if (objIsXray) { | ||||
| 25719 | unwrappedObj.emplace(cx, obj); | ||||
| 25720 | } | ||||
| 25721 | ObjectOrLong arg0; | ||||
| 25722 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 25723 | return false; | ||||
| 25724 | } | ||||
| 25725 | if (objIsXray) { | ||||
| 25726 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25727 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25728 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25729 | if (!unwrappedObj.ref()) { | ||||
| 25730 | return false; | ||||
| 25731 | } | ||||
| 25732 | } | ||||
| 25733 | FastErrorResult rv; | ||||
| 25734 | // NOTE: This assert does NOT call the function. | ||||
| 25735 | 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"); | ||||
| 25736 | MOZ_KnownLive(self)(self)->PassUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25737 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion" )), 0))) { | ||||
| 25738 | return false; | ||||
| 25739 | } | ||||
| 25740 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25740); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25740; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25741 | args.rval().setUndefined(); | ||||
| 25742 | return true; | ||||
| 25743 | } | ||||
| 25744 | |||||
| 25745 | static const JSJitInfo passUnion_methodinfo = { | ||||
| 25746 | { (JSJitGetterOp)passUnion }, | ||||
| 25747 | { prototypes::id::TestJSImplInterface }, | ||||
| 25748 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25749 | JSJitInfo::Method, | ||||
| 25750 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25751 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25752 | false, /* isInfallible. False in setters. */ | ||||
| 25753 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25754 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25755 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25756 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25757 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25758 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25759 | }; | ||||
| 25760 | |||||
| 25761 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25762 | passUnion2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25763 | { | ||||
| 25764 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion2"); | ||||
| 25765 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25768( cx, "TestJSImplInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25766 | "TestJSImplInterface", "passUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25768( cx, "TestJSImplInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25767 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25768( cx, "TestJSImplInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25768 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25768( cx, "TestJSImplInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25769 | |||||
| 25770 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25771 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion2", 1)) { | ||||
| 25772 | return false; | ||||
| 25773 | } | ||||
| 25774 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25775 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25776 | if (objIsXray) { | ||||
| 25777 | unwrappedObj.emplace(cx, obj); | ||||
| 25778 | } | ||||
| 25779 | LongOrBoolean arg0; | ||||
| 25780 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 25781 | return false; | ||||
| 25782 | } | ||||
| 25783 | if (objIsXray) { | ||||
| 25784 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25785 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25786 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25787 | if (!unwrappedObj.ref()) { | ||||
| 25788 | return false; | ||||
| 25789 | } | ||||
| 25790 | } | ||||
| 25791 | FastErrorResult rv; | ||||
| 25792 | // NOTE: This assert does NOT call the function. | ||||
| 25793 | 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"); | ||||
| 25794 | MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25795 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2" )), 0))) { | ||||
| 25796 | return false; | ||||
| 25797 | } | ||||
| 25798 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25798); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25798; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25799 | args.rval().setUndefined(); | ||||
| 25800 | return true; | ||||
| 25801 | } | ||||
| 25802 | |||||
| 25803 | static const JSJitInfo passUnion2_methodinfo = { | ||||
| 25804 | { (JSJitGetterOp)passUnion2 }, | ||||
| 25805 | { prototypes::id::TestJSImplInterface }, | ||||
| 25806 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25807 | JSJitInfo::Method, | ||||
| 25808 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25809 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25810 | false, /* isInfallible. False in setters. */ | ||||
| 25811 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25812 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25813 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25814 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25815 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25816 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25817 | }; | ||||
| 25818 | |||||
| 25819 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25820 | passUnion3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25821 | { | ||||
| 25822 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion3"); | ||||
| 25823 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25826( cx, "TestJSImplInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25824 | "TestJSImplInterface", "passUnion3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25826( cx, "TestJSImplInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25825 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25826( cx, "TestJSImplInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25826 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25826( cx, "TestJSImplInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25827 | |||||
| 25828 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25829 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion3", 1)) { | ||||
| 25830 | return false; | ||||
| 25831 | } | ||||
| 25832 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25833 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25834 | if (objIsXray) { | ||||
| 25835 | unwrappedObj.emplace(cx, obj); | ||||
| 25836 | } | ||||
| 25837 | ObjectOrLongOrBoolean arg0; | ||||
| 25838 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 25839 | return false; | ||||
| 25840 | } | ||||
| 25841 | if (objIsXray) { | ||||
| 25842 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25843 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25844 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25845 | if (!unwrappedObj.ref()) { | ||||
| 25846 | return false; | ||||
| 25847 | } | ||||
| 25848 | } | ||||
| 25849 | FastErrorResult rv; | ||||
| 25850 | // NOTE: This assert does NOT call the function. | ||||
| 25851 | 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"); | ||||
| 25852 | MOZ_KnownLive(self)(self)->PassUnion3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25853 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3" )), 0))) { | ||||
| 25854 | return false; | ||||
| 25855 | } | ||||
| 25856 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25856); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25856; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25857 | args.rval().setUndefined(); | ||||
| 25858 | return true; | ||||
| 25859 | } | ||||
| 25860 | |||||
| 25861 | static const JSJitInfo passUnion3_methodinfo = { | ||||
| 25862 | { (JSJitGetterOp)passUnion3 }, | ||||
| 25863 | { prototypes::id::TestJSImplInterface }, | ||||
| 25864 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25865 | JSJitInfo::Method, | ||||
| 25866 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25867 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25868 | false, /* isInfallible. False in setters. */ | ||||
| 25869 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25870 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25871 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25872 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25873 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25874 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25875 | }; | ||||
| 25876 | |||||
| 25877 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25878 | passUnion4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25879 | { | ||||
| 25880 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion4"); | ||||
| 25881 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25884( cx, "TestJSImplInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25882 | "TestJSImplInterface", "passUnion4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25884( cx, "TestJSImplInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25883 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25884( cx, "TestJSImplInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25884 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25884( cx, "TestJSImplInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25885 | |||||
| 25886 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25887 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion4", 1)) { | ||||
| 25888 | return false; | ||||
| 25889 | } | ||||
| 25890 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25891 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25892 | if (objIsXray) { | ||||
| 25893 | unwrappedObj.emplace(cx, obj); | ||||
| 25894 | } | ||||
| 25895 | NodeOrLongOrBoolean arg0; | ||||
| 25896 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 25897 | return false; | ||||
| 25898 | } | ||||
| 25899 | if (objIsXray) { | ||||
| 25900 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25901 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25902 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25903 | if (!unwrappedObj.ref()) { | ||||
| 25904 | return false; | ||||
| 25905 | } | ||||
| 25906 | } | ||||
| 25907 | FastErrorResult rv; | ||||
| 25908 | // NOTE: This assert does NOT call the function. | ||||
| 25909 | 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"); | ||||
| 25910 | MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25911 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4" )), 0))) { | ||||
| 25912 | return false; | ||||
| 25913 | } | ||||
| 25914 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25914); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25914; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25915 | args.rval().setUndefined(); | ||||
| 25916 | return true; | ||||
| 25917 | } | ||||
| 25918 | |||||
| 25919 | static const JSJitInfo passUnion4_methodinfo = { | ||||
| 25920 | { (JSJitGetterOp)passUnion4 }, | ||||
| 25921 | { prototypes::id::TestJSImplInterface }, | ||||
| 25922 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25923 | JSJitInfo::Method, | ||||
| 25924 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25925 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25926 | false, /* isInfallible. False in setters. */ | ||||
| 25927 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25928 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25929 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25930 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25931 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25932 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25933 | }; | ||||
| 25934 | |||||
| 25935 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25936 | passUnion5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25937 | { | ||||
| 25938 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion5"); | ||||
| 25939 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25942( cx, "TestJSImplInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25940 | "TestJSImplInterface", "passUnion5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25942( cx, "TestJSImplInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25941 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25942( cx, "TestJSImplInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25942 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25942( cx, "TestJSImplInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 25943 | |||||
| 25944 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 25945 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion5", 1)) { | ||||
| 25946 | return false; | ||||
| 25947 | } | ||||
| 25948 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 25949 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 25950 | if (objIsXray) { | ||||
| 25951 | unwrappedObj.emplace(cx, obj); | ||||
| 25952 | } | ||||
| 25953 | ObjectOrBoolean arg0; | ||||
| 25954 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 25955 | return false; | ||||
| 25956 | } | ||||
| 25957 | if (objIsXray) { | ||||
| 25958 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 25959 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 25960 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 25961 | if (!unwrappedObj.ref()) { | ||||
| 25962 | return false; | ||||
| 25963 | } | ||||
| 25964 | } | ||||
| 25965 | FastErrorResult rv; | ||||
| 25966 | // NOTE: This assert does NOT call the function. | ||||
| 25967 | 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"); | ||||
| 25968 | MOZ_KnownLive(self)(self)->PassUnion5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 25969 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5" )), 0))) { | ||||
| 25970 | return false; | ||||
| 25971 | } | ||||
| 25972 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 25972); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 25972; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 25973 | args.rval().setUndefined(); | ||||
| 25974 | return true; | ||||
| 25975 | } | ||||
| 25976 | |||||
| 25977 | static const JSJitInfo passUnion5_methodinfo = { | ||||
| 25978 | { (JSJitGetterOp)passUnion5 }, | ||||
| 25979 | { prototypes::id::TestJSImplInterface }, | ||||
| 25980 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 25981 | JSJitInfo::Method, | ||||
| 25982 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 25983 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 25984 | false, /* isInfallible. False in setters. */ | ||||
| 25985 | false, /* isMovable. Not relevant for setters. */ | ||||
| 25986 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 25987 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 25988 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 25989 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 25990 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 25991 | }; | ||||
| 25992 | |||||
| 25993 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 25994 | passUnion6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 25995 | { | ||||
| 25996 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion6"); | ||||
| 25997 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26000( cx, "TestJSImplInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25998 | "TestJSImplInterface", "passUnion6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26000( cx, "TestJSImplInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 25999 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26000( cx, "TestJSImplInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26000 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26000( cx, "TestJSImplInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26001 | |||||
| 26002 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26003 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion6", 1)) { | ||||
| 26004 | return false; | ||||
| 26005 | } | ||||
| 26006 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26007 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26008 | if (objIsXray) { | ||||
| 26009 | unwrappedObj.emplace(cx, obj); | ||||
| 26010 | } | ||||
| 26011 | ObjectOrString arg0; | ||||
| 26012 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26013 | return false; | ||||
| 26014 | } | ||||
| 26015 | if (objIsXray) { | ||||
| 26016 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26017 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26018 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26019 | if (!unwrappedObj.ref()) { | ||||
| 26020 | return false; | ||||
| 26021 | } | ||||
| 26022 | } | ||||
| 26023 | FastErrorResult rv; | ||||
| 26024 | // NOTE: This assert does NOT call the function. | ||||
| 26025 | 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"); | ||||
| 26026 | MOZ_KnownLive(self)(self)->PassUnion6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26027 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6" )), 0))) { | ||||
| 26028 | return false; | ||||
| 26029 | } | ||||
| 26030 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26030); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26030; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26031 | args.rval().setUndefined(); | ||||
| 26032 | return true; | ||||
| 26033 | } | ||||
| 26034 | |||||
| 26035 | static const JSJitInfo passUnion6_methodinfo = { | ||||
| 26036 | { (JSJitGetterOp)passUnion6 }, | ||||
| 26037 | { prototypes::id::TestJSImplInterface }, | ||||
| 26038 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26039 | JSJitInfo::Method, | ||||
| 26040 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26041 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26042 | false, /* isInfallible. False in setters. */ | ||||
| 26043 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26044 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26045 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26046 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26047 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26048 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26049 | }; | ||||
| 26050 | |||||
| 26051 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26052 | passUnion7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26053 | { | ||||
| 26054 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion7"); | ||||
| 26055 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26058( cx, "TestJSImplInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26056 | "TestJSImplInterface", "passUnion7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26058( cx, "TestJSImplInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26057 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26058( cx, "TestJSImplInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26058 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26058( cx, "TestJSImplInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26059 | |||||
| 26060 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26061 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion7", 1)) { | ||||
| 26062 | return false; | ||||
| 26063 | } | ||||
| 26064 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26065 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26066 | if (objIsXray) { | ||||
| 26067 | unwrappedObj.emplace(cx, obj); | ||||
| 26068 | } | ||||
| 26069 | ObjectOrStringOrLong arg0; | ||||
| 26070 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26071 | return false; | ||||
| 26072 | } | ||||
| 26073 | if (objIsXray) { | ||||
| 26074 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26075 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26076 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26077 | if (!unwrappedObj.ref()) { | ||||
| 26078 | return false; | ||||
| 26079 | } | ||||
| 26080 | } | ||||
| 26081 | FastErrorResult rv; | ||||
| 26082 | // NOTE: This assert does NOT call the function. | ||||
| 26083 | 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"); | ||||
| 26084 | MOZ_KnownLive(self)(self)->PassUnion7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26085 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7" )), 0))) { | ||||
| 26086 | return false; | ||||
| 26087 | } | ||||
| 26088 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26088); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26088; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26089 | args.rval().setUndefined(); | ||||
| 26090 | return true; | ||||
| 26091 | } | ||||
| 26092 | |||||
| 26093 | static const JSJitInfo passUnion7_methodinfo = { | ||||
| 26094 | { (JSJitGetterOp)passUnion7 }, | ||||
| 26095 | { prototypes::id::TestJSImplInterface }, | ||||
| 26096 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26097 | JSJitInfo::Method, | ||||
| 26098 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26099 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26100 | false, /* isInfallible. False in setters. */ | ||||
| 26101 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26102 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26103 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26104 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26105 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26106 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26107 | }; | ||||
| 26108 | |||||
| 26109 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26110 | passUnion8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26111 | { | ||||
| 26112 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion8"); | ||||
| 26113 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26116( cx, "TestJSImplInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26114 | "TestJSImplInterface", "passUnion8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26116( cx, "TestJSImplInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26115 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26116( cx, "TestJSImplInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26116 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26116( cx, "TestJSImplInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26117 | |||||
| 26118 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26119 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion8", 1)) { | ||||
| 26120 | return false; | ||||
| 26121 | } | ||||
| 26122 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26123 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26124 | if (objIsXray) { | ||||
| 26125 | unwrappedObj.emplace(cx, obj); | ||||
| 26126 | } | ||||
| 26127 | ObjectOrStringOrBoolean arg0; | ||||
| 26128 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26129 | return false; | ||||
| 26130 | } | ||||
| 26131 | if (objIsXray) { | ||||
| 26132 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26133 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26134 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26135 | if (!unwrappedObj.ref()) { | ||||
| 26136 | return false; | ||||
| 26137 | } | ||||
| 26138 | } | ||||
| 26139 | FastErrorResult rv; | ||||
| 26140 | // NOTE: This assert does NOT call the function. | ||||
| 26141 | 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"); | ||||
| 26142 | MOZ_KnownLive(self)(self)->PassUnion8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26143 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8" )), 0))) { | ||||
| 26144 | return false; | ||||
| 26145 | } | ||||
| 26146 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26146); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26146; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26147 | args.rval().setUndefined(); | ||||
| 26148 | return true; | ||||
| 26149 | } | ||||
| 26150 | |||||
| 26151 | static const JSJitInfo passUnion8_methodinfo = { | ||||
| 26152 | { (JSJitGetterOp)passUnion8 }, | ||||
| 26153 | { prototypes::id::TestJSImplInterface }, | ||||
| 26154 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26155 | JSJitInfo::Method, | ||||
| 26156 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26157 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26158 | false, /* isInfallible. False in setters. */ | ||||
| 26159 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26160 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26161 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26162 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26163 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26164 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26165 | }; | ||||
| 26166 | |||||
| 26167 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26168 | passUnion9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26169 | { | ||||
| 26170 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion9"); | ||||
| 26171 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26174( cx, "TestJSImplInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26172 | "TestJSImplInterface", "passUnion9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26174( cx, "TestJSImplInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26173 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26174( cx, "TestJSImplInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26174 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26174( cx, "TestJSImplInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26175 | |||||
| 26176 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26177 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion9", 1)) { | ||||
| 26178 | return false; | ||||
| 26179 | } | ||||
| 26180 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26181 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26182 | if (objIsXray) { | ||||
| 26183 | unwrappedObj.emplace(cx, obj); | ||||
| 26184 | } | ||||
| 26185 | ObjectOrStringOrLongOrBoolean arg0; | ||||
| 26186 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26187 | return false; | ||||
| 26188 | } | ||||
| 26189 | if (objIsXray) { | ||||
| 26190 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26191 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26192 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26193 | if (!unwrappedObj.ref()) { | ||||
| 26194 | return false; | ||||
| 26195 | } | ||||
| 26196 | } | ||||
| 26197 | FastErrorResult rv; | ||||
| 26198 | // NOTE: This assert does NOT call the function. | ||||
| 26199 | 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"); | ||||
| 26200 | MOZ_KnownLive(self)(self)->PassUnion9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26201 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9" )), 0))) { | ||||
| 26202 | return false; | ||||
| 26203 | } | ||||
| 26204 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26204); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26204; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26205 | args.rval().setUndefined(); | ||||
| 26206 | return true; | ||||
| 26207 | } | ||||
| 26208 | |||||
| 26209 | static const JSJitInfo passUnion9_methodinfo = { | ||||
| 26210 | { (JSJitGetterOp)passUnion9 }, | ||||
| 26211 | { prototypes::id::TestJSImplInterface }, | ||||
| 26212 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26213 | JSJitInfo::Method, | ||||
| 26214 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26215 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26216 | false, /* isInfallible. False in setters. */ | ||||
| 26217 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26218 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26219 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26220 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26221 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26222 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26223 | }; | ||||
| 26224 | |||||
| 26225 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26226 | passUnion10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26227 | { | ||||
| 26228 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion10"); | ||||
| 26229 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26232( cx, "TestJSImplInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26230 | "TestJSImplInterface", "passUnion10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26232( cx, "TestJSImplInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26231 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26232( cx, "TestJSImplInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26232 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26232( cx, "TestJSImplInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26233 | |||||
| 26234 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26235 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26236 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26237 | if (objIsXray) { | ||||
| 26238 | unwrappedObj.emplace(cx, obj); | ||||
| 26239 | } | ||||
| 26240 | EventInitOrLong arg0; | ||||
| 26241 | if (!(args.hasDefined(0))) { | ||||
| 26242 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or long)")) { | ||||
| 26243 | return false; | ||||
| 26244 | } | ||||
| 26245 | } else { | ||||
| 26246 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26247 | return false; | ||||
| 26248 | } | ||||
| 26249 | } | ||||
| 26250 | if (objIsXray) { | ||||
| 26251 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26252 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26253 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26254 | if (!unwrappedObj.ref()) { | ||||
| 26255 | return false; | ||||
| 26256 | } | ||||
| 26257 | } | ||||
| 26258 | FastErrorResult rv; | ||||
| 26259 | // NOTE: This assert does NOT call the function. | ||||
| 26260 | 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"); | ||||
| 26261 | MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26262 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10" )), 0))) { | ||||
| 26263 | return false; | ||||
| 26264 | } | ||||
| 26265 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26265); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26265; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26266 | args.rval().setUndefined(); | ||||
| 26267 | return true; | ||||
| 26268 | } | ||||
| 26269 | |||||
| 26270 | static const JSJitInfo passUnion10_methodinfo = { | ||||
| 26271 | { (JSJitGetterOp)passUnion10 }, | ||||
| 26272 | { prototypes::id::TestJSImplInterface }, | ||||
| 26273 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26274 | JSJitInfo::Method, | ||||
| 26275 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26276 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26277 | false, /* isInfallible. False in setters. */ | ||||
| 26278 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26279 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26280 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26281 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26282 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26283 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26284 | }; | ||||
| 26285 | |||||
| 26286 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26287 | passUnion11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26288 | { | ||||
| 26289 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion11"); | ||||
| 26290 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26293( cx, "TestJSImplInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26291 | "TestJSImplInterface", "passUnion11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26293( cx, "TestJSImplInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26292 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26293( cx, "TestJSImplInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26293 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26293( cx, "TestJSImplInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26294 | |||||
| 26295 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26296 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26297 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26298 | if (objIsXray) { | ||||
| 26299 | unwrappedObj.emplace(cx, obj); | ||||
| 26300 | } | ||||
| 26301 | CustomEventInitOrLong arg0; | ||||
| 26302 | if (!(args.hasDefined(0))) { | ||||
| 26303 | if (!arg0.RawSetAsCustomEventInit(cx).Init(cx, JS::NullHandleValue, "Member of (CustomEventInit or long)")) { | ||||
| 26304 | return false; | ||||
| 26305 | } | ||||
| 26306 | } else { | ||||
| 26307 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26308 | return false; | ||||
| 26309 | } | ||||
| 26310 | } | ||||
| 26311 | if (objIsXray) { | ||||
| 26312 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26313 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26314 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26315 | if (!unwrappedObj.ref()) { | ||||
| 26316 | return false; | ||||
| 26317 | } | ||||
| 26318 | } | ||||
| 26319 | FastErrorResult rv; | ||||
| 26320 | // NOTE: This assert does NOT call the function. | ||||
| 26321 | 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"); | ||||
| 26322 | MOZ_KnownLive(self)(self)->PassUnion11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26323 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11" )), 0))) { | ||||
| 26324 | return false; | ||||
| 26325 | } | ||||
| 26326 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26326); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26326; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26327 | args.rval().setUndefined(); | ||||
| 26328 | return true; | ||||
| 26329 | } | ||||
| 26330 | |||||
| 26331 | static const JSJitInfo passUnion11_methodinfo = { | ||||
| 26332 | { (JSJitGetterOp)passUnion11 }, | ||||
| 26333 | { prototypes::id::TestJSImplInterface }, | ||||
| 26334 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26335 | JSJitInfo::Method, | ||||
| 26336 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26337 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26338 | false, /* isInfallible. False in setters. */ | ||||
| 26339 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26340 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26341 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26342 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26343 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26344 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26345 | }; | ||||
| 26346 | |||||
| 26347 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26348 | passUnion12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26349 | { | ||||
| 26350 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion12"); | ||||
| 26351 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26354( cx, "TestJSImplInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26352 | "TestJSImplInterface", "passUnion12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26354( cx, "TestJSImplInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26353 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26354( cx, "TestJSImplInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26354 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26354( cx, "TestJSImplInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26355 | |||||
| 26356 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26357 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26358 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26359 | if (objIsXray) { | ||||
| 26360 | unwrappedObj.emplace(cx, obj); | ||||
| 26361 | } | ||||
| 26362 | EventInitOrLong arg0; | ||||
| 26363 | if (!(args.hasDefined(0))) { | ||||
| 26364 | arg0.RawSetAsLong() = 5; | ||||
| 26365 | } else { | ||||
| 26366 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26367 | return false; | ||||
| 26368 | } | ||||
| 26369 | } | ||||
| 26370 | if (objIsXray) { | ||||
| 26371 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26372 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26373 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26374 | if (!unwrappedObj.ref()) { | ||||
| 26375 | return false; | ||||
| 26376 | } | ||||
| 26377 | } | ||||
| 26378 | FastErrorResult rv; | ||||
| 26379 | // NOTE: This assert does NOT call the function. | ||||
| 26380 | 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"); | ||||
| 26381 | MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26382 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12" )), 0))) { | ||||
| 26383 | return false; | ||||
| 26384 | } | ||||
| 26385 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26385); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26385; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26386 | args.rval().setUndefined(); | ||||
| 26387 | return true; | ||||
| 26388 | } | ||||
| 26389 | |||||
| 26390 | static const JSJitInfo passUnion12_methodinfo = { | ||||
| 26391 | { (JSJitGetterOp)passUnion12 }, | ||||
| 26392 | { prototypes::id::TestJSImplInterface }, | ||||
| 26393 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26394 | JSJitInfo::Method, | ||||
| 26395 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26396 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26397 | false, /* isInfallible. False in setters. */ | ||||
| 26398 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26399 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26400 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26401 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26402 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26403 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26404 | }; | ||||
| 26405 | |||||
| 26406 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26407 | passUnion13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26408 | { | ||||
| 26409 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion13"); | ||||
| 26410 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26413( cx, "TestJSImplInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26411 | "TestJSImplInterface", "passUnion13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26413( cx, "TestJSImplInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26412 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26413( cx, "TestJSImplInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26413 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26413( cx, "TestJSImplInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26414 | |||||
| 26415 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26416 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26417 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26418 | if (objIsXray) { | ||||
| 26419 | unwrappedObj.emplace(cx, obj); | ||||
| 26420 | } | ||||
| 26421 | ObjectOrLongOrNull arg0; | ||||
| 26422 | if (!(args.hasDefined(0))) { | ||||
| 26423 | arg0.SetNull(); | ||||
| 26424 | } else { | ||||
| 26425 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26426 | return false; | ||||
| 26427 | } | ||||
| 26428 | } | ||||
| 26429 | if (objIsXray) { | ||||
| 26430 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26431 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26432 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26433 | if (!unwrappedObj.ref()) { | ||||
| 26434 | return false; | ||||
| 26435 | } | ||||
| 26436 | } | ||||
| 26437 | FastErrorResult rv; | ||||
| 26438 | // NOTE: This assert does NOT call the function. | ||||
| 26439 | 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"); | ||||
| 26440 | MOZ_KnownLive(self)(self)->PassUnion13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26441 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13" )), 0))) { | ||||
| 26442 | return false; | ||||
| 26443 | } | ||||
| 26444 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26444); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26444; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26445 | args.rval().setUndefined(); | ||||
| 26446 | return true; | ||||
| 26447 | } | ||||
| 26448 | |||||
| 26449 | static const JSJitInfo passUnion13_methodinfo = { | ||||
| 26450 | { (JSJitGetterOp)passUnion13 }, | ||||
| 26451 | { prototypes::id::TestJSImplInterface }, | ||||
| 26452 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26453 | JSJitInfo::Method, | ||||
| 26454 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26455 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26456 | false, /* isInfallible. False in setters. */ | ||||
| 26457 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26458 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26459 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26460 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26461 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26462 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26463 | }; | ||||
| 26464 | |||||
| 26465 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26466 | passUnion14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26467 | { | ||||
| 26468 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion14"); | ||||
| 26469 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26472( cx, "TestJSImplInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26470 | "TestJSImplInterface", "passUnion14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26472( cx, "TestJSImplInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26471 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26472( cx, "TestJSImplInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26472 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26472( cx, "TestJSImplInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26473 | |||||
| 26474 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26475 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26476 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26477 | if (objIsXray) { | ||||
| 26478 | unwrappedObj.emplace(cx, obj); | ||||
| 26479 | } | ||||
| 26480 | ObjectOrLongOrNull arg0; | ||||
| 26481 | if (!(args.hasDefined(0))) { | ||||
| 26482 | arg0.RawSetAsLong() = 5; | ||||
| 26483 | } else { | ||||
| 26484 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26485 | return false; | ||||
| 26486 | } | ||||
| 26487 | } | ||||
| 26488 | if (objIsXray) { | ||||
| 26489 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26490 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26491 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26492 | if (!unwrappedObj.ref()) { | ||||
| 26493 | return false; | ||||
| 26494 | } | ||||
| 26495 | } | ||||
| 26496 | FastErrorResult rv; | ||||
| 26497 | // NOTE: This assert does NOT call the function. | ||||
| 26498 | 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"); | ||||
| 26499 | MOZ_KnownLive(self)(self)->PassUnion14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26500 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14" )), 0))) { | ||||
| 26501 | return false; | ||||
| 26502 | } | ||||
| 26503 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26503); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26503; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26504 | args.rval().setUndefined(); | ||||
| 26505 | return true; | ||||
| 26506 | } | ||||
| 26507 | |||||
| 26508 | static const JSJitInfo passUnion14_methodinfo = { | ||||
| 26509 | { (JSJitGetterOp)passUnion14 }, | ||||
| 26510 | { prototypes::id::TestJSImplInterface }, | ||||
| 26511 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26512 | JSJitInfo::Method, | ||||
| 26513 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26514 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26515 | false, /* isInfallible. False in setters. */ | ||||
| 26516 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26517 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26518 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26519 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26520 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26521 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26522 | }; | ||||
| 26523 | |||||
| 26524 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26525 | passUnion15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26526 | { | ||||
| 26527 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion15"); | ||||
| 26528 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26531( cx, "TestJSImplInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26529 | "TestJSImplInterface", "passUnion15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26531( cx, "TestJSImplInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26530 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26531( cx, "TestJSImplInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26531 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26531( cx, "TestJSImplInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26532 | |||||
| 26533 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26534 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion15", 1)) { | ||||
| 26535 | return false; | ||||
| 26536 | } | ||||
| 26537 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26538 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26539 | if (objIsXray) { | ||||
| 26540 | unwrappedObj.emplace(cx, obj); | ||||
| 26541 | } | ||||
| 26542 | LongSequenceOrLong arg0; | ||||
| 26543 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26544 | return false; | ||||
| 26545 | } | ||||
| 26546 | if (objIsXray) { | ||||
| 26547 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26548 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26549 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26550 | if (!unwrappedObj.ref()) { | ||||
| 26551 | return false; | ||||
| 26552 | } | ||||
| 26553 | } | ||||
| 26554 | FastErrorResult rv; | ||||
| 26555 | // NOTE: This assert does NOT call the function. | ||||
| 26556 | 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"); | ||||
| 26557 | MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26558 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15" )), 0))) { | ||||
| 26559 | return false; | ||||
| 26560 | } | ||||
| 26561 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26561); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26561; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26562 | args.rval().setUndefined(); | ||||
| 26563 | return true; | ||||
| 26564 | } | ||||
| 26565 | |||||
| 26566 | static const JSJitInfo passUnion15_methodinfo = { | ||||
| 26567 | { (JSJitGetterOp)passUnion15 }, | ||||
| 26568 | { prototypes::id::TestJSImplInterface }, | ||||
| 26569 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26570 | JSJitInfo::Method, | ||||
| 26571 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26572 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26573 | false, /* isInfallible. False in setters. */ | ||||
| 26574 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26575 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26576 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26577 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26578 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26579 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26580 | }; | ||||
| 26581 | |||||
| 26582 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26583 | passUnion16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26584 | { | ||||
| 26585 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion16"); | ||||
| 26586 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26589( cx, "TestJSImplInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26587 | "TestJSImplInterface", "passUnion16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26589( cx, "TestJSImplInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26588 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26589( cx, "TestJSImplInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26589 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26589( cx, "TestJSImplInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26590 | |||||
| 26591 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26592 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26593 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26594 | if (objIsXray) { | ||||
| 26595 | unwrappedObj.emplace(cx, obj); | ||||
| 26596 | } | ||||
| 26597 | Optional<LongSequenceOrLong> arg0; | ||||
| 26598 | if (args.hasDefined(0)) { | ||||
| 26599 | arg0.Construct(); | ||||
| 26600 | if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) { | ||||
| 26601 | return false; | ||||
| 26602 | } | ||||
| 26603 | } | ||||
| 26604 | if (objIsXray) { | ||||
| 26605 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26606 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26607 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26608 | if (!unwrappedObj.ref()) { | ||||
| 26609 | return false; | ||||
| 26610 | } | ||||
| 26611 | } | ||||
| 26612 | FastErrorResult rv; | ||||
| 26613 | // NOTE: This assert does NOT call the function. | ||||
| 26614 | 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"); | ||||
| 26615 | MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26616 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16" )), 0))) { | ||||
| 26617 | return false; | ||||
| 26618 | } | ||||
| 26619 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26619); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26619; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26620 | args.rval().setUndefined(); | ||||
| 26621 | return true; | ||||
| 26622 | } | ||||
| 26623 | |||||
| 26624 | static const JSJitInfo passUnion16_methodinfo = { | ||||
| 26625 | { (JSJitGetterOp)passUnion16 }, | ||||
| 26626 | { prototypes::id::TestJSImplInterface }, | ||||
| 26627 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26628 | JSJitInfo::Method, | ||||
| 26629 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26630 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26631 | false, /* isInfallible. False in setters. */ | ||||
| 26632 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26633 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26634 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26635 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26636 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26637 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26638 | }; | ||||
| 26639 | |||||
| 26640 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26641 | passUnion17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26642 | { | ||||
| 26643 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion17"); | ||||
| 26644 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26647( cx, "TestJSImplInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26645 | "TestJSImplInterface", "passUnion17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26647( cx, "TestJSImplInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26646 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26647( cx, "TestJSImplInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26647 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26647( cx, "TestJSImplInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26648 | |||||
| 26649 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26650 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26651 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26652 | if (objIsXray) { | ||||
| 26653 | unwrappedObj.emplace(cx, obj); | ||||
| 26654 | } | ||||
| 26655 | LongSequenceOrNullOrLong arg0; | ||||
| 26656 | if (!(args.hasDefined(0))) { | ||||
| 26657 | arg0.RawSetAsLong() = 5; | ||||
| 26658 | } else { | ||||
| 26659 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26660 | return false; | ||||
| 26661 | } | ||||
| 26662 | } | ||||
| 26663 | if (objIsXray) { | ||||
| 26664 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26665 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26666 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26667 | if (!unwrappedObj.ref()) { | ||||
| 26668 | return false; | ||||
| 26669 | } | ||||
| 26670 | } | ||||
| 26671 | FastErrorResult rv; | ||||
| 26672 | // NOTE: This assert does NOT call the function. | ||||
| 26673 | 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"); | ||||
| 26674 | MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26675 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17" )), 0))) { | ||||
| 26676 | return false; | ||||
| 26677 | } | ||||
| 26678 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26678); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26678; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26679 | args.rval().setUndefined(); | ||||
| 26680 | return true; | ||||
| 26681 | } | ||||
| 26682 | |||||
| 26683 | static const JSJitInfo passUnion17_methodinfo = { | ||||
| 26684 | { (JSJitGetterOp)passUnion17 }, | ||||
| 26685 | { prototypes::id::TestJSImplInterface }, | ||||
| 26686 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26687 | JSJitInfo::Method, | ||||
| 26688 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26689 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26690 | false, /* isInfallible. False in setters. */ | ||||
| 26691 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26692 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26693 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26694 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26695 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26696 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26697 | }; | ||||
| 26698 | |||||
| 26699 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26700 | passUnion18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26701 | { | ||||
| 26702 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion18"); | ||||
| 26703 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26706( cx, "TestJSImplInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26704 | "TestJSImplInterface", "passUnion18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26706( cx, "TestJSImplInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26705 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26706( cx, "TestJSImplInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26706 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26706( cx, "TestJSImplInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26707 | |||||
| 26708 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26709 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion18", 1)) { | ||||
| 26710 | return false; | ||||
| 26711 | } | ||||
| 26712 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26713 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26714 | if (objIsXray) { | ||||
| 26715 | unwrappedObj.emplace(cx, obj); | ||||
| 26716 | } | ||||
| 26717 | ObjectSequenceOrLong arg0; | ||||
| 26718 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26719 | return false; | ||||
| 26720 | } | ||||
| 26721 | if (objIsXray) { | ||||
| 26722 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26723 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26724 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26725 | if (!unwrappedObj.ref()) { | ||||
| 26726 | return false; | ||||
| 26727 | } | ||||
| 26728 | } | ||||
| 26729 | FastErrorResult rv; | ||||
| 26730 | // NOTE: This assert does NOT call the function. | ||||
| 26731 | 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"); | ||||
| 26732 | MOZ_KnownLive(self)(self)->PassUnion18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26733 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18" )), 0))) { | ||||
| 26734 | return false; | ||||
| 26735 | } | ||||
| 26736 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26736); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26736; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26737 | args.rval().setUndefined(); | ||||
| 26738 | return true; | ||||
| 26739 | } | ||||
| 26740 | |||||
| 26741 | static const JSJitInfo passUnion18_methodinfo = { | ||||
| 26742 | { (JSJitGetterOp)passUnion18 }, | ||||
| 26743 | { prototypes::id::TestJSImplInterface }, | ||||
| 26744 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26745 | JSJitInfo::Method, | ||||
| 26746 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26747 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26748 | false, /* isInfallible. False in setters. */ | ||||
| 26749 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26750 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26751 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26752 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26753 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26754 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26755 | }; | ||||
| 26756 | |||||
| 26757 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26758 | passUnion19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26759 | { | ||||
| 26760 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion19"); | ||||
| 26761 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26764( cx, "TestJSImplInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26762 | "TestJSImplInterface", "passUnion19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26764( cx, "TestJSImplInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26763 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26764( cx, "TestJSImplInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26764 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26764( cx, "TestJSImplInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26765 | |||||
| 26766 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26767 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26768 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26769 | if (objIsXray) { | ||||
| 26770 | unwrappedObj.emplace(cx, obj); | ||||
| 26771 | } | ||||
| 26772 | Optional<ObjectSequenceOrLong> arg0; | ||||
| 26773 | if (args.hasDefined(0)) { | ||||
| 26774 | arg0.Construct(); | ||||
| 26775 | if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) { | ||||
| 26776 | return false; | ||||
| 26777 | } | ||||
| 26778 | } | ||||
| 26779 | if (objIsXray) { | ||||
| 26780 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26781 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26782 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26783 | if (!unwrappedObj.ref()) { | ||||
| 26784 | return false; | ||||
| 26785 | } | ||||
| 26786 | } | ||||
| 26787 | FastErrorResult rv; | ||||
| 26788 | // NOTE: This assert does NOT call the function. | ||||
| 26789 | 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"); | ||||
| 26790 | MOZ_KnownLive(self)(self)->PassUnion19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26791 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19" )), 0))) { | ||||
| 26792 | return false; | ||||
| 26793 | } | ||||
| 26794 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26794); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26794; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26795 | args.rval().setUndefined(); | ||||
| 26796 | return true; | ||||
| 26797 | } | ||||
| 26798 | |||||
| 26799 | static const JSJitInfo passUnion19_methodinfo = { | ||||
| 26800 | { (JSJitGetterOp)passUnion19 }, | ||||
| 26801 | { prototypes::id::TestJSImplInterface }, | ||||
| 26802 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26803 | JSJitInfo::Method, | ||||
| 26804 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26805 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26806 | false, /* isInfallible. False in setters. */ | ||||
| 26807 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26808 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26809 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26810 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26811 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26812 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26813 | }; | ||||
| 26814 | |||||
| 26815 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26816 | passUnion20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26817 | { | ||||
| 26818 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion20"); | ||||
| 26819 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26822( cx, "TestJSImplInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26820 | "TestJSImplInterface", "passUnion20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26822( cx, "TestJSImplInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26821 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26822( cx, "TestJSImplInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26822 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26822( cx, "TestJSImplInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26823 | |||||
| 26824 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26825 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26826 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26827 | if (objIsXray) { | ||||
| 26828 | unwrappedObj.emplace(cx, obj); | ||||
| 26829 | } | ||||
| 26830 | ObjectSequenceOrLong arg0; | ||||
| 26831 | if (!(args.hasDefined(0))) { | ||||
| 26832 | Unused << arg0.RawSetAsObjectSequence(cx); | ||||
| 26833 | } else { | ||||
| 26834 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26835 | return false; | ||||
| 26836 | } | ||||
| 26837 | } | ||||
| 26838 | if (objIsXray) { | ||||
| 26839 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26840 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26841 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26842 | if (!unwrappedObj.ref()) { | ||||
| 26843 | return false; | ||||
| 26844 | } | ||||
| 26845 | } | ||||
| 26846 | FastErrorResult rv; | ||||
| 26847 | // NOTE: This assert does NOT call the function. | ||||
| 26848 | 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"); | ||||
| 26849 | MOZ_KnownLive(self)(self)->PassUnion20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26850 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20" )), 0))) { | ||||
| 26851 | return false; | ||||
| 26852 | } | ||||
| 26853 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26853); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26853; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26854 | args.rval().setUndefined(); | ||||
| 26855 | return true; | ||||
| 26856 | } | ||||
| 26857 | |||||
| 26858 | static const JSJitInfo passUnion20_methodinfo = { | ||||
| 26859 | { (JSJitGetterOp)passUnion20 }, | ||||
| 26860 | { prototypes::id::TestJSImplInterface }, | ||||
| 26861 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26862 | JSJitInfo::Method, | ||||
| 26863 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26864 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26865 | false, /* isInfallible. False in setters. */ | ||||
| 26866 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26867 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26868 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26869 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26870 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26871 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26872 | }; | ||||
| 26873 | |||||
| 26874 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26875 | passUnion21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26876 | { | ||||
| 26877 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion21"); | ||||
| 26878 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26881( cx, "TestJSImplInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26879 | "TestJSImplInterface", "passUnion21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26881( cx, "TestJSImplInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26880 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26881( cx, "TestJSImplInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26881 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26881( cx, "TestJSImplInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26882 | |||||
| 26883 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26884 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion21", 1)) { | ||||
| 26885 | return false; | ||||
| 26886 | } | ||||
| 26887 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26888 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26889 | if (objIsXray) { | ||||
| 26890 | unwrappedObj.emplace(cx, obj); | ||||
| 26891 | } | ||||
| 26892 | StringLongRecordOrLong arg0; | ||||
| 26893 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26894 | return false; | ||||
| 26895 | } | ||||
| 26896 | if (objIsXray) { | ||||
| 26897 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26898 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26899 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26900 | if (!unwrappedObj.ref()) { | ||||
| 26901 | return false; | ||||
| 26902 | } | ||||
| 26903 | } | ||||
| 26904 | FastErrorResult rv; | ||||
| 26905 | // NOTE: This assert does NOT call the function. | ||||
| 26906 | 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"); | ||||
| 26907 | MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26908 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21" )), 0))) { | ||||
| 26909 | return false; | ||||
| 26910 | } | ||||
| 26911 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26911); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26911; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26912 | args.rval().setUndefined(); | ||||
| 26913 | return true; | ||||
| 26914 | } | ||||
| 26915 | |||||
| 26916 | static const JSJitInfo passUnion21_methodinfo = { | ||||
| 26917 | { (JSJitGetterOp)passUnion21 }, | ||||
| 26918 | { prototypes::id::TestJSImplInterface }, | ||||
| 26919 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26920 | JSJitInfo::Method, | ||||
| 26921 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26922 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26923 | false, /* isInfallible. False in setters. */ | ||||
| 26924 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26925 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26926 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26927 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26928 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26929 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26930 | }; | ||||
| 26931 | |||||
| 26932 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26933 | passUnion22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26934 | { | ||||
| 26935 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion22"); | ||||
| 26936 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26939( cx, "TestJSImplInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26937 | "TestJSImplInterface", "passUnion22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26939( cx, "TestJSImplInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26938 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26939( cx, "TestJSImplInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26939 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26939( cx, "TestJSImplInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26940 | |||||
| 26941 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 26942 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion22", 1)) { | ||||
| 26943 | return false; | ||||
| 26944 | } | ||||
| 26945 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 26946 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 26947 | if (objIsXray) { | ||||
| 26948 | unwrappedObj.emplace(cx, obj); | ||||
| 26949 | } | ||||
| 26950 | StringObjectRecordOrLong arg0; | ||||
| 26951 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 26952 | return false; | ||||
| 26953 | } | ||||
| 26954 | if (objIsXray) { | ||||
| 26955 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 26956 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 26957 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 26958 | if (!unwrappedObj.ref()) { | ||||
| 26959 | return false; | ||||
| 26960 | } | ||||
| 26961 | } | ||||
| 26962 | FastErrorResult rv; | ||||
| 26963 | // NOTE: This assert does NOT call the function. | ||||
| 26964 | 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"); | ||||
| 26965 | MOZ_KnownLive(self)(self)->PassUnion22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 26966 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22" )), 0))) { | ||||
| 26967 | return false; | ||||
| 26968 | } | ||||
| 26969 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 26969); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 26969; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 26970 | args.rval().setUndefined(); | ||||
| 26971 | return true; | ||||
| 26972 | } | ||||
| 26973 | |||||
| 26974 | static const JSJitInfo passUnion22_methodinfo = { | ||||
| 26975 | { (JSJitGetterOp)passUnion22 }, | ||||
| 26976 | { prototypes::id::TestJSImplInterface }, | ||||
| 26977 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 26978 | JSJitInfo::Method, | ||||
| 26979 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 26980 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 26981 | false, /* isInfallible. False in setters. */ | ||||
| 26982 | false, /* isMovable. Not relevant for setters. */ | ||||
| 26983 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 26984 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 26985 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 26986 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 26987 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 26988 | }; | ||||
| 26989 | |||||
| 26990 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 26991 | passUnion23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 26992 | { | ||||
| 26993 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion23"); | ||||
| 26994 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26997( cx, "TestJSImplInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26995 | "TestJSImplInterface", "passUnion23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26997( cx, "TestJSImplInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26996 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26997( cx, "TestJSImplInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 26997 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26997( cx, "TestJSImplInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 26998 | |||||
| 26999 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27000 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion23", 1)) { | ||||
| 27001 | return false; | ||||
| 27002 | } | ||||
| 27003 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27004 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27005 | if (objIsXray) { | ||||
| 27006 | unwrappedObj.emplace(cx, obj); | ||||
| 27007 | } | ||||
| 27008 | ImageDataSequenceOrLong arg0; | ||||
| 27009 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27010 | return false; | ||||
| 27011 | } | ||||
| 27012 | if (objIsXray) { | ||||
| 27013 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27014 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27015 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27016 | if (!unwrappedObj.ref()) { | ||||
| 27017 | return false; | ||||
| 27018 | } | ||||
| 27019 | } | ||||
| 27020 | FastErrorResult rv; | ||||
| 27021 | // NOTE: This assert does NOT call the function. | ||||
| 27022 | 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"); | ||||
| 27023 | MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27024 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23" )), 0))) { | ||||
| 27025 | return false; | ||||
| 27026 | } | ||||
| 27027 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27027); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27027; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27028 | args.rval().setUndefined(); | ||||
| 27029 | return true; | ||||
| 27030 | } | ||||
| 27031 | |||||
| 27032 | static const JSJitInfo passUnion23_methodinfo = { | ||||
| 27033 | { (JSJitGetterOp)passUnion23 }, | ||||
| 27034 | { prototypes::id::TestJSImplInterface }, | ||||
| 27035 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27036 | JSJitInfo::Method, | ||||
| 27037 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27038 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27039 | false, /* isInfallible. False in setters. */ | ||||
| 27040 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27041 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27042 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27043 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27044 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27045 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27046 | }; | ||||
| 27047 | |||||
| 27048 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27049 | passUnion24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27050 | { | ||||
| 27051 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion24"); | ||||
| 27052 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27055( cx, "TestJSImplInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27053 | "TestJSImplInterface", "passUnion24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27055( cx, "TestJSImplInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27054 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27055( cx, "TestJSImplInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27055 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27055( cx, "TestJSImplInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27056 | |||||
| 27057 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27058 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion24", 1)) { | ||||
| 27059 | return false; | ||||
| 27060 | } | ||||
| 27061 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27062 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27063 | if (objIsXray) { | ||||
| 27064 | unwrappedObj.emplace(cx, obj); | ||||
| 27065 | } | ||||
| 27066 | ImageDataOrNullSequenceOrLong arg0; | ||||
| 27067 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27068 | return false; | ||||
| 27069 | } | ||||
| 27070 | if (objIsXray) { | ||||
| 27071 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27072 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27073 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27074 | if (!unwrappedObj.ref()) { | ||||
| 27075 | return false; | ||||
| 27076 | } | ||||
| 27077 | } | ||||
| 27078 | FastErrorResult rv; | ||||
| 27079 | // NOTE: This assert does NOT call the function. | ||||
| 27080 | 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"); | ||||
| 27081 | MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27082 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24" )), 0))) { | ||||
| 27083 | return false; | ||||
| 27084 | } | ||||
| 27085 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27085); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27085; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27086 | args.rval().setUndefined(); | ||||
| 27087 | return true; | ||||
| 27088 | } | ||||
| 27089 | |||||
| 27090 | static const JSJitInfo passUnion24_methodinfo = { | ||||
| 27091 | { (JSJitGetterOp)passUnion24 }, | ||||
| 27092 | { prototypes::id::TestJSImplInterface }, | ||||
| 27093 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27094 | JSJitInfo::Method, | ||||
| 27095 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27096 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27097 | false, /* isInfallible. False in setters. */ | ||||
| 27098 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27099 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27100 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27101 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27102 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27103 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27104 | }; | ||||
| 27105 | |||||
| 27106 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27107 | passUnion25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27108 | { | ||||
| 27109 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion25"); | ||||
| 27110 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27113( cx, "TestJSImplInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27111 | "TestJSImplInterface", "passUnion25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27113( cx, "TestJSImplInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27112 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27113( cx, "TestJSImplInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27113 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27113( cx, "TestJSImplInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27114 | |||||
| 27115 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27116 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion25", 1)) { | ||||
| 27117 | return false; | ||||
| 27118 | } | ||||
| 27119 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27120 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27121 | if (objIsXray) { | ||||
| 27122 | unwrappedObj.emplace(cx, obj); | ||||
| 27123 | } | ||||
| 27124 | ImageDataSequenceSequenceOrLong arg0; | ||||
| 27125 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27126 | return false; | ||||
| 27127 | } | ||||
| 27128 | if (objIsXray) { | ||||
| 27129 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27130 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27131 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27132 | if (!unwrappedObj.ref()) { | ||||
| 27133 | return false; | ||||
| 27134 | } | ||||
| 27135 | } | ||||
| 27136 | FastErrorResult rv; | ||||
| 27137 | // NOTE: This assert does NOT call the function. | ||||
| 27138 | 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"); | ||||
| 27139 | MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27140 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25" )), 0))) { | ||||
| 27141 | return false; | ||||
| 27142 | } | ||||
| 27143 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27143); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27143; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27144 | args.rval().setUndefined(); | ||||
| 27145 | return true; | ||||
| 27146 | } | ||||
| 27147 | |||||
| 27148 | static const JSJitInfo passUnion25_methodinfo = { | ||||
| 27149 | { (JSJitGetterOp)passUnion25 }, | ||||
| 27150 | { prototypes::id::TestJSImplInterface }, | ||||
| 27151 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27152 | JSJitInfo::Method, | ||||
| 27153 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27154 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27155 | false, /* isInfallible. False in setters. */ | ||||
| 27156 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27157 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27158 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27159 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27160 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27161 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27162 | }; | ||||
| 27163 | |||||
| 27164 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27165 | passUnion26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27166 | { | ||||
| 27167 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion26"); | ||||
| 27168 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27171( cx, "TestJSImplInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27169 | "TestJSImplInterface", "passUnion26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27171( cx, "TestJSImplInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27170 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27171( cx, "TestJSImplInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27171 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27171( cx, "TestJSImplInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27172 | |||||
| 27173 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27174 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion26", 1)) { | ||||
| 27175 | return false; | ||||
| 27176 | } | ||||
| 27177 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27178 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27179 | if (objIsXray) { | ||||
| 27180 | unwrappedObj.emplace(cx, obj); | ||||
| 27181 | } | ||||
| 27182 | ImageDataOrNullSequenceSequenceOrLong arg0; | ||||
| 27183 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27184 | return false; | ||||
| 27185 | } | ||||
| 27186 | if (objIsXray) { | ||||
| 27187 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27188 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27189 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27190 | if (!unwrappedObj.ref()) { | ||||
| 27191 | return false; | ||||
| 27192 | } | ||||
| 27193 | } | ||||
| 27194 | FastErrorResult rv; | ||||
| 27195 | // NOTE: This assert does NOT call the function. | ||||
| 27196 | 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"); | ||||
| 27197 | MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27198 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26" )), 0))) { | ||||
| 27199 | return false; | ||||
| 27200 | } | ||||
| 27201 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27201; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27202 | args.rval().setUndefined(); | ||||
| 27203 | return true; | ||||
| 27204 | } | ||||
| 27205 | |||||
| 27206 | static const JSJitInfo passUnion26_methodinfo = { | ||||
| 27207 | { (JSJitGetterOp)passUnion26 }, | ||||
| 27208 | { prototypes::id::TestJSImplInterface }, | ||||
| 27209 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27210 | JSJitInfo::Method, | ||||
| 27211 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27212 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27213 | false, /* isInfallible. False in setters. */ | ||||
| 27214 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27215 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27216 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27217 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27218 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27219 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27220 | }; | ||||
| 27221 | |||||
| 27222 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27223 | passUnion27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27224 | { | ||||
| 27225 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion27"); | ||||
| 27226 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27229( cx, "TestJSImplInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27227 | "TestJSImplInterface", "passUnion27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27229( cx, "TestJSImplInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27228 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27229( cx, "TestJSImplInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27229 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27229( cx, "TestJSImplInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27230 | |||||
| 27231 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27232 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27233 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27234 | if (objIsXray) { | ||||
| 27235 | unwrappedObj.emplace(cx, obj); | ||||
| 27236 | } | ||||
| 27237 | StringSequenceOrEventInit arg0; | ||||
| 27238 | if (!(args.hasDefined(0))) { | ||||
| 27239 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (sequence<DOMString> or EventInit)")) { | ||||
| 27240 | return false; | ||||
| 27241 | } | ||||
| 27242 | } else { | ||||
| 27243 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27244 | return false; | ||||
| 27245 | } | ||||
| 27246 | } | ||||
| 27247 | if (objIsXray) { | ||||
| 27248 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27249 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27250 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27251 | if (!unwrappedObj.ref()) { | ||||
| 27252 | return false; | ||||
| 27253 | } | ||||
| 27254 | } | ||||
| 27255 | FastErrorResult rv; | ||||
| 27256 | // NOTE: This assert does NOT call the function. | ||||
| 27257 | 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"); | ||||
| 27258 | MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27259 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27" )), 0))) { | ||||
| 27260 | return false; | ||||
| 27261 | } | ||||
| 27262 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27262); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27262; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27263 | args.rval().setUndefined(); | ||||
| 27264 | return true; | ||||
| 27265 | } | ||||
| 27266 | |||||
| 27267 | static const JSJitInfo passUnion27_methodinfo = { | ||||
| 27268 | { (JSJitGetterOp)passUnion27 }, | ||||
| 27269 | { prototypes::id::TestJSImplInterface }, | ||||
| 27270 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27271 | JSJitInfo::Method, | ||||
| 27272 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27273 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27274 | false, /* isInfallible. False in setters. */ | ||||
| 27275 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27276 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27277 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27278 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27279 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27280 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27281 | }; | ||||
| 27282 | |||||
| 27283 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27284 | passUnion28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27285 | { | ||||
| 27286 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnion28"); | ||||
| 27287 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27290( cx, "TestJSImplInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27288 | "TestJSImplInterface", "passUnion28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27290( cx, "TestJSImplInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27289 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27290( cx, "TestJSImplInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27290 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27290( cx, "TestJSImplInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27291 | |||||
| 27292 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27293 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27294 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27295 | if (objIsXray) { | ||||
| 27296 | unwrappedObj.emplace(cx, obj); | ||||
| 27297 | } | ||||
| 27298 | EventInitOrStringSequence arg0; | ||||
| 27299 | if (!(args.hasDefined(0))) { | ||||
| 27300 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or sequence<DOMString>)")) { | ||||
| 27301 | return false; | ||||
| 27302 | } | ||||
| 27303 | } else { | ||||
| 27304 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27305 | return false; | ||||
| 27306 | } | ||||
| 27307 | } | ||||
| 27308 | if (objIsXray) { | ||||
| 27309 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27310 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27311 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27312 | if (!unwrappedObj.ref()) { | ||||
| 27313 | return false; | ||||
| 27314 | } | ||||
| 27315 | } | ||||
| 27316 | FastErrorResult rv; | ||||
| 27317 | // NOTE: This assert does NOT call the function. | ||||
| 27318 | 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"); | ||||
| 27319 | MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27320 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28" )), 0))) { | ||||
| 27321 | return false; | ||||
| 27322 | } | ||||
| 27323 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27323); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27323; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27324 | args.rval().setUndefined(); | ||||
| 27325 | return true; | ||||
| 27326 | } | ||||
| 27327 | |||||
| 27328 | static const JSJitInfo passUnion28_methodinfo = { | ||||
| 27329 | { (JSJitGetterOp)passUnion28 }, | ||||
| 27330 | { prototypes::id::TestJSImplInterface }, | ||||
| 27331 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27332 | JSJitInfo::Method, | ||||
| 27333 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27334 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27335 | false, /* isInfallible. False in setters. */ | ||||
| 27336 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27337 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27338 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27339 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27340 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27341 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27342 | }; | ||||
| 27343 | |||||
| 27344 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27345 | passUnionWithCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27346 | { | ||||
| 27347 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithCallback"); | ||||
| 27348 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27351( cx, "TestJSImplInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27349 | "TestJSImplInterface", "passUnionWithCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27351( cx, "TestJSImplInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27350 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27351( cx, "TestJSImplInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27351 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27351( cx, "TestJSImplInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27352 | |||||
| 27353 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27354 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithCallback", 1)) { | ||||
| 27355 | return false; | ||||
| 27356 | } | ||||
| 27357 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27358 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27359 | if (objIsXray) { | ||||
| 27360 | unwrappedObj.emplace(cx, obj); | ||||
| 27361 | } | ||||
| 27362 | EventHandlerNonNullOrNullOrLong arg0; | ||||
| 27363 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27364 | return false; | ||||
| 27365 | } | ||||
| 27366 | if (objIsXray) { | ||||
| 27367 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27368 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27369 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27370 | if (!unwrappedObj.ref()) { | ||||
| 27371 | return false; | ||||
| 27372 | } | ||||
| 27373 | } | ||||
| 27374 | FastErrorResult rv; | ||||
| 27375 | // NOTE: This assert does NOT call the function. | ||||
| 27376 | 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"); | ||||
| 27377 | MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27378 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback" )), 0))) { | ||||
| 27379 | return false; | ||||
| 27380 | } | ||||
| 27381 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27381); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27381; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27382 | args.rval().setUndefined(); | ||||
| 27383 | return true; | ||||
| 27384 | } | ||||
| 27385 | |||||
| 27386 | static const JSJitInfo passUnionWithCallback_methodinfo = { | ||||
| 27387 | { (JSJitGetterOp)passUnionWithCallback }, | ||||
| 27388 | { prototypes::id::TestJSImplInterface }, | ||||
| 27389 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27390 | JSJitInfo::Method, | ||||
| 27391 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27392 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27393 | false, /* isInfallible. False in setters. */ | ||||
| 27394 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27395 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27396 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27397 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27398 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27399 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27400 | }; | ||||
| 27401 | |||||
| 27402 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27403 | passUnionWithByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27404 | { | ||||
| 27405 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithByteString"); | ||||
| 27406 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27409( cx, "TestJSImplInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27407 | "TestJSImplInterface", "passUnionWithByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27409( cx, "TestJSImplInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27408 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27409( cx, "TestJSImplInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27409 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27409( cx, "TestJSImplInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27410 | |||||
| 27411 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27412 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithByteString", 1)) { | ||||
| 27413 | return false; | ||||
| 27414 | } | ||||
| 27415 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27416 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27417 | if (objIsXray) { | ||||
| 27418 | unwrappedObj.emplace(cx, obj); | ||||
| 27419 | } | ||||
| 27420 | ByteStringOrLong arg0; | ||||
| 27421 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27422 | return false; | ||||
| 27423 | } | ||||
| 27424 | if (objIsXray) { | ||||
| 27425 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27426 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27427 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27428 | if (!unwrappedObj.ref()) { | ||||
| 27429 | return false; | ||||
| 27430 | } | ||||
| 27431 | } | ||||
| 27432 | FastErrorResult rv; | ||||
| 27433 | // NOTE: This assert does NOT call the function. | ||||
| 27434 | 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"); | ||||
| 27435 | MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27436 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString" )), 0))) { | ||||
| 27437 | return false; | ||||
| 27438 | } | ||||
| 27439 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27439); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27439; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27440 | args.rval().setUndefined(); | ||||
| 27441 | return true; | ||||
| 27442 | } | ||||
| 27443 | |||||
| 27444 | static const JSJitInfo passUnionWithByteString_methodinfo = { | ||||
| 27445 | { (JSJitGetterOp)passUnionWithByteString }, | ||||
| 27446 | { prototypes::id::TestJSImplInterface }, | ||||
| 27447 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27448 | JSJitInfo::Method, | ||||
| 27449 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27450 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27451 | false, /* isInfallible. False in setters. */ | ||||
| 27452 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27453 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27454 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27455 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27456 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27457 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27458 | }; | ||||
| 27459 | |||||
| 27460 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27461 | passUnionWithUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27462 | { | ||||
| 27463 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithUTF8String"); | ||||
| 27464 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27467( cx, "TestJSImplInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27465 | "TestJSImplInterface", "passUnionWithUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27467( cx, "TestJSImplInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27466 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27467( cx, "TestJSImplInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27467 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27467( cx, "TestJSImplInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27468 | |||||
| 27469 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27470 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithUTF8String", 1)) { | ||||
| 27471 | return false; | ||||
| 27472 | } | ||||
| 27473 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27474 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27475 | if (objIsXray) { | ||||
| 27476 | unwrappedObj.emplace(cx, obj); | ||||
| 27477 | } | ||||
| 27478 | UTF8StringOrLong arg0; | ||||
| 27479 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27480 | return false; | ||||
| 27481 | } | ||||
| 27482 | if (objIsXray) { | ||||
| 27483 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27484 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27485 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27486 | if (!unwrappedObj.ref()) { | ||||
| 27487 | return false; | ||||
| 27488 | } | ||||
| 27489 | } | ||||
| 27490 | FastErrorResult rv; | ||||
| 27491 | // NOTE: This assert does NOT call the function. | ||||
| 27492 | 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"); | ||||
| 27493 | MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27494 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String" )), 0))) { | ||||
| 27495 | return false; | ||||
| 27496 | } | ||||
| 27497 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27497); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27497; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27498 | args.rval().setUndefined(); | ||||
| 27499 | return true; | ||||
| 27500 | } | ||||
| 27501 | |||||
| 27502 | static const JSJitInfo passUnionWithUTF8String_methodinfo = { | ||||
| 27503 | { (JSJitGetterOp)passUnionWithUTF8String }, | ||||
| 27504 | { prototypes::id::TestJSImplInterface }, | ||||
| 27505 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27506 | JSJitInfo::Method, | ||||
| 27507 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27508 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27509 | false, /* isInfallible. False in setters. */ | ||||
| 27510 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27511 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27512 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27513 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27514 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27515 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27516 | }; | ||||
| 27517 | |||||
| 27518 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27519 | passUnionWithRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27520 | { | ||||
| 27521 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecord"); | ||||
| 27522 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27525( cx, "TestJSImplInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27523 | "TestJSImplInterface", "passUnionWithRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27525( cx, "TestJSImplInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27524 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27525( cx, "TestJSImplInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27525 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27525( cx, "TestJSImplInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27526 | |||||
| 27527 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27528 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecord", 1)) { | ||||
| 27529 | return false; | ||||
| 27530 | } | ||||
| 27531 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27532 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27533 | if (objIsXray) { | ||||
| 27534 | unwrappedObj.emplace(cx, obj); | ||||
| 27535 | } | ||||
| 27536 | StringStringRecordOrString arg0; | ||||
| 27537 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27538 | return false; | ||||
| 27539 | } | ||||
| 27540 | if (objIsXray) { | ||||
| 27541 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27542 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27543 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27544 | if (!unwrappedObj.ref()) { | ||||
| 27545 | return false; | ||||
| 27546 | } | ||||
| 27547 | } | ||||
| 27548 | FastErrorResult rv; | ||||
| 27549 | // NOTE: This assert does NOT call the function. | ||||
| 27550 | 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"); | ||||
| 27551 | MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27552 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord" )), 0))) { | ||||
| 27553 | return false; | ||||
| 27554 | } | ||||
| 27555 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27555); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27555; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27556 | args.rval().setUndefined(); | ||||
| 27557 | return true; | ||||
| 27558 | } | ||||
| 27559 | |||||
| 27560 | static const JSJitInfo passUnionWithRecord_methodinfo = { | ||||
| 27561 | { (JSJitGetterOp)passUnionWithRecord }, | ||||
| 27562 | { prototypes::id::TestJSImplInterface }, | ||||
| 27563 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27564 | JSJitInfo::Method, | ||||
| 27565 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27566 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27567 | false, /* isInfallible. False in setters. */ | ||||
| 27568 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27569 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27570 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27571 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27572 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27573 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27574 | }; | ||||
| 27575 | |||||
| 27576 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27577 | passUnionWithRecordAndSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27578 | { | ||||
| 27579 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecordAndSequence"); | ||||
| 27580 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27583( cx, "TestJSImplInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27581 | "TestJSImplInterface", "passUnionWithRecordAndSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27583( cx, "TestJSImplInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27582 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27583( cx, "TestJSImplInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27583 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27583( cx, "TestJSImplInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 27584 | |||||
| 27585 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27586 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecordAndSequence", 1)) { | ||||
| 27587 | return false; | ||||
| 27588 | } | ||||
| 27589 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27590 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27591 | if (objIsXray) { | ||||
| 27592 | unwrappedObj.emplace(cx, obj); | ||||
| 27593 | } | ||||
| 27594 | StringStringRecordOrStringSequence arg0; | ||||
| 27595 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27596 | return false; | ||||
| 27597 | } | ||||
| 27598 | if (objIsXray) { | ||||
| 27599 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27600 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27601 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27602 | if (!unwrappedObj.ref()) { | ||||
| 27603 | return false; | ||||
| 27604 | } | ||||
| 27605 | } | ||||
| 27606 | FastErrorResult rv; | ||||
| 27607 | // NOTE: This assert does NOT call the function. | ||||
| 27608 | 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"); | ||||
| 27609 | MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27610 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence" )), 0))) { | ||||
| 27611 | return false; | ||||
| 27612 | } | ||||
| 27613 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27613); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27613; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27614 | args.rval().setUndefined(); | ||||
| 27615 | return true; | ||||
| 27616 | } | ||||
| 27617 | |||||
| 27618 | static const JSJitInfo passUnionWithRecordAndSequence_methodinfo = { | ||||
| 27619 | { (JSJitGetterOp)passUnionWithRecordAndSequence }, | ||||
| 27620 | { prototypes::id::TestJSImplInterface }, | ||||
| 27621 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27622 | JSJitInfo::Method, | ||||
| 27623 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27624 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27625 | false, /* isInfallible. False in setters. */ | ||||
| 27626 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27627 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27628 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27629 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27630 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27631 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27632 | }; | ||||
| 27633 | |||||
| 27634 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27635 | passUnionWithSequenceAndRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27636 | { | ||||
| 27637 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSequenceAndRecord"); | ||||
| 27638 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27641( cx, "TestJSImplInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27639 | "TestJSImplInterface", "passUnionWithSequenceAndRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27641( cx, "TestJSImplInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27640 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27641( cx, "TestJSImplInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27641 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27641( cx, "TestJSImplInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 27642 | |||||
| 27643 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27644 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord", 1)) { | ||||
| 27645 | return false; | ||||
| 27646 | } | ||||
| 27647 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27648 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27649 | if (objIsXray) { | ||||
| 27650 | unwrappedObj.emplace(cx, obj); | ||||
| 27651 | } | ||||
| 27652 | StringSequenceOrStringStringRecord arg0; | ||||
| 27653 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27654 | return false; | ||||
| 27655 | } | ||||
| 27656 | if (objIsXray) { | ||||
| 27657 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27658 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27659 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27660 | if (!unwrappedObj.ref()) { | ||||
| 27661 | return false; | ||||
| 27662 | } | ||||
| 27663 | } | ||||
| 27664 | FastErrorResult rv; | ||||
| 27665 | // NOTE: This assert does NOT call the function. | ||||
| 27666 | 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"); | ||||
| 27667 | MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27668 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord" )), 0))) { | ||||
| 27669 | return false; | ||||
| 27670 | } | ||||
| 27671 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27671); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27671; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27672 | args.rval().setUndefined(); | ||||
| 27673 | return true; | ||||
| 27674 | } | ||||
| 27675 | |||||
| 27676 | static const JSJitInfo passUnionWithSequenceAndRecord_methodinfo = { | ||||
| 27677 | { (JSJitGetterOp)passUnionWithSequenceAndRecord }, | ||||
| 27678 | { prototypes::id::TestJSImplInterface }, | ||||
| 27679 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27680 | JSJitInfo::Method, | ||||
| 27681 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27682 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27683 | false, /* isInfallible. False in setters. */ | ||||
| 27684 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27685 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27686 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27687 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27688 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27689 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27690 | }; | ||||
| 27691 | |||||
| 27692 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27693 | passUnionWithSVS(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27694 | { | ||||
| 27695 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSVS"); | ||||
| 27696 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27699( cx, "TestJSImplInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27697 | "TestJSImplInterface", "passUnionWithSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27699( cx, "TestJSImplInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27698 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27699( cx, "TestJSImplInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27699 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27699( cx, "TestJSImplInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27700 | |||||
| 27701 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27702 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSVS", 1)) { | ||||
| 27703 | return false; | ||||
| 27704 | } | ||||
| 27705 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27706 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27707 | if (objIsXray) { | ||||
| 27708 | unwrappedObj.emplace(cx, obj); | ||||
| 27709 | } | ||||
| 27710 | USVStringOrLong arg0; | ||||
| 27711 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27712 | return false; | ||||
| 27713 | } | ||||
| 27714 | if (objIsXray) { | ||||
| 27715 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27716 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27717 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27718 | if (!unwrappedObj.ref()) { | ||||
| 27719 | return false; | ||||
| 27720 | } | ||||
| 27721 | } | ||||
| 27722 | FastErrorResult rv; | ||||
| 27723 | // NOTE: This assert does NOT call the function. | ||||
| 27724 | 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"); | ||||
| 27725 | MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27726 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS" )), 0))) { | ||||
| 27727 | return false; | ||||
| 27728 | } | ||||
| 27729 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27729); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27729; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27730 | args.rval().setUndefined(); | ||||
| 27731 | return true; | ||||
| 27732 | } | ||||
| 27733 | |||||
| 27734 | static const JSJitInfo passUnionWithSVS_methodinfo = { | ||||
| 27735 | { (JSJitGetterOp)passUnionWithSVS }, | ||||
| 27736 | { prototypes::id::TestJSImplInterface }, | ||||
| 27737 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27738 | JSJitInfo::Method, | ||||
| 27739 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27740 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27741 | false, /* isInfallible. False in setters. */ | ||||
| 27742 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27743 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27744 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27745 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27746 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27747 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27748 | }; | ||||
| 27749 | |||||
| 27750 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27751 | passUnionWithNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27752 | { | ||||
| 27753 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithNullable"); | ||||
| 27754 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27757( cx, "TestJSImplInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27755 | "TestJSImplInterface", "passUnionWithNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27757( cx, "TestJSImplInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27756 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27757( cx, "TestJSImplInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27757 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27757( cx, "TestJSImplInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27758 | |||||
| 27759 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27760 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithNullable", 1)) { | ||||
| 27761 | return false; | ||||
| 27762 | } | ||||
| 27763 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27764 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27765 | if (objIsXray) { | ||||
| 27766 | unwrappedObj.emplace(cx, obj); | ||||
| 27767 | } | ||||
| 27768 | ObjectOrNullOrLong arg0; | ||||
| 27769 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 27770 | return false; | ||||
| 27771 | } | ||||
| 27772 | if (objIsXray) { | ||||
| 27773 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27774 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27775 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27776 | if (!unwrappedObj.ref()) { | ||||
| 27777 | return false; | ||||
| 27778 | } | ||||
| 27779 | } | ||||
| 27780 | FastErrorResult rv; | ||||
| 27781 | // NOTE: This assert does NOT call the function. | ||||
| 27782 | 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"); | ||||
| 27783 | MOZ_KnownLive(self)(self)->PassUnionWithNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27784 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable" )), 0))) { | ||||
| 27785 | return false; | ||||
| 27786 | } | ||||
| 27787 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27787); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27787; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27788 | args.rval().setUndefined(); | ||||
| 27789 | return true; | ||||
| 27790 | } | ||||
| 27791 | |||||
| 27792 | static const JSJitInfo passUnionWithNullable_methodinfo = { | ||||
| 27793 | { (JSJitGetterOp)passUnionWithNullable }, | ||||
| 27794 | { prototypes::id::TestJSImplInterface }, | ||||
| 27795 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27796 | JSJitInfo::Method, | ||||
| 27797 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27798 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27799 | false, /* isInfallible. False in setters. */ | ||||
| 27800 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27801 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27802 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27803 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27804 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27805 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27806 | }; | ||||
| 27807 | |||||
| 27808 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27809 | passNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27810 | { | ||||
| 27811 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnion"); | ||||
| 27812 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27815( cx, "TestJSImplInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27813 | "TestJSImplInterface", "passNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27815( cx, "TestJSImplInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27814 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27815( cx, "TestJSImplInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27815 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27815( cx, "TestJSImplInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27816 | |||||
| 27817 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27818 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUnion", 1)) { | ||||
| 27819 | return false; | ||||
| 27820 | } | ||||
| 27821 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27822 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27823 | if (objIsXray) { | ||||
| 27824 | unwrappedObj.emplace(cx, obj); | ||||
| 27825 | } | ||||
| 27826 | Nullable<ObjectOrLong > arg0; | ||||
| 27827 | if (args[0].isNullOrUndefined()) { | ||||
| 27828 | arg0.SetNull(); | ||||
| 27829 | } else { | ||||
| 27830 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 27831 | return false; | ||||
| 27832 | } | ||||
| 27833 | } | ||||
| 27834 | if (objIsXray) { | ||||
| 27835 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27836 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27837 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27838 | if (!unwrappedObj.ref()) { | ||||
| 27839 | return false; | ||||
| 27840 | } | ||||
| 27841 | } | ||||
| 27842 | FastErrorResult rv; | ||||
| 27843 | // NOTE: This assert does NOT call the function. | ||||
| 27844 | 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"); | ||||
| 27845 | MOZ_KnownLive(self)(self)->PassNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27846 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion" )), 0))) { | ||||
| 27847 | return false; | ||||
| 27848 | } | ||||
| 27849 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27849); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27849; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27850 | args.rval().setUndefined(); | ||||
| 27851 | return true; | ||||
| 27852 | } | ||||
| 27853 | |||||
| 27854 | static const JSJitInfo passNullableUnion_methodinfo = { | ||||
| 27855 | { (JSJitGetterOp)passNullableUnion }, | ||||
| 27856 | { prototypes::id::TestJSImplInterface }, | ||||
| 27857 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27858 | JSJitInfo::Method, | ||||
| 27859 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27860 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27861 | false, /* isInfallible. False in setters. */ | ||||
| 27862 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27863 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27864 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27865 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27866 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27867 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27868 | }; | ||||
| 27869 | |||||
| 27870 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27871 | passOptionalUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27872 | { | ||||
| 27873 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnion"); | ||||
| 27874 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27877( cx, "TestJSImplInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27875 | "TestJSImplInterface", "passOptionalUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27877( cx, "TestJSImplInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27876 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27877( cx, "TestJSImplInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 27877 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27877( cx, "TestJSImplInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 27878 | |||||
| 27879 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27880 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27881 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27882 | if (objIsXray) { | ||||
| 27883 | unwrappedObj.emplace(cx, obj); | ||||
| 27884 | } | ||||
| 27885 | Optional<ObjectOrLong> arg0; | ||||
| 27886 | if (args.hasDefined(0)) { | ||||
| 27887 | arg0.Construct(); | ||||
| 27888 | if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) { | ||||
| 27889 | return false; | ||||
| 27890 | } | ||||
| 27891 | } | ||||
| 27892 | if (objIsXray) { | ||||
| 27893 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27894 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27895 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27896 | if (!unwrappedObj.ref()) { | ||||
| 27897 | return false; | ||||
| 27898 | } | ||||
| 27899 | } | ||||
| 27900 | FastErrorResult rv; | ||||
| 27901 | // NOTE: This assert does NOT call the function. | ||||
| 27902 | 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"); | ||||
| 27903 | MOZ_KnownLive(self)(self)->PassOptionalUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27904 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion" )), 0))) { | ||||
| 27905 | return false; | ||||
| 27906 | } | ||||
| 27907 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27907); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27907; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27908 | args.rval().setUndefined(); | ||||
| 27909 | return true; | ||||
| 27910 | } | ||||
| 27911 | |||||
| 27912 | static const JSJitInfo passOptionalUnion_methodinfo = { | ||||
| 27913 | { (JSJitGetterOp)passOptionalUnion }, | ||||
| 27914 | { prototypes::id::TestJSImplInterface }, | ||||
| 27915 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27916 | JSJitInfo::Method, | ||||
| 27917 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27918 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27919 | false, /* isInfallible. False in setters. */ | ||||
| 27920 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27921 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27922 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27923 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27924 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27925 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27926 | }; | ||||
| 27927 | |||||
| 27928 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27929 | passOptionalNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27930 | { | ||||
| 27931 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnion"); | ||||
| 27932 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27935( cx, "TestJSImplInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27933 | "TestJSImplInterface", "passOptionalNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27935( cx, "TestJSImplInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27934 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27935( cx, "TestJSImplInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27935 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27935( cx, "TestJSImplInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 27936 | |||||
| 27937 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 27938 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 27939 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 27940 | if (objIsXray) { | ||||
| 27941 | unwrappedObj.emplace(cx, obj); | ||||
| 27942 | } | ||||
| 27943 | Optional<Nullable<ObjectOrLong >> arg0; | ||||
| 27944 | if (args.hasDefined(0)) { | ||||
| 27945 | arg0.Construct(); | ||||
| 27946 | if (args[0].isNullOrUndefined()) { | ||||
| 27947 | arg0.Value().SetNull(); | ||||
| 27948 | } else { | ||||
| 27949 | if (!arg0.Value().SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 27950 | return false; | ||||
| 27951 | } | ||||
| 27952 | } | ||||
| 27953 | } | ||||
| 27954 | if (objIsXray) { | ||||
| 27955 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 27956 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 27957 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 27958 | if (!unwrappedObj.ref()) { | ||||
| 27959 | return false; | ||||
| 27960 | } | ||||
| 27961 | } | ||||
| 27962 | FastErrorResult rv; | ||||
| 27963 | // NOTE: This assert does NOT call the function. | ||||
| 27964 | 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"); | ||||
| 27965 | MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 27966 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion" )), 0))) { | ||||
| 27967 | return false; | ||||
| 27968 | } | ||||
| 27969 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 27969); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 27969; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 27970 | args.rval().setUndefined(); | ||||
| 27971 | return true; | ||||
| 27972 | } | ||||
| 27973 | |||||
| 27974 | static const JSJitInfo passOptionalNullableUnion_methodinfo = { | ||||
| 27975 | { (JSJitGetterOp)passOptionalNullableUnion }, | ||||
| 27976 | { prototypes::id::TestJSImplInterface }, | ||||
| 27977 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 27978 | JSJitInfo::Method, | ||||
| 27979 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 27980 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 27981 | false, /* isInfallible. False in setters. */ | ||||
| 27982 | false, /* isMovable. Not relevant for setters. */ | ||||
| 27983 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 27984 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 27985 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 27986 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 27987 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 27988 | }; | ||||
| 27989 | |||||
| 27990 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 27991 | passOptionalNullableUnionWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 27992 | { | ||||
| 27993 | BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"); | ||||
| 27994 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27997( cx, "TestJSImplInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27995 | "TestJSImplInterface", "passOptionalNullableUnionWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27997( cx, "TestJSImplInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27996 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27997( cx, "TestJSImplInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 27997 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27997( cx, "TestJSImplInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 27998 | |||||
| 27999 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28000 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28001 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28002 | if (objIsXray) { | ||||
| 28003 | unwrappedObj.emplace(cx, obj); | ||||
| 28004 | } | ||||
| 28005 | Nullable<ObjectOrLong > arg0; | ||||
| 28006 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 28007 | arg0.SetNull(); | ||||
| 28008 | } else { | ||||
| 28009 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 28010 | return false; | ||||
| 28011 | } | ||||
| 28012 | } | ||||
| 28013 | if (objIsXray) { | ||||
| 28014 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28015 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28016 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28017 | if (!unwrappedObj.ref()) { | ||||
| 28018 | return false; | ||||
| 28019 | } | ||||
| 28020 | } | ||||
| 28021 | FastErrorResult rv; | ||||
| 28022 | // NOTE: This assert does NOT call the function. | ||||
| 28023 | 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"); | ||||
| 28024 | MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28025 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue" )), 0))) { | ||||
| 28026 | return false; | ||||
| 28027 | } | ||||
| 28028 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28028); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28028; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28029 | args.rval().setUndefined(); | ||||
| 28030 | return true; | ||||
| 28031 | } | ||||
| 28032 | |||||
| 28033 | static const JSJitInfo passOptionalNullableUnionWithDefaultValue_methodinfo = { | ||||
| 28034 | { (JSJitGetterOp)passOptionalNullableUnionWithDefaultValue }, | ||||
| 28035 | { prototypes::id::TestJSImplInterface }, | ||||
| 28036 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28037 | JSJitInfo::Method, | ||||
| 28038 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28039 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28040 | false, /* isInfallible. False in setters. */ | ||||
| 28041 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28042 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28043 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28044 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28045 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28046 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28047 | }; | ||||
| 28048 | |||||
| 28049 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28050 | passUnionWithArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28051 | { | ||||
| 28052 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBuffer"); | ||||
| 28053 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28056( cx, "TestJSImplInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28054 | "TestJSImplInterface", "passUnionWithArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28056( cx, "TestJSImplInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28055 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28056( cx, "TestJSImplInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28056 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28056( cx, "TestJSImplInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28057 | |||||
| 28058 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28059 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBuffer", 1)) { | ||||
| 28060 | return false; | ||||
| 28061 | } | ||||
| 28062 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28063 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28064 | if (objIsXray) { | ||||
| 28065 | unwrappedObj.emplace(cx, obj); | ||||
| 28066 | } | ||||
| 28067 | UTF8StringOrArrayBuffer arg0; | ||||
| 28068 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28069 | return false; | ||||
| 28070 | } | ||||
| 28071 | if (objIsXray) { | ||||
| 28072 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28073 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28074 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28075 | if (!unwrappedObj.ref()) { | ||||
| 28076 | return false; | ||||
| 28077 | } | ||||
| 28078 | } | ||||
| 28079 | FastErrorResult rv; | ||||
| 28080 | // NOTE: This assert does NOT call the function. | ||||
| 28081 | 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"); | ||||
| 28082 | MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28083 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer" )), 0))) { | ||||
| 28084 | return false; | ||||
| 28085 | } | ||||
| 28086 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28086); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28086; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28087 | args.rval().setUndefined(); | ||||
| 28088 | return true; | ||||
| 28089 | } | ||||
| 28090 | |||||
| 28091 | static const JSJitInfo passUnionWithArrayBuffer_methodinfo = { | ||||
| 28092 | { (JSJitGetterOp)passUnionWithArrayBuffer }, | ||||
| 28093 | { prototypes::id::TestJSImplInterface }, | ||||
| 28094 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28095 | JSJitInfo::Method, | ||||
| 28096 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28097 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28098 | false, /* isInfallible. False in setters. */ | ||||
| 28099 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28100 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28101 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28102 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28103 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28104 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28105 | }; | ||||
| 28106 | |||||
| 28107 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28108 | passUnionWithArrayBufferOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28109 | { | ||||
| 28110 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBufferOrNull"); | ||||
| 28111 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28114( cx, "TestJSImplInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28112 | "TestJSImplInterface", "passUnionWithArrayBufferOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28114( cx, "TestJSImplInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28113 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28114( cx, "TestJSImplInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28114 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28114( cx, "TestJSImplInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28115 | |||||
| 28116 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28117 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull", 1)) { | ||||
| 28118 | return false; | ||||
| 28119 | } | ||||
| 28120 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28121 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28122 | if (objIsXray) { | ||||
| 28123 | unwrappedObj.emplace(cx, obj); | ||||
| 28124 | } | ||||
| 28125 | UTF8StringOrArrayBufferOrNull arg0; | ||||
| 28126 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28127 | return false; | ||||
| 28128 | } | ||||
| 28129 | if (objIsXray) { | ||||
| 28130 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28131 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28132 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28133 | if (!unwrappedObj.ref()) { | ||||
| 28134 | return false; | ||||
| 28135 | } | ||||
| 28136 | } | ||||
| 28137 | FastErrorResult rv; | ||||
| 28138 | // NOTE: This assert does NOT call the function. | ||||
| 28139 | 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"); | ||||
| 28140 | MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28141 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull" )), 0))) { | ||||
| 28142 | return false; | ||||
| 28143 | } | ||||
| 28144 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28144); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28144; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28145 | args.rval().setUndefined(); | ||||
| 28146 | return true; | ||||
| 28147 | } | ||||
| 28148 | |||||
| 28149 | static const JSJitInfo passUnionWithArrayBufferOrNull_methodinfo = { | ||||
| 28150 | { (JSJitGetterOp)passUnionWithArrayBufferOrNull }, | ||||
| 28151 | { prototypes::id::TestJSImplInterface }, | ||||
| 28152 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28153 | JSJitInfo::Method, | ||||
| 28154 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28155 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28156 | false, /* isInfallible. False in setters. */ | ||||
| 28157 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28158 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28159 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28160 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28161 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28162 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28163 | }; | ||||
| 28164 | |||||
| 28165 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28166 | passUnionWithTypedArrays(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28167 | { | ||||
| 28168 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArrays"); | ||||
| 28169 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28172( cx, "TestJSImplInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28170 | "TestJSImplInterface", "passUnionWithTypedArrays", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28172( cx, "TestJSImplInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28171 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28172( cx, "TestJSImplInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28172 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28172( cx, "TestJSImplInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28173 | |||||
| 28174 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28175 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArrays", 1)) { | ||||
| 28176 | return false; | ||||
| 28177 | } | ||||
| 28178 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28179 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28180 | if (objIsXray) { | ||||
| 28181 | unwrappedObj.emplace(cx, obj); | ||||
| 28182 | } | ||||
| 28183 | ArrayBufferViewOrArrayBuffer arg0; | ||||
| 28184 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28185 | return false; | ||||
| 28186 | } | ||||
| 28187 | if (objIsXray) { | ||||
| 28188 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28189 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28190 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28191 | if (!unwrappedObj.ref()) { | ||||
| 28192 | return false; | ||||
| 28193 | } | ||||
| 28194 | } | ||||
| 28195 | FastErrorResult rv; | ||||
| 28196 | // NOTE: This assert does NOT call the function. | ||||
| 28197 | 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"); | ||||
| 28198 | MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28199 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays" )), 0))) { | ||||
| 28200 | return false; | ||||
| 28201 | } | ||||
| 28202 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28202); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28202; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28203 | args.rval().setUndefined(); | ||||
| 28204 | return true; | ||||
| 28205 | } | ||||
| 28206 | |||||
| 28207 | static const JSJitInfo passUnionWithTypedArrays_methodinfo = { | ||||
| 28208 | { (JSJitGetterOp)passUnionWithTypedArrays }, | ||||
| 28209 | { prototypes::id::TestJSImplInterface }, | ||||
| 28210 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28211 | JSJitInfo::Method, | ||||
| 28212 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28213 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28214 | false, /* isInfallible. False in setters. */ | ||||
| 28215 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28216 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28217 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28218 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28219 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28220 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28221 | }; | ||||
| 28222 | |||||
| 28223 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28224 | passUnionWithTypedArraysOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28225 | { | ||||
| 28226 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArraysOrNull"); | ||||
| 28227 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28230( cx, "TestJSImplInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28228 | "TestJSImplInterface", "passUnionWithTypedArraysOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28230( cx, "TestJSImplInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28229 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28230( cx, "TestJSImplInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28230 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28230( cx, "TestJSImplInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28231 | |||||
| 28232 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28233 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull", 1)) { | ||||
| 28234 | return false; | ||||
| 28235 | } | ||||
| 28236 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28237 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28238 | if (objIsXray) { | ||||
| 28239 | unwrappedObj.emplace(cx, obj); | ||||
| 28240 | } | ||||
| 28241 | ArrayBufferViewOrArrayBufferOrNull arg0; | ||||
| 28242 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28243 | return false; | ||||
| 28244 | } | ||||
| 28245 | if (objIsXray) { | ||||
| 28246 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28247 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28248 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28249 | if (!unwrappedObj.ref()) { | ||||
| 28250 | return false; | ||||
| 28251 | } | ||||
| 28252 | } | ||||
| 28253 | FastErrorResult rv; | ||||
| 28254 | // NOTE: This assert does NOT call the function. | ||||
| 28255 | 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"); | ||||
| 28256 | MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28257 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull" )), 0))) { | ||||
| 28258 | return false; | ||||
| 28259 | } | ||||
| 28260 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28260); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28260; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28261 | args.rval().setUndefined(); | ||||
| 28262 | return true; | ||||
| 28263 | } | ||||
| 28264 | |||||
| 28265 | static const JSJitInfo passUnionWithTypedArraysOrNull_methodinfo = { | ||||
| 28266 | { (JSJitGetterOp)passUnionWithTypedArraysOrNull }, | ||||
| 28267 | { prototypes::id::TestJSImplInterface }, | ||||
| 28268 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28269 | JSJitInfo::Method, | ||||
| 28270 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28271 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28272 | false, /* isInfallible. False in setters. */ | ||||
| 28273 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28274 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28275 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28276 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28277 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28278 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28279 | }; | ||||
| 28280 | |||||
| 28281 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28282 | passUnionWithString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28283 | { | ||||
| 28284 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithString"); | ||||
| 28285 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28288( cx, "TestJSImplInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28286 | "TestJSImplInterface", "passUnionWithString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28288( cx, "TestJSImplInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28287 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28288( cx, "TestJSImplInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28288 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28288( cx, "TestJSImplInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 28289 | |||||
| 28290 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28291 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithString", 1)) { | ||||
| 28292 | return false; | ||||
| 28293 | } | ||||
| 28294 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28295 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28296 | if (objIsXray) { | ||||
| 28297 | unwrappedObj.emplace(cx, obj); | ||||
| 28298 | } | ||||
| 28299 | StringOrObject arg0; | ||||
| 28300 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28301 | return false; | ||||
| 28302 | } | ||||
| 28303 | if (objIsXray) { | ||||
| 28304 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28305 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28306 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28307 | if (!unwrappedObj.ref()) { | ||||
| 28308 | return false; | ||||
| 28309 | } | ||||
| 28310 | } | ||||
| 28311 | FastErrorResult rv; | ||||
| 28312 | // NOTE: This assert does NOT call the function. | ||||
| 28313 | 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"); | ||||
| 28314 | MOZ_KnownLive(self)(self)->PassUnionWithString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28315 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString" )), 0))) { | ||||
| 28316 | return false; | ||||
| 28317 | } | ||||
| 28318 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28318); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28318; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28319 | args.rval().setUndefined(); | ||||
| 28320 | return true; | ||||
| 28321 | } | ||||
| 28322 | |||||
| 28323 | static const JSJitInfo passUnionWithString_methodinfo = { | ||||
| 28324 | { (JSJitGetterOp)passUnionWithString }, | ||||
| 28325 | { prototypes::id::TestJSImplInterface }, | ||||
| 28326 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28327 | JSJitInfo::Method, | ||||
| 28328 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28329 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28330 | false, /* isInfallible. False in setters. */ | ||||
| 28331 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28332 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28333 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28334 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28335 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28336 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28337 | }; | ||||
| 28338 | |||||
| 28339 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28340 | passUnionWithEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28341 | { | ||||
| 28342 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithEnum"); | ||||
| 28343 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28346( cx, "TestJSImplInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28344 | "TestJSImplInterface", "passUnionWithEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28346( cx, "TestJSImplInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28345 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28346( cx, "TestJSImplInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28346 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28346( cx, "TestJSImplInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 28347 | |||||
| 28348 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28349 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithEnum", 1)) { | ||||
| 28350 | return false; | ||||
| 28351 | } | ||||
| 28352 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28353 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28354 | if (objIsXray) { | ||||
| 28355 | unwrappedObj.emplace(cx, obj); | ||||
| 28356 | } | ||||
| 28357 | SupportedTypeOrObject arg0; | ||||
| 28358 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28359 | return false; | ||||
| 28360 | } | ||||
| 28361 | if (objIsXray) { | ||||
| 28362 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28363 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28364 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28365 | if (!unwrappedObj.ref()) { | ||||
| 28366 | return false; | ||||
| 28367 | } | ||||
| 28368 | } | ||||
| 28369 | FastErrorResult rv; | ||||
| 28370 | // NOTE: This assert does NOT call the function. | ||||
| 28371 | 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"); | ||||
| 28372 | MOZ_KnownLive(self)(self)->PassUnionWithEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28373 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum" )), 0))) { | ||||
| 28374 | return false; | ||||
| 28375 | } | ||||
| 28376 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28376); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28376; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28377 | args.rval().setUndefined(); | ||||
| 28378 | return true; | ||||
| 28379 | } | ||||
| 28380 | |||||
| 28381 | static const JSJitInfo passUnionWithEnum_methodinfo = { | ||||
| 28382 | { (JSJitGetterOp)passUnionWithEnum }, | ||||
| 28383 | { prototypes::id::TestJSImplInterface }, | ||||
| 28384 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28385 | JSJitInfo::Method, | ||||
| 28386 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28387 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28388 | false, /* isInfallible. False in setters. */ | ||||
| 28389 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28390 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28391 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28392 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28393 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28394 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28395 | }; | ||||
| 28396 | |||||
| 28397 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28398 | passUnionWithObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28399 | { | ||||
| 28400 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithObject"); | ||||
| 28401 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28404( cx, "TestJSImplInterface" , "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28402 | "TestJSImplInterface", "passUnionWithObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28404( cx, "TestJSImplInterface" , "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28403 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28404( cx, "TestJSImplInterface" , "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 28404 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28404( cx, "TestJSImplInterface" , "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 28405 | |||||
| 28406 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28407 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithObject", 1)) { | ||||
| 28408 | return false; | ||||
| 28409 | } | ||||
| 28410 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28411 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28412 | if (objIsXray) { | ||||
| 28413 | unwrappedObj.emplace(cx, obj); | ||||
| 28414 | } | ||||
| 28415 | ObjectOrLong arg0; | ||||
| 28416 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28417 | return false; | ||||
| 28418 | } | ||||
| 28419 | if (objIsXray) { | ||||
| 28420 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28421 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28422 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28423 | if (!unwrappedObj.ref()) { | ||||
| 28424 | return false; | ||||
| 28425 | } | ||||
| 28426 | } | ||||
| 28427 | FastErrorResult rv; | ||||
| 28428 | // NOTE: This assert does NOT call the function. | ||||
| 28429 | 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"); | ||||
| 28430 | MOZ_KnownLive(self)(self)->PassUnionWithObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28431 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject" )), 0))) { | ||||
| 28432 | return false; | ||||
| 28433 | } | ||||
| 28434 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28434); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28434; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28435 | args.rval().setUndefined(); | ||||
| 28436 | return true; | ||||
| 28437 | } | ||||
| 28438 | |||||
| 28439 | static const JSJitInfo passUnionWithObject_methodinfo = { | ||||
| 28440 | { (JSJitGetterOp)passUnionWithObject }, | ||||
| 28441 | { prototypes::id::TestJSImplInterface }, | ||||
| 28442 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28443 | JSJitInfo::Method, | ||||
| 28444 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28445 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28446 | false, /* isInfallible. False in setters. */ | ||||
| 28447 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28448 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28449 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28450 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28451 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28452 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28453 | }; | ||||
| 28454 | |||||
| 28455 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28456 | passUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28457 | { | ||||
| 28458 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue1"); | ||||
| 28459 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28462( cx, "TestJSImplInterface" , "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28460 | "TestJSImplInterface", "passUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28462( cx, "TestJSImplInterface" , "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28461 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28462( cx, "TestJSImplInterface" , "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28462 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28462( cx, "TestJSImplInterface" , "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28463 | |||||
| 28464 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28465 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28466 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28467 | if (objIsXray) { | ||||
| 28468 | unwrappedObj.emplace(cx, obj); | ||||
| 28469 | } | ||||
| 28470 | DoubleOrString arg0; | ||||
| 28471 | if (!(args.hasDefined(0))) { | ||||
| 28472 | arg0.SetStringLiteral(u""); | ||||
| 28473 | } else { | ||||
| 28474 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28475 | return false; | ||||
| 28476 | } | ||||
| 28477 | } | ||||
| 28478 | if (objIsXray) { | ||||
| 28479 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28480 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28481 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28482 | if (!unwrappedObj.ref()) { | ||||
| 28483 | return false; | ||||
| 28484 | } | ||||
| 28485 | } | ||||
| 28486 | FastErrorResult rv; | ||||
| 28487 | // NOTE: This assert does NOT call the function. | ||||
| 28488 | 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"); | ||||
| 28489 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28490 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1" )), 0))) { | ||||
| 28491 | return false; | ||||
| 28492 | } | ||||
| 28493 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28493); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28493; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28494 | args.rval().setUndefined(); | ||||
| 28495 | return true; | ||||
| 28496 | } | ||||
| 28497 | |||||
| 28498 | static const JSJitInfo passUnionWithDefaultValue1_methodinfo = { | ||||
| 28499 | { (JSJitGetterOp)passUnionWithDefaultValue1 }, | ||||
| 28500 | { prototypes::id::TestJSImplInterface }, | ||||
| 28501 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28502 | JSJitInfo::Method, | ||||
| 28503 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28504 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28505 | false, /* isInfallible. False in setters. */ | ||||
| 28506 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28507 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28508 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28509 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28510 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28511 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28512 | }; | ||||
| 28513 | |||||
| 28514 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28515 | passUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28516 | { | ||||
| 28517 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue2"); | ||||
| 28518 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28521( cx, "TestJSImplInterface" , "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28519 | "TestJSImplInterface", "passUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28521( cx, "TestJSImplInterface" , "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28520 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28521( cx, "TestJSImplInterface" , "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28521 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28521( cx, "TestJSImplInterface" , "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28522 | |||||
| 28523 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28524 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28525 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28526 | if (objIsXray) { | ||||
| 28527 | unwrappedObj.emplace(cx, obj); | ||||
| 28528 | } | ||||
| 28529 | DoubleOrString arg0; | ||||
| 28530 | if (!(args.hasDefined(0))) { | ||||
| 28531 | arg0.RawSetAsDouble() = 1.0; | ||||
| 28532 | } else { | ||||
| 28533 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28534 | return false; | ||||
| 28535 | } | ||||
| 28536 | } | ||||
| 28537 | if (objIsXray) { | ||||
| 28538 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28539 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28540 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28541 | if (!unwrappedObj.ref()) { | ||||
| 28542 | return false; | ||||
| 28543 | } | ||||
| 28544 | } | ||||
| 28545 | FastErrorResult rv; | ||||
| 28546 | // NOTE: This assert does NOT call the function. | ||||
| 28547 | 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"); | ||||
| 28548 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28549 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2" )), 0))) { | ||||
| 28550 | return false; | ||||
| 28551 | } | ||||
| 28552 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28552); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28552; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28553 | args.rval().setUndefined(); | ||||
| 28554 | return true; | ||||
| 28555 | } | ||||
| 28556 | |||||
| 28557 | static const JSJitInfo passUnionWithDefaultValue2_methodinfo = { | ||||
| 28558 | { (JSJitGetterOp)passUnionWithDefaultValue2 }, | ||||
| 28559 | { prototypes::id::TestJSImplInterface }, | ||||
| 28560 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28561 | JSJitInfo::Method, | ||||
| 28562 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28563 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28564 | false, /* isInfallible. False in setters. */ | ||||
| 28565 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28566 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28567 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28568 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28569 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28570 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28571 | }; | ||||
| 28572 | |||||
| 28573 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28574 | passUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28575 | { | ||||
| 28576 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue3"); | ||||
| 28577 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28580( cx, "TestJSImplInterface" , "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28578 | "TestJSImplInterface", "passUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28580( cx, "TestJSImplInterface" , "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28579 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28580( cx, "TestJSImplInterface" , "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28580 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28580( cx, "TestJSImplInterface" , "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28581 | |||||
| 28582 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28583 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28584 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28585 | if (objIsXray) { | ||||
| 28586 | unwrappedObj.emplace(cx, obj); | ||||
| 28587 | } | ||||
| 28588 | DoubleOrString arg0; | ||||
| 28589 | if (!(args.hasDefined(0))) { | ||||
| 28590 | arg0.RawSetAsDouble() = 1.5; | ||||
| 28591 | } else { | ||||
| 28592 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28593 | return false; | ||||
| 28594 | } | ||||
| 28595 | } | ||||
| 28596 | if (objIsXray) { | ||||
| 28597 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28598 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28599 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28600 | if (!unwrappedObj.ref()) { | ||||
| 28601 | return false; | ||||
| 28602 | } | ||||
| 28603 | } | ||||
| 28604 | FastErrorResult rv; | ||||
| 28605 | // NOTE: This assert does NOT call the function. | ||||
| 28606 | 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"); | ||||
| 28607 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28608 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3" )), 0))) { | ||||
| 28609 | return false; | ||||
| 28610 | } | ||||
| 28611 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28611); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28611; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28612 | args.rval().setUndefined(); | ||||
| 28613 | return true; | ||||
| 28614 | } | ||||
| 28615 | |||||
| 28616 | static const JSJitInfo passUnionWithDefaultValue3_methodinfo = { | ||||
| 28617 | { (JSJitGetterOp)passUnionWithDefaultValue3 }, | ||||
| 28618 | { prototypes::id::TestJSImplInterface }, | ||||
| 28619 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28620 | JSJitInfo::Method, | ||||
| 28621 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28622 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28623 | false, /* isInfallible. False in setters. */ | ||||
| 28624 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28625 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28626 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28627 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28628 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28629 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28630 | }; | ||||
| 28631 | |||||
| 28632 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28633 | passUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28634 | { | ||||
| 28635 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue4"); | ||||
| 28636 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28639( cx, "TestJSImplInterface" , "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28637 | "TestJSImplInterface", "passUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28639( cx, "TestJSImplInterface" , "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28638 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28639( cx, "TestJSImplInterface" , "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28639 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28639( cx, "TestJSImplInterface" , "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28640 | |||||
| 28641 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28642 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28643 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28644 | if (objIsXray) { | ||||
| 28645 | unwrappedObj.emplace(cx, obj); | ||||
| 28646 | } | ||||
| 28647 | FloatOrString arg0; | ||||
| 28648 | if (!(args.hasDefined(0))) { | ||||
| 28649 | arg0.SetStringLiteral(u""); | ||||
| 28650 | } else { | ||||
| 28651 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28652 | return false; | ||||
| 28653 | } | ||||
| 28654 | } | ||||
| 28655 | if (objIsXray) { | ||||
| 28656 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28657 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28658 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28659 | if (!unwrappedObj.ref()) { | ||||
| 28660 | return false; | ||||
| 28661 | } | ||||
| 28662 | } | ||||
| 28663 | FastErrorResult rv; | ||||
| 28664 | // NOTE: This assert does NOT call the function. | ||||
| 28665 | 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"); | ||||
| 28666 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28667 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4" )), 0))) { | ||||
| 28668 | return false; | ||||
| 28669 | } | ||||
| 28670 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28670); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28670; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28671 | args.rval().setUndefined(); | ||||
| 28672 | return true; | ||||
| 28673 | } | ||||
| 28674 | |||||
| 28675 | static const JSJitInfo passUnionWithDefaultValue4_methodinfo = { | ||||
| 28676 | { (JSJitGetterOp)passUnionWithDefaultValue4 }, | ||||
| 28677 | { prototypes::id::TestJSImplInterface }, | ||||
| 28678 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28679 | JSJitInfo::Method, | ||||
| 28680 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28681 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28682 | false, /* isInfallible. False in setters. */ | ||||
| 28683 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28684 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28685 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28686 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28687 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28688 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28689 | }; | ||||
| 28690 | |||||
| 28691 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28692 | passUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28693 | { | ||||
| 28694 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue5"); | ||||
| 28695 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28698( cx, "TestJSImplInterface" , "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28696 | "TestJSImplInterface", "passUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28698( cx, "TestJSImplInterface" , "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28697 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28698( cx, "TestJSImplInterface" , "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28698 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28698( cx, "TestJSImplInterface" , "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28699 | |||||
| 28700 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28701 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28702 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28703 | if (objIsXray) { | ||||
| 28704 | unwrappedObj.emplace(cx, obj); | ||||
| 28705 | } | ||||
| 28706 | FloatOrString arg0; | ||||
| 28707 | if (!(args.hasDefined(0))) { | ||||
| 28708 | arg0.RawSetAsFloat() = 1.0F; | ||||
| 28709 | } else { | ||||
| 28710 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28711 | return false; | ||||
| 28712 | } | ||||
| 28713 | } | ||||
| 28714 | if (objIsXray) { | ||||
| 28715 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28716 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28717 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28718 | if (!unwrappedObj.ref()) { | ||||
| 28719 | return false; | ||||
| 28720 | } | ||||
| 28721 | } | ||||
| 28722 | FastErrorResult rv; | ||||
| 28723 | // NOTE: This assert does NOT call the function. | ||||
| 28724 | 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"); | ||||
| 28725 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28726 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5" )), 0))) { | ||||
| 28727 | return false; | ||||
| 28728 | } | ||||
| 28729 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28729); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28729; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28730 | args.rval().setUndefined(); | ||||
| 28731 | return true; | ||||
| 28732 | } | ||||
| 28733 | |||||
| 28734 | static const JSJitInfo passUnionWithDefaultValue5_methodinfo = { | ||||
| 28735 | { (JSJitGetterOp)passUnionWithDefaultValue5 }, | ||||
| 28736 | { prototypes::id::TestJSImplInterface }, | ||||
| 28737 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28738 | JSJitInfo::Method, | ||||
| 28739 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28740 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28741 | false, /* isInfallible. False in setters. */ | ||||
| 28742 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28743 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28744 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28745 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28746 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28747 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28748 | }; | ||||
| 28749 | |||||
| 28750 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28751 | passUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28752 | { | ||||
| 28753 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue6"); | ||||
| 28754 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28757( cx, "TestJSImplInterface" , "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28755 | "TestJSImplInterface", "passUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28757( cx, "TestJSImplInterface" , "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28756 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28757( cx, "TestJSImplInterface" , "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28757 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28757( cx, "TestJSImplInterface" , "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28758 | |||||
| 28759 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28760 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28761 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28762 | if (objIsXray) { | ||||
| 28763 | unwrappedObj.emplace(cx, obj); | ||||
| 28764 | } | ||||
| 28765 | FloatOrString arg0; | ||||
| 28766 | if (!(args.hasDefined(0))) { | ||||
| 28767 | arg0.RawSetAsFloat() = 1.5F; | ||||
| 28768 | } else { | ||||
| 28769 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28770 | return false; | ||||
| 28771 | } | ||||
| 28772 | } | ||||
| 28773 | if (objIsXray) { | ||||
| 28774 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28775 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28776 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28777 | if (!unwrappedObj.ref()) { | ||||
| 28778 | return false; | ||||
| 28779 | } | ||||
| 28780 | } | ||||
| 28781 | FastErrorResult rv; | ||||
| 28782 | // NOTE: This assert does NOT call the function. | ||||
| 28783 | 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"); | ||||
| 28784 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28785 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6" )), 0))) { | ||||
| 28786 | return false; | ||||
| 28787 | } | ||||
| 28788 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28788); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28788; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28789 | args.rval().setUndefined(); | ||||
| 28790 | return true; | ||||
| 28791 | } | ||||
| 28792 | |||||
| 28793 | static const JSJitInfo passUnionWithDefaultValue6_methodinfo = { | ||||
| 28794 | { (JSJitGetterOp)passUnionWithDefaultValue6 }, | ||||
| 28795 | { prototypes::id::TestJSImplInterface }, | ||||
| 28796 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28797 | JSJitInfo::Method, | ||||
| 28798 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28799 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28800 | false, /* isInfallible. False in setters. */ | ||||
| 28801 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28802 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28803 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28804 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28805 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28806 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28807 | }; | ||||
| 28808 | |||||
| 28809 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28810 | passUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28811 | { | ||||
| 28812 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue7"); | ||||
| 28813 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28816( cx, "TestJSImplInterface" , "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28814 | "TestJSImplInterface", "passUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28816( cx, "TestJSImplInterface" , "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28815 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28816( cx, "TestJSImplInterface" , "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28816 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28816( cx, "TestJSImplInterface" , "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28817 | |||||
| 28818 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28819 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28820 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28821 | if (objIsXray) { | ||||
| 28822 | unwrappedObj.emplace(cx, obj); | ||||
| 28823 | } | ||||
| 28824 | UnrestrictedDoubleOrString arg0; | ||||
| 28825 | if (!(args.hasDefined(0))) { | ||||
| 28826 | arg0.SetStringLiteral(u""); | ||||
| 28827 | } else { | ||||
| 28828 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28829 | return false; | ||||
| 28830 | } | ||||
| 28831 | } | ||||
| 28832 | if (objIsXray) { | ||||
| 28833 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28834 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28835 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28836 | if (!unwrappedObj.ref()) { | ||||
| 28837 | return false; | ||||
| 28838 | } | ||||
| 28839 | } | ||||
| 28840 | FastErrorResult rv; | ||||
| 28841 | // NOTE: This assert does NOT call the function. | ||||
| 28842 | 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"); | ||||
| 28843 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28844 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7" )), 0))) { | ||||
| 28845 | return false; | ||||
| 28846 | } | ||||
| 28847 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28847); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28847; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28848 | args.rval().setUndefined(); | ||||
| 28849 | return true; | ||||
| 28850 | } | ||||
| 28851 | |||||
| 28852 | static const JSJitInfo passUnionWithDefaultValue7_methodinfo = { | ||||
| 28853 | { (JSJitGetterOp)passUnionWithDefaultValue7 }, | ||||
| 28854 | { prototypes::id::TestJSImplInterface }, | ||||
| 28855 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28856 | JSJitInfo::Method, | ||||
| 28857 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28858 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28859 | false, /* isInfallible. False in setters. */ | ||||
| 28860 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28861 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28862 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28863 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28864 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28865 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28866 | }; | ||||
| 28867 | |||||
| 28868 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28869 | passUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28870 | { | ||||
| 28871 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue8"); | ||||
| 28872 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28875( cx, "TestJSImplInterface" , "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28873 | "TestJSImplInterface", "passUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28875( cx, "TestJSImplInterface" , "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28874 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28875( cx, "TestJSImplInterface" , "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28875 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28875( cx, "TestJSImplInterface" , "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28876 | |||||
| 28877 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28878 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28879 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28880 | if (objIsXray) { | ||||
| 28881 | unwrappedObj.emplace(cx, obj); | ||||
| 28882 | } | ||||
| 28883 | UnrestrictedDoubleOrString arg0; | ||||
| 28884 | if (!(args.hasDefined(0))) { | ||||
| 28885 | arg0.RawSetAsUnrestrictedDouble() = 1.0; | ||||
| 28886 | } else { | ||||
| 28887 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28888 | return false; | ||||
| 28889 | } | ||||
| 28890 | } | ||||
| 28891 | if (objIsXray) { | ||||
| 28892 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28893 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28894 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28895 | if (!unwrappedObj.ref()) { | ||||
| 28896 | return false; | ||||
| 28897 | } | ||||
| 28898 | } | ||||
| 28899 | FastErrorResult rv; | ||||
| 28900 | // NOTE: This assert does NOT call the function. | ||||
| 28901 | 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"); | ||||
| 28902 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28903 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8" )), 0))) { | ||||
| 28904 | return false; | ||||
| 28905 | } | ||||
| 28906 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28906); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28906; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28907 | args.rval().setUndefined(); | ||||
| 28908 | return true; | ||||
| 28909 | } | ||||
| 28910 | |||||
| 28911 | static const JSJitInfo passUnionWithDefaultValue8_methodinfo = { | ||||
| 28912 | { (JSJitGetterOp)passUnionWithDefaultValue8 }, | ||||
| 28913 | { prototypes::id::TestJSImplInterface }, | ||||
| 28914 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28915 | JSJitInfo::Method, | ||||
| 28916 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28917 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28918 | false, /* isInfallible. False in setters. */ | ||||
| 28919 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28920 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28921 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28922 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28923 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28924 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28925 | }; | ||||
| 28926 | |||||
| 28927 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28928 | passUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28929 | { | ||||
| 28930 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue9"); | ||||
| 28931 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28934( cx, "TestJSImplInterface" , "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28932 | "TestJSImplInterface", "passUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28934( cx, "TestJSImplInterface" , "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28933 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28934( cx, "TestJSImplInterface" , "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28934 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28934( cx, "TestJSImplInterface" , "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28935 | |||||
| 28936 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28937 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28938 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28939 | if (objIsXray) { | ||||
| 28940 | unwrappedObj.emplace(cx, obj); | ||||
| 28941 | } | ||||
| 28942 | UnrestrictedDoubleOrString arg0; | ||||
| 28943 | if (!(args.hasDefined(0))) { | ||||
| 28944 | arg0.RawSetAsUnrestrictedDouble() = 1.5; | ||||
| 28945 | } else { | ||||
| 28946 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 28947 | return false; | ||||
| 28948 | } | ||||
| 28949 | } | ||||
| 28950 | if (objIsXray) { | ||||
| 28951 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 28952 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 28953 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 28954 | if (!unwrappedObj.ref()) { | ||||
| 28955 | return false; | ||||
| 28956 | } | ||||
| 28957 | } | ||||
| 28958 | FastErrorResult rv; | ||||
| 28959 | // NOTE: This assert does NOT call the function. | ||||
| 28960 | 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"); | ||||
| 28961 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 28962 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9" )), 0))) { | ||||
| 28963 | return false; | ||||
| 28964 | } | ||||
| 28965 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 28965); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 28965; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 28966 | args.rval().setUndefined(); | ||||
| 28967 | return true; | ||||
| 28968 | } | ||||
| 28969 | |||||
| 28970 | static const JSJitInfo passUnionWithDefaultValue9_methodinfo = { | ||||
| 28971 | { (JSJitGetterOp)passUnionWithDefaultValue9 }, | ||||
| 28972 | { prototypes::id::TestJSImplInterface }, | ||||
| 28973 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 28974 | JSJitInfo::Method, | ||||
| 28975 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 28976 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 28977 | false, /* isInfallible. False in setters. */ | ||||
| 28978 | false, /* isMovable. Not relevant for setters. */ | ||||
| 28979 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 28980 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 28981 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 28982 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 28983 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 28984 | }; | ||||
| 28985 | |||||
| 28986 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 28987 | passUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 28988 | { | ||||
| 28989 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue10"); | ||||
| 28990 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28993( cx, "TestJSImplInterface" , "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28991 | "TestJSImplInterface", "passUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28993( cx, "TestJSImplInterface" , "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28992 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28993( cx, "TestJSImplInterface" , "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 28993 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28993( cx, "TestJSImplInterface" , "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 28994 | |||||
| 28995 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 28996 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 28997 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 28998 | if (objIsXray) { | ||||
| 28999 | unwrappedObj.emplace(cx, obj); | ||||
| 29000 | } | ||||
| 29001 | UnrestrictedDoubleOrString arg0; | ||||
| 29002 | if (!(args.hasDefined(0))) { | ||||
| 29003 | arg0.RawSetAsUnrestrictedDouble() = mozilla::PositiveInfinity<double>(); | ||||
| 29004 | } else { | ||||
| 29005 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29006 | return false; | ||||
| 29007 | } | ||||
| 29008 | } | ||||
| 29009 | if (objIsXray) { | ||||
| 29010 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29011 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29012 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29013 | if (!unwrappedObj.ref()) { | ||||
| 29014 | return false; | ||||
| 29015 | } | ||||
| 29016 | } | ||||
| 29017 | FastErrorResult rv; | ||||
| 29018 | // NOTE: This assert does NOT call the function. | ||||
| 29019 | 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"); | ||||
| 29020 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29021 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10" )), 0))) { | ||||
| 29022 | return false; | ||||
| 29023 | } | ||||
| 29024 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29024); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29024; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29025 | args.rval().setUndefined(); | ||||
| 29026 | return true; | ||||
| 29027 | } | ||||
| 29028 | |||||
| 29029 | static const JSJitInfo passUnionWithDefaultValue10_methodinfo = { | ||||
| 29030 | { (JSJitGetterOp)passUnionWithDefaultValue10 }, | ||||
| 29031 | { prototypes::id::TestJSImplInterface }, | ||||
| 29032 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29033 | JSJitInfo::Method, | ||||
| 29034 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29035 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29036 | false, /* isInfallible. False in setters. */ | ||||
| 29037 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29038 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29039 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29040 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29041 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29042 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29043 | }; | ||||
| 29044 | |||||
| 29045 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29046 | passUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29047 | { | ||||
| 29048 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue11"); | ||||
| 29049 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29052( cx, "TestJSImplInterface" , "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29050 | "TestJSImplInterface", "passUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29052( cx, "TestJSImplInterface" , "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29051 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29052( cx, "TestJSImplInterface" , "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29052 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29052( cx, "TestJSImplInterface" , "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29053 | |||||
| 29054 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29055 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29056 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29057 | if (objIsXray) { | ||||
| 29058 | unwrappedObj.emplace(cx, obj); | ||||
| 29059 | } | ||||
| 29060 | UnrestrictedFloatOrString arg0; | ||||
| 29061 | if (!(args.hasDefined(0))) { | ||||
| 29062 | arg0.SetStringLiteral(u""); | ||||
| 29063 | } else { | ||||
| 29064 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29065 | return false; | ||||
| 29066 | } | ||||
| 29067 | } | ||||
| 29068 | if (objIsXray) { | ||||
| 29069 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29070 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29071 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29072 | if (!unwrappedObj.ref()) { | ||||
| 29073 | return false; | ||||
| 29074 | } | ||||
| 29075 | } | ||||
| 29076 | FastErrorResult rv; | ||||
| 29077 | // NOTE: This assert does NOT call the function. | ||||
| 29078 | 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"); | ||||
| 29079 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29080 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11" )), 0))) { | ||||
| 29081 | return false; | ||||
| 29082 | } | ||||
| 29083 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29083); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29083; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29084 | args.rval().setUndefined(); | ||||
| 29085 | return true; | ||||
| 29086 | } | ||||
| 29087 | |||||
| 29088 | static const JSJitInfo passUnionWithDefaultValue11_methodinfo = { | ||||
| 29089 | { (JSJitGetterOp)passUnionWithDefaultValue11 }, | ||||
| 29090 | { prototypes::id::TestJSImplInterface }, | ||||
| 29091 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29092 | JSJitInfo::Method, | ||||
| 29093 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29094 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29095 | false, /* isInfallible. False in setters. */ | ||||
| 29096 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29097 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29098 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29099 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29100 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29101 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29102 | }; | ||||
| 29103 | |||||
| 29104 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29105 | passUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29106 | { | ||||
| 29107 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue12"); | ||||
| 29108 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29111( cx, "TestJSImplInterface" , "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29109 | "TestJSImplInterface", "passUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29111( cx, "TestJSImplInterface" , "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29110 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29111( cx, "TestJSImplInterface" , "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29111 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29111( cx, "TestJSImplInterface" , "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29112 | |||||
| 29113 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29114 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29115 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29116 | if (objIsXray) { | ||||
| 29117 | unwrappedObj.emplace(cx, obj); | ||||
| 29118 | } | ||||
| 29119 | UnrestrictedFloatOrString arg0; | ||||
| 29120 | if (!(args.hasDefined(0))) { | ||||
| 29121 | arg0.RawSetAsUnrestrictedFloat() = 1.0F; | ||||
| 29122 | } else { | ||||
| 29123 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29124 | return false; | ||||
| 29125 | } | ||||
| 29126 | } | ||||
| 29127 | if (objIsXray) { | ||||
| 29128 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29129 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29130 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29131 | if (!unwrappedObj.ref()) { | ||||
| 29132 | return false; | ||||
| 29133 | } | ||||
| 29134 | } | ||||
| 29135 | FastErrorResult rv; | ||||
| 29136 | // NOTE: This assert does NOT call the function. | ||||
| 29137 | 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"); | ||||
| 29138 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29139 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12" )), 0))) { | ||||
| 29140 | return false; | ||||
| 29141 | } | ||||
| 29142 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29142); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29142; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29143 | args.rval().setUndefined(); | ||||
| 29144 | return true; | ||||
| 29145 | } | ||||
| 29146 | |||||
| 29147 | static const JSJitInfo passUnionWithDefaultValue12_methodinfo = { | ||||
| 29148 | { (JSJitGetterOp)passUnionWithDefaultValue12 }, | ||||
| 29149 | { prototypes::id::TestJSImplInterface }, | ||||
| 29150 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29151 | JSJitInfo::Method, | ||||
| 29152 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29153 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29154 | false, /* isInfallible. False in setters. */ | ||||
| 29155 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29156 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29157 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29158 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29159 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29160 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29161 | }; | ||||
| 29162 | |||||
| 29163 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29164 | passUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29165 | { | ||||
| 29166 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue13"); | ||||
| 29167 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29170( cx, "TestJSImplInterface" , "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29168 | "TestJSImplInterface", "passUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29170( cx, "TestJSImplInterface" , "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29169 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29170( cx, "TestJSImplInterface" , "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29170 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29170( cx, "TestJSImplInterface" , "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29171 | |||||
| 29172 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29173 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29174 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29175 | if (objIsXray) { | ||||
| 29176 | unwrappedObj.emplace(cx, obj); | ||||
| 29177 | } | ||||
| 29178 | UnrestrictedFloatOrString arg0; | ||||
| 29179 | if (!(args.hasDefined(0))) { | ||||
| 29180 | arg0.RawSetAsUnrestrictedFloat() = mozilla::PositiveInfinity<float>(); | ||||
| 29181 | } else { | ||||
| 29182 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29183 | return false; | ||||
| 29184 | } | ||||
| 29185 | } | ||||
| 29186 | if (objIsXray) { | ||||
| 29187 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29188 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29189 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29190 | if (!unwrappedObj.ref()) { | ||||
| 29191 | return false; | ||||
| 29192 | } | ||||
| 29193 | } | ||||
| 29194 | FastErrorResult rv; | ||||
| 29195 | // NOTE: This assert does NOT call the function. | ||||
| 29196 | 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"); | ||||
| 29197 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29198 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13" )), 0))) { | ||||
| 29199 | return false; | ||||
| 29200 | } | ||||
| 29201 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29201; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29202 | args.rval().setUndefined(); | ||||
| 29203 | return true; | ||||
| 29204 | } | ||||
| 29205 | |||||
| 29206 | static const JSJitInfo passUnionWithDefaultValue13_methodinfo = { | ||||
| 29207 | { (JSJitGetterOp)passUnionWithDefaultValue13 }, | ||||
| 29208 | { prototypes::id::TestJSImplInterface }, | ||||
| 29209 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29210 | JSJitInfo::Method, | ||||
| 29211 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29212 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29213 | false, /* isInfallible. False in setters. */ | ||||
| 29214 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29215 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29216 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29217 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29218 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29219 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29220 | }; | ||||
| 29221 | |||||
| 29222 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29223 | passUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29224 | { | ||||
| 29225 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue14"); | ||||
| 29226 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29229( cx, "TestJSImplInterface" , "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29227 | "TestJSImplInterface", "passUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29229( cx, "TestJSImplInterface" , "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29228 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29229( cx, "TestJSImplInterface" , "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29229 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29229( cx, "TestJSImplInterface" , "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29230 | |||||
| 29231 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29232 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29233 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29234 | if (objIsXray) { | ||||
| 29235 | unwrappedObj.emplace(cx, obj); | ||||
| 29236 | } | ||||
| 29237 | DoubleOrByteString arg0; | ||||
| 29238 | if (!(args.hasDefined(0))) { | ||||
| 29239 | arg0.SetStringLiteral(""); | ||||
| 29240 | } else { | ||||
| 29241 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29242 | return false; | ||||
| 29243 | } | ||||
| 29244 | } | ||||
| 29245 | if (objIsXray) { | ||||
| 29246 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29247 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29248 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29249 | if (!unwrappedObj.ref()) { | ||||
| 29250 | return false; | ||||
| 29251 | } | ||||
| 29252 | } | ||||
| 29253 | FastErrorResult rv; | ||||
| 29254 | // NOTE: This assert does NOT call the function. | ||||
| 29255 | 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"); | ||||
| 29256 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29257 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14" )), 0))) { | ||||
| 29258 | return false; | ||||
| 29259 | } | ||||
| 29260 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29260); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29260; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29261 | args.rval().setUndefined(); | ||||
| 29262 | return true; | ||||
| 29263 | } | ||||
| 29264 | |||||
| 29265 | static const JSJitInfo passUnionWithDefaultValue14_methodinfo = { | ||||
| 29266 | { (JSJitGetterOp)passUnionWithDefaultValue14 }, | ||||
| 29267 | { prototypes::id::TestJSImplInterface }, | ||||
| 29268 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29269 | JSJitInfo::Method, | ||||
| 29270 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29271 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29272 | false, /* isInfallible. False in setters. */ | ||||
| 29273 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29274 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29275 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29276 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29277 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29278 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29279 | }; | ||||
| 29280 | |||||
| 29281 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29282 | passUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29283 | { | ||||
| 29284 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue15"); | ||||
| 29285 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29288( cx, "TestJSImplInterface" , "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29286 | "TestJSImplInterface", "passUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29288( cx, "TestJSImplInterface" , "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29287 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29288( cx, "TestJSImplInterface" , "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29288 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29288( cx, "TestJSImplInterface" , "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29289 | |||||
| 29290 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29291 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29292 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29293 | if (objIsXray) { | ||||
| 29294 | unwrappedObj.emplace(cx, obj); | ||||
| 29295 | } | ||||
| 29296 | DoubleOrByteString arg0; | ||||
| 29297 | if (!(args.hasDefined(0))) { | ||||
| 29298 | arg0.RawSetAsDouble() = 1.0; | ||||
| 29299 | } else { | ||||
| 29300 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29301 | return false; | ||||
| 29302 | } | ||||
| 29303 | } | ||||
| 29304 | if (objIsXray) { | ||||
| 29305 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29306 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29307 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29308 | if (!unwrappedObj.ref()) { | ||||
| 29309 | return false; | ||||
| 29310 | } | ||||
| 29311 | } | ||||
| 29312 | FastErrorResult rv; | ||||
| 29313 | // NOTE: This assert does NOT call the function. | ||||
| 29314 | 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"); | ||||
| 29315 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29316 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15" )), 0))) { | ||||
| 29317 | return false; | ||||
| 29318 | } | ||||
| 29319 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29319); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29319; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29320 | args.rval().setUndefined(); | ||||
| 29321 | return true; | ||||
| 29322 | } | ||||
| 29323 | |||||
| 29324 | static const JSJitInfo passUnionWithDefaultValue15_methodinfo = { | ||||
| 29325 | { (JSJitGetterOp)passUnionWithDefaultValue15 }, | ||||
| 29326 | { prototypes::id::TestJSImplInterface }, | ||||
| 29327 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29328 | JSJitInfo::Method, | ||||
| 29329 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29330 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29331 | false, /* isInfallible. False in setters. */ | ||||
| 29332 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29333 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29334 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29335 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29336 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29337 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29338 | }; | ||||
| 29339 | |||||
| 29340 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29341 | passUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29342 | { | ||||
| 29343 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue16"); | ||||
| 29344 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29347( cx, "TestJSImplInterface" , "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29345 | "TestJSImplInterface", "passUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29347( cx, "TestJSImplInterface" , "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29346 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29347( cx, "TestJSImplInterface" , "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29347 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29347( cx, "TestJSImplInterface" , "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29348 | |||||
| 29349 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29350 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29351 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29352 | if (objIsXray) { | ||||
| 29353 | unwrappedObj.emplace(cx, obj); | ||||
| 29354 | } | ||||
| 29355 | DoubleOrByteString arg0; | ||||
| 29356 | if (!(args.hasDefined(0))) { | ||||
| 29357 | arg0.RawSetAsDouble() = 1.5; | ||||
| 29358 | } else { | ||||
| 29359 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29360 | return false; | ||||
| 29361 | } | ||||
| 29362 | } | ||||
| 29363 | if (objIsXray) { | ||||
| 29364 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29365 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29366 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29367 | if (!unwrappedObj.ref()) { | ||||
| 29368 | return false; | ||||
| 29369 | } | ||||
| 29370 | } | ||||
| 29371 | FastErrorResult rv; | ||||
| 29372 | // NOTE: This assert does NOT call the function. | ||||
| 29373 | 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"); | ||||
| 29374 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29375 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16" )), 0))) { | ||||
| 29376 | return false; | ||||
| 29377 | } | ||||
| 29378 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29378; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29379 | args.rval().setUndefined(); | ||||
| 29380 | return true; | ||||
| 29381 | } | ||||
| 29382 | |||||
| 29383 | static const JSJitInfo passUnionWithDefaultValue16_methodinfo = { | ||||
| 29384 | { (JSJitGetterOp)passUnionWithDefaultValue16 }, | ||||
| 29385 | { prototypes::id::TestJSImplInterface }, | ||||
| 29386 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29387 | JSJitInfo::Method, | ||||
| 29388 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29389 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29390 | false, /* isInfallible. False in setters. */ | ||||
| 29391 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29392 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29393 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29394 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29395 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29396 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29397 | }; | ||||
| 29398 | |||||
| 29399 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29400 | passUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29401 | { | ||||
| 29402 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue17"); | ||||
| 29403 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29406( cx, "TestJSImplInterface" , "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29404 | "TestJSImplInterface", "passUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29406( cx, "TestJSImplInterface" , "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29405 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29406( cx, "TestJSImplInterface" , "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29406 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29406( cx, "TestJSImplInterface" , "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29407 | |||||
| 29408 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29409 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29410 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29411 | if (objIsXray) { | ||||
| 29412 | unwrappedObj.emplace(cx, obj); | ||||
| 29413 | } | ||||
| 29414 | DoubleOrSupportedType arg0; | ||||
| 29415 | if (!(args.hasDefined(0))) { | ||||
| 29416 | arg0.RawSetAsSupportedType() = SupportedType::Text_html; | ||||
| 29417 | } else { | ||||
| 29418 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29419 | return false; | ||||
| 29420 | } | ||||
| 29421 | } | ||||
| 29422 | if (objIsXray) { | ||||
| 29423 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29424 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29425 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29426 | if (!unwrappedObj.ref()) { | ||||
| 29427 | return false; | ||||
| 29428 | } | ||||
| 29429 | } | ||||
| 29430 | FastErrorResult rv; | ||||
| 29431 | // NOTE: This assert does NOT call the function. | ||||
| 29432 | 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"); | ||||
| 29433 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29434 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17" )), 0))) { | ||||
| 29435 | return false; | ||||
| 29436 | } | ||||
| 29437 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29437); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29437; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29438 | args.rval().setUndefined(); | ||||
| 29439 | return true; | ||||
| 29440 | } | ||||
| 29441 | |||||
| 29442 | static const JSJitInfo passUnionWithDefaultValue17_methodinfo = { | ||||
| 29443 | { (JSJitGetterOp)passUnionWithDefaultValue17 }, | ||||
| 29444 | { prototypes::id::TestJSImplInterface }, | ||||
| 29445 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29446 | JSJitInfo::Method, | ||||
| 29447 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29448 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29449 | false, /* isInfallible. False in setters. */ | ||||
| 29450 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29451 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29452 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29453 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29454 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29455 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29456 | }; | ||||
| 29457 | |||||
| 29458 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29459 | passUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29460 | { | ||||
| 29461 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue18"); | ||||
| 29462 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29465( cx, "TestJSImplInterface" , "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29463 | "TestJSImplInterface", "passUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29465( cx, "TestJSImplInterface" , "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29464 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29465( cx, "TestJSImplInterface" , "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29465 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29465( cx, "TestJSImplInterface" , "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29466 | |||||
| 29467 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29468 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29469 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29470 | if (objIsXray) { | ||||
| 29471 | unwrappedObj.emplace(cx, obj); | ||||
| 29472 | } | ||||
| 29473 | DoubleOrSupportedType arg0; | ||||
| 29474 | if (!(args.hasDefined(0))) { | ||||
| 29475 | arg0.RawSetAsDouble() = 1.0; | ||||
| 29476 | } else { | ||||
| 29477 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29478 | return false; | ||||
| 29479 | } | ||||
| 29480 | } | ||||
| 29481 | if (objIsXray) { | ||||
| 29482 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29483 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29484 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29485 | if (!unwrappedObj.ref()) { | ||||
| 29486 | return false; | ||||
| 29487 | } | ||||
| 29488 | } | ||||
| 29489 | FastErrorResult rv; | ||||
| 29490 | // NOTE: This assert does NOT call the function. | ||||
| 29491 | 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"); | ||||
| 29492 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29493 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18" )), 0))) { | ||||
| 29494 | return false; | ||||
| 29495 | } | ||||
| 29496 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29496); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29496; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29497 | args.rval().setUndefined(); | ||||
| 29498 | return true; | ||||
| 29499 | } | ||||
| 29500 | |||||
| 29501 | static const JSJitInfo passUnionWithDefaultValue18_methodinfo = { | ||||
| 29502 | { (JSJitGetterOp)passUnionWithDefaultValue18 }, | ||||
| 29503 | { prototypes::id::TestJSImplInterface }, | ||||
| 29504 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29505 | JSJitInfo::Method, | ||||
| 29506 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29507 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29508 | false, /* isInfallible. False in setters. */ | ||||
| 29509 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29510 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29511 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29512 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29513 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29514 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29515 | }; | ||||
| 29516 | |||||
| 29517 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29518 | passUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29519 | { | ||||
| 29520 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue19"); | ||||
| 29521 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29524( cx, "TestJSImplInterface" , "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29522 | "TestJSImplInterface", "passUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29524( cx, "TestJSImplInterface" , "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29523 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29524( cx, "TestJSImplInterface" , "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29524 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29524( cx, "TestJSImplInterface" , "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29525 | |||||
| 29526 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29527 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29528 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29529 | if (objIsXray) { | ||||
| 29530 | unwrappedObj.emplace(cx, obj); | ||||
| 29531 | } | ||||
| 29532 | DoubleOrSupportedType arg0; | ||||
| 29533 | if (!(args.hasDefined(0))) { | ||||
| 29534 | arg0.RawSetAsDouble() = 1.5; | ||||
| 29535 | } else { | ||||
| 29536 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29537 | return false; | ||||
| 29538 | } | ||||
| 29539 | } | ||||
| 29540 | if (objIsXray) { | ||||
| 29541 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29542 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29543 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29544 | if (!unwrappedObj.ref()) { | ||||
| 29545 | return false; | ||||
| 29546 | } | ||||
| 29547 | } | ||||
| 29548 | FastErrorResult rv; | ||||
| 29549 | // NOTE: This assert does NOT call the function. | ||||
| 29550 | 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"); | ||||
| 29551 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29552 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19" )), 0))) { | ||||
| 29553 | return false; | ||||
| 29554 | } | ||||
| 29555 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29555); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29555; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29556 | args.rval().setUndefined(); | ||||
| 29557 | return true; | ||||
| 29558 | } | ||||
| 29559 | |||||
| 29560 | static const JSJitInfo passUnionWithDefaultValue19_methodinfo = { | ||||
| 29561 | { (JSJitGetterOp)passUnionWithDefaultValue19 }, | ||||
| 29562 | { prototypes::id::TestJSImplInterface }, | ||||
| 29563 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29564 | JSJitInfo::Method, | ||||
| 29565 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29566 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29567 | false, /* isInfallible. False in setters. */ | ||||
| 29568 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29569 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29570 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29571 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29572 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29573 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29574 | }; | ||||
| 29575 | |||||
| 29576 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29577 | passUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29578 | { | ||||
| 29579 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue20"); | ||||
| 29580 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29583( cx, "TestJSImplInterface" , "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29581 | "TestJSImplInterface", "passUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29583( cx, "TestJSImplInterface" , "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29582 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29583( cx, "TestJSImplInterface" , "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29583 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29583( cx, "TestJSImplInterface" , "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29584 | |||||
| 29585 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29586 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29587 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29588 | if (objIsXray) { | ||||
| 29589 | unwrappedObj.emplace(cx, obj); | ||||
| 29590 | } | ||||
| 29591 | DoubleOrUSVString arg0; | ||||
| 29592 | if (!(args.hasDefined(0))) { | ||||
| 29593 | arg0.SetStringLiteral(u"abc"); | ||||
| 29594 | } else { | ||||
| 29595 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29596 | return false; | ||||
| 29597 | } | ||||
| 29598 | } | ||||
| 29599 | if (objIsXray) { | ||||
| 29600 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29601 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29602 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29603 | if (!unwrappedObj.ref()) { | ||||
| 29604 | return false; | ||||
| 29605 | } | ||||
| 29606 | } | ||||
| 29607 | FastErrorResult rv; | ||||
| 29608 | // NOTE: This assert does NOT call the function. | ||||
| 29609 | 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"); | ||||
| 29610 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29611 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20" )), 0))) { | ||||
| 29612 | return false; | ||||
| 29613 | } | ||||
| 29614 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29614); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29614; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29615 | args.rval().setUndefined(); | ||||
| 29616 | return true; | ||||
| 29617 | } | ||||
| 29618 | |||||
| 29619 | static const JSJitInfo passUnionWithDefaultValue20_methodinfo = { | ||||
| 29620 | { (JSJitGetterOp)passUnionWithDefaultValue20 }, | ||||
| 29621 | { prototypes::id::TestJSImplInterface }, | ||||
| 29622 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29623 | JSJitInfo::Method, | ||||
| 29624 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29625 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29626 | false, /* isInfallible. False in setters. */ | ||||
| 29627 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29628 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29629 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29630 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29631 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29632 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29633 | }; | ||||
| 29634 | |||||
| 29635 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29636 | passUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29637 | { | ||||
| 29638 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue21"); | ||||
| 29639 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29642( cx, "TestJSImplInterface" , "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29640 | "TestJSImplInterface", "passUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29642( cx, "TestJSImplInterface" , "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29641 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29642( cx, "TestJSImplInterface" , "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29642 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29642( cx, "TestJSImplInterface" , "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29643 | |||||
| 29644 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29645 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29646 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29647 | if (objIsXray) { | ||||
| 29648 | unwrappedObj.emplace(cx, obj); | ||||
| 29649 | } | ||||
| 29650 | DoubleOrUSVString arg0; | ||||
| 29651 | if (!(args.hasDefined(0))) { | ||||
| 29652 | arg0.RawSetAsDouble() = 1.0; | ||||
| 29653 | } else { | ||||
| 29654 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29655 | return false; | ||||
| 29656 | } | ||||
| 29657 | } | ||||
| 29658 | if (objIsXray) { | ||||
| 29659 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29660 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29661 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29662 | if (!unwrappedObj.ref()) { | ||||
| 29663 | return false; | ||||
| 29664 | } | ||||
| 29665 | } | ||||
| 29666 | FastErrorResult rv; | ||||
| 29667 | // NOTE: This assert does NOT call the function. | ||||
| 29668 | 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"); | ||||
| 29669 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29670 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21" )), 0))) { | ||||
| 29671 | return false; | ||||
| 29672 | } | ||||
| 29673 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29673); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29673; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29674 | args.rval().setUndefined(); | ||||
| 29675 | return true; | ||||
| 29676 | } | ||||
| 29677 | |||||
| 29678 | static const JSJitInfo passUnionWithDefaultValue21_methodinfo = { | ||||
| 29679 | { (JSJitGetterOp)passUnionWithDefaultValue21 }, | ||||
| 29680 | { prototypes::id::TestJSImplInterface }, | ||||
| 29681 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29682 | JSJitInfo::Method, | ||||
| 29683 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29684 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29685 | false, /* isInfallible. False in setters. */ | ||||
| 29686 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29687 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29688 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29689 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29690 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29691 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29692 | }; | ||||
| 29693 | |||||
| 29694 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29695 | passUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29696 | { | ||||
| 29697 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue22"); | ||||
| 29698 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29701( cx, "TestJSImplInterface" , "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29699 | "TestJSImplInterface", "passUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29701( cx, "TestJSImplInterface" , "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29700 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29701( cx, "TestJSImplInterface" , "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29701 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29701( cx, "TestJSImplInterface" , "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29702 | |||||
| 29703 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29704 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29705 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29706 | if (objIsXray) { | ||||
| 29707 | unwrappedObj.emplace(cx, obj); | ||||
| 29708 | } | ||||
| 29709 | DoubleOrUSVString arg0; | ||||
| 29710 | if (!(args.hasDefined(0))) { | ||||
| 29711 | arg0.RawSetAsDouble() = 1.5; | ||||
| 29712 | } else { | ||||
| 29713 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29714 | return false; | ||||
| 29715 | } | ||||
| 29716 | } | ||||
| 29717 | if (objIsXray) { | ||||
| 29718 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29719 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29720 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29721 | if (!unwrappedObj.ref()) { | ||||
| 29722 | return false; | ||||
| 29723 | } | ||||
| 29724 | } | ||||
| 29725 | FastErrorResult rv; | ||||
| 29726 | // NOTE: This assert does NOT call the function. | ||||
| 29727 | 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"); | ||||
| 29728 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29729 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22" )), 0))) { | ||||
| 29730 | return false; | ||||
| 29731 | } | ||||
| 29732 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29732); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29732; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29733 | args.rval().setUndefined(); | ||||
| 29734 | return true; | ||||
| 29735 | } | ||||
| 29736 | |||||
| 29737 | static const JSJitInfo passUnionWithDefaultValue22_methodinfo = { | ||||
| 29738 | { (JSJitGetterOp)passUnionWithDefaultValue22 }, | ||||
| 29739 | { prototypes::id::TestJSImplInterface }, | ||||
| 29740 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29741 | JSJitInfo::Method, | ||||
| 29742 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29743 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29744 | false, /* isInfallible. False in setters. */ | ||||
| 29745 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29746 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29747 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29748 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29749 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29750 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29751 | }; | ||||
| 29752 | |||||
| 29753 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29754 | passUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29755 | { | ||||
| 29756 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue23"); | ||||
| 29757 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29760( cx, "TestJSImplInterface" , "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29758 | "TestJSImplInterface", "passUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29760( cx, "TestJSImplInterface" , "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29759 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29760( cx, "TestJSImplInterface" , "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29760 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29760( cx, "TestJSImplInterface" , "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29761 | |||||
| 29762 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29763 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29764 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29765 | if (objIsXray) { | ||||
| 29766 | unwrappedObj.emplace(cx, obj); | ||||
| 29767 | } | ||||
| 29768 | DoubleOrUTF8String arg0; | ||||
| 29769 | if (!(args.hasDefined(0))) { | ||||
| 29770 | arg0.SetStringLiteral(""); | ||||
| 29771 | } else { | ||||
| 29772 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29773 | return false; | ||||
| 29774 | } | ||||
| 29775 | } | ||||
| 29776 | if (objIsXray) { | ||||
| 29777 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29778 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29779 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29780 | if (!unwrappedObj.ref()) { | ||||
| 29781 | return false; | ||||
| 29782 | } | ||||
| 29783 | } | ||||
| 29784 | FastErrorResult rv; | ||||
| 29785 | // NOTE: This assert does NOT call the function. | ||||
| 29786 | 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"); | ||||
| 29787 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29788 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23" )), 0))) { | ||||
| 29789 | return false; | ||||
| 29790 | } | ||||
| 29791 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29791); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29791; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29792 | args.rval().setUndefined(); | ||||
| 29793 | return true; | ||||
| 29794 | } | ||||
| 29795 | |||||
| 29796 | static const JSJitInfo passUnionWithDefaultValue23_methodinfo = { | ||||
| 29797 | { (JSJitGetterOp)passUnionWithDefaultValue23 }, | ||||
| 29798 | { prototypes::id::TestJSImplInterface }, | ||||
| 29799 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29800 | JSJitInfo::Method, | ||||
| 29801 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29802 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29803 | false, /* isInfallible. False in setters. */ | ||||
| 29804 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29805 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29806 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29807 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29808 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29809 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29810 | }; | ||||
| 29811 | |||||
| 29812 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29813 | passUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29814 | { | ||||
| 29815 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue24"); | ||||
| 29816 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29819( cx, "TestJSImplInterface" , "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29817 | "TestJSImplInterface", "passUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29819( cx, "TestJSImplInterface" , "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29818 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29819( cx, "TestJSImplInterface" , "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29819 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29819( cx, "TestJSImplInterface" , "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29820 | |||||
| 29821 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29822 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29823 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29824 | if (objIsXray) { | ||||
| 29825 | unwrappedObj.emplace(cx, obj); | ||||
| 29826 | } | ||||
| 29827 | DoubleOrUTF8String arg0; | ||||
| 29828 | if (!(args.hasDefined(0))) { | ||||
| 29829 | arg0.RawSetAsDouble() = 1.0; | ||||
| 29830 | } else { | ||||
| 29831 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29832 | return false; | ||||
| 29833 | } | ||||
| 29834 | } | ||||
| 29835 | if (objIsXray) { | ||||
| 29836 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29837 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29838 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29839 | if (!unwrappedObj.ref()) { | ||||
| 29840 | return false; | ||||
| 29841 | } | ||||
| 29842 | } | ||||
| 29843 | FastErrorResult rv; | ||||
| 29844 | // NOTE: This assert does NOT call the function. | ||||
| 29845 | 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"); | ||||
| 29846 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29847 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24" )), 0))) { | ||||
| 29848 | return false; | ||||
| 29849 | } | ||||
| 29850 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29850); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29850; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29851 | args.rval().setUndefined(); | ||||
| 29852 | return true; | ||||
| 29853 | } | ||||
| 29854 | |||||
| 29855 | static const JSJitInfo passUnionWithDefaultValue24_methodinfo = { | ||||
| 29856 | { (JSJitGetterOp)passUnionWithDefaultValue24 }, | ||||
| 29857 | { prototypes::id::TestJSImplInterface }, | ||||
| 29858 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29859 | JSJitInfo::Method, | ||||
| 29860 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29861 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29862 | false, /* isInfallible. False in setters. */ | ||||
| 29863 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29864 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29865 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29866 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29867 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29868 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29869 | }; | ||||
| 29870 | |||||
| 29871 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29872 | passUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29873 | { | ||||
| 29874 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue25"); | ||||
| 29875 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29878( cx, "TestJSImplInterface" , "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29876 | "TestJSImplInterface", "passUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29878( cx, "TestJSImplInterface" , "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29877 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29878( cx, "TestJSImplInterface" , "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29878 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29878( cx, "TestJSImplInterface" , "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29879 | |||||
| 29880 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29881 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29882 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29883 | if (objIsXray) { | ||||
| 29884 | unwrappedObj.emplace(cx, obj); | ||||
| 29885 | } | ||||
| 29886 | DoubleOrUTF8String arg0; | ||||
| 29887 | if (!(args.hasDefined(0))) { | ||||
| 29888 | arg0.RawSetAsDouble() = 1.5; | ||||
| 29889 | } else { | ||||
| 29890 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 29891 | return false; | ||||
| 29892 | } | ||||
| 29893 | } | ||||
| 29894 | if (objIsXray) { | ||||
| 29895 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29896 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29897 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29898 | if (!unwrappedObj.ref()) { | ||||
| 29899 | return false; | ||||
| 29900 | } | ||||
| 29901 | } | ||||
| 29902 | FastErrorResult rv; | ||||
| 29903 | // NOTE: This assert does NOT call the function. | ||||
| 29904 | 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"); | ||||
| 29905 | MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29906 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25" )), 0))) { | ||||
| 29907 | return false; | ||||
| 29908 | } | ||||
| 29909 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29909); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29909; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29910 | args.rval().setUndefined(); | ||||
| 29911 | return true; | ||||
| 29912 | } | ||||
| 29913 | |||||
| 29914 | static const JSJitInfo passUnionWithDefaultValue25_methodinfo = { | ||||
| 29915 | { (JSJitGetterOp)passUnionWithDefaultValue25 }, | ||||
| 29916 | { prototypes::id::TestJSImplInterface }, | ||||
| 29917 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29918 | JSJitInfo::Method, | ||||
| 29919 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29920 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29921 | false, /* isInfallible. False in setters. */ | ||||
| 29922 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29923 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29924 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29925 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29926 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29927 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29928 | }; | ||||
| 29929 | |||||
| 29930 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29931 | passNullableUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29932 | { | ||||
| 29933 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue1"); | ||||
| 29934 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29937( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29935 | "TestJSImplInterface", "passNullableUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29937( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29936 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29937( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29937 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29937( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 29938 | |||||
| 29939 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 29940 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 29941 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 29942 | if (objIsXray) { | ||||
| 29943 | unwrappedObj.emplace(cx, obj); | ||||
| 29944 | } | ||||
| 29945 | Nullable<DoubleOrString > arg0; | ||||
| 29946 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 29947 | arg0.SetNull(); | ||||
| 29948 | } else { | ||||
| 29949 | if (!(args.hasDefined(0))) { | ||||
| 29950 | arg0.SetValue().SetStringLiteral(u""); | ||||
| 29951 | } else { | ||||
| 29952 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 29953 | return false; | ||||
| 29954 | } | ||||
| 29955 | } | ||||
| 29956 | } | ||||
| 29957 | if (objIsXray) { | ||||
| 29958 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 29959 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 29960 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 29961 | if (!unwrappedObj.ref()) { | ||||
| 29962 | return false; | ||||
| 29963 | } | ||||
| 29964 | } | ||||
| 29965 | FastErrorResult rv; | ||||
| 29966 | // NOTE: This assert does NOT call the function. | ||||
| 29967 | 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"); | ||||
| 29968 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 29969 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1" )), 0))) { | ||||
| 29970 | return false; | ||||
| 29971 | } | ||||
| 29972 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 29972); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 29972; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 29973 | args.rval().setUndefined(); | ||||
| 29974 | return true; | ||||
| 29975 | } | ||||
| 29976 | |||||
| 29977 | static const JSJitInfo passNullableUnionWithDefaultValue1_methodinfo = { | ||||
| 29978 | { (JSJitGetterOp)passNullableUnionWithDefaultValue1 }, | ||||
| 29979 | { prototypes::id::TestJSImplInterface }, | ||||
| 29980 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 29981 | JSJitInfo::Method, | ||||
| 29982 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 29983 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 29984 | false, /* isInfallible. False in setters. */ | ||||
| 29985 | false, /* isMovable. Not relevant for setters. */ | ||||
| 29986 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 29987 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 29988 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 29989 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 29990 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 29991 | }; | ||||
| 29992 | |||||
| 29993 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 29994 | passNullableUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 29995 | { | ||||
| 29996 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue2"); | ||||
| 29997 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30000( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29998 | "TestJSImplInterface", "passNullableUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30000( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 29999 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30000( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30000 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30000( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30001 | |||||
| 30002 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30003 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30004 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30005 | if (objIsXray) { | ||||
| 30006 | unwrappedObj.emplace(cx, obj); | ||||
| 30007 | } | ||||
| 30008 | Nullable<DoubleOrString > arg0; | ||||
| 30009 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30010 | arg0.SetNull(); | ||||
| 30011 | } else { | ||||
| 30012 | if (!(args.hasDefined(0))) { | ||||
| 30013 | arg0.SetValue().RawSetAsDouble() = 1.0; | ||||
| 30014 | } else { | ||||
| 30015 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30016 | return false; | ||||
| 30017 | } | ||||
| 30018 | } | ||||
| 30019 | } | ||||
| 30020 | if (objIsXray) { | ||||
| 30021 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30022 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30023 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30024 | if (!unwrappedObj.ref()) { | ||||
| 30025 | return false; | ||||
| 30026 | } | ||||
| 30027 | } | ||||
| 30028 | FastErrorResult rv; | ||||
| 30029 | // NOTE: This assert does NOT call the function. | ||||
| 30030 | 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"); | ||||
| 30031 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30032 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2" )), 0))) { | ||||
| 30033 | return false; | ||||
| 30034 | } | ||||
| 30035 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30035); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30035; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30036 | args.rval().setUndefined(); | ||||
| 30037 | return true; | ||||
| 30038 | } | ||||
| 30039 | |||||
| 30040 | static const JSJitInfo passNullableUnionWithDefaultValue2_methodinfo = { | ||||
| 30041 | { (JSJitGetterOp)passNullableUnionWithDefaultValue2 }, | ||||
| 30042 | { prototypes::id::TestJSImplInterface }, | ||||
| 30043 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30044 | JSJitInfo::Method, | ||||
| 30045 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30046 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30047 | false, /* isInfallible. False in setters. */ | ||||
| 30048 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30049 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30050 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30051 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30052 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30053 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30054 | }; | ||||
| 30055 | |||||
| 30056 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30057 | passNullableUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30058 | { | ||||
| 30059 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue3"); | ||||
| 30060 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30063( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30061 | "TestJSImplInterface", "passNullableUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30063( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30062 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30063( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30063 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30063( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30064 | |||||
| 30065 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30066 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30067 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30068 | if (objIsXray) { | ||||
| 30069 | unwrappedObj.emplace(cx, obj); | ||||
| 30070 | } | ||||
| 30071 | Nullable<DoubleOrString > arg0; | ||||
| 30072 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 30073 | arg0.SetNull(); | ||||
| 30074 | } else { | ||||
| 30075 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30076 | return false; | ||||
| 30077 | } | ||||
| 30078 | } | ||||
| 30079 | if (objIsXray) { | ||||
| 30080 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30081 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30082 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30083 | if (!unwrappedObj.ref()) { | ||||
| 30084 | return false; | ||||
| 30085 | } | ||||
| 30086 | } | ||||
| 30087 | FastErrorResult rv; | ||||
| 30088 | // NOTE: This assert does NOT call the function. | ||||
| 30089 | 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"); | ||||
| 30090 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30091 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3" )), 0))) { | ||||
| 30092 | return false; | ||||
| 30093 | } | ||||
| 30094 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30094); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30094; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30095 | args.rval().setUndefined(); | ||||
| 30096 | return true; | ||||
| 30097 | } | ||||
| 30098 | |||||
| 30099 | static const JSJitInfo passNullableUnionWithDefaultValue3_methodinfo = { | ||||
| 30100 | { (JSJitGetterOp)passNullableUnionWithDefaultValue3 }, | ||||
| 30101 | { prototypes::id::TestJSImplInterface }, | ||||
| 30102 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30103 | JSJitInfo::Method, | ||||
| 30104 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30105 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30106 | false, /* isInfallible. False in setters. */ | ||||
| 30107 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30108 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30109 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30110 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30111 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30112 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30113 | }; | ||||
| 30114 | |||||
| 30115 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30116 | passNullableUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30117 | { | ||||
| 30118 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue4"); | ||||
| 30119 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30122( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30120 | "TestJSImplInterface", "passNullableUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30122( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30121 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30122( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30122 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30122( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30123 | |||||
| 30124 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30125 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30126 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30127 | if (objIsXray) { | ||||
| 30128 | unwrappedObj.emplace(cx, obj); | ||||
| 30129 | } | ||||
| 30130 | Nullable<FloatOrString > arg0; | ||||
| 30131 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30132 | arg0.SetNull(); | ||||
| 30133 | } else { | ||||
| 30134 | if (!(args.hasDefined(0))) { | ||||
| 30135 | arg0.SetValue().SetStringLiteral(u""); | ||||
| 30136 | } else { | ||||
| 30137 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30138 | return false; | ||||
| 30139 | } | ||||
| 30140 | } | ||||
| 30141 | } | ||||
| 30142 | if (objIsXray) { | ||||
| 30143 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30144 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30145 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30146 | if (!unwrappedObj.ref()) { | ||||
| 30147 | return false; | ||||
| 30148 | } | ||||
| 30149 | } | ||||
| 30150 | FastErrorResult rv; | ||||
| 30151 | // NOTE: This assert does NOT call the function. | ||||
| 30152 | 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"); | ||||
| 30153 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30154 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4" )), 0))) { | ||||
| 30155 | return false; | ||||
| 30156 | } | ||||
| 30157 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30157); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30157; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30158 | args.rval().setUndefined(); | ||||
| 30159 | return true; | ||||
| 30160 | } | ||||
| 30161 | |||||
| 30162 | static const JSJitInfo passNullableUnionWithDefaultValue4_methodinfo = { | ||||
| 30163 | { (JSJitGetterOp)passNullableUnionWithDefaultValue4 }, | ||||
| 30164 | { prototypes::id::TestJSImplInterface }, | ||||
| 30165 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30166 | JSJitInfo::Method, | ||||
| 30167 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30168 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30169 | false, /* isInfallible. False in setters. */ | ||||
| 30170 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30171 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30172 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30173 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30174 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30175 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30176 | }; | ||||
| 30177 | |||||
| 30178 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30179 | passNullableUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30180 | { | ||||
| 30181 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue5"); | ||||
| 30182 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30185( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30183 | "TestJSImplInterface", "passNullableUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30185( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30184 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30185( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30185 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30185( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30186 | |||||
| 30187 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30188 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30189 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30190 | if (objIsXray) { | ||||
| 30191 | unwrappedObj.emplace(cx, obj); | ||||
| 30192 | } | ||||
| 30193 | Nullable<FloatOrString > arg0; | ||||
| 30194 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30195 | arg0.SetNull(); | ||||
| 30196 | } else { | ||||
| 30197 | if (!(args.hasDefined(0))) { | ||||
| 30198 | arg0.SetValue().RawSetAsFloat() = 1.0F; | ||||
| 30199 | } else { | ||||
| 30200 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30201 | return false; | ||||
| 30202 | } | ||||
| 30203 | } | ||||
| 30204 | } | ||||
| 30205 | if (objIsXray) { | ||||
| 30206 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30207 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30208 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30209 | if (!unwrappedObj.ref()) { | ||||
| 30210 | return false; | ||||
| 30211 | } | ||||
| 30212 | } | ||||
| 30213 | FastErrorResult rv; | ||||
| 30214 | // NOTE: This assert does NOT call the function. | ||||
| 30215 | 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"); | ||||
| 30216 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30217 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5" )), 0))) { | ||||
| 30218 | return false; | ||||
| 30219 | } | ||||
| 30220 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30220); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30220; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30221 | args.rval().setUndefined(); | ||||
| 30222 | return true; | ||||
| 30223 | } | ||||
| 30224 | |||||
| 30225 | static const JSJitInfo passNullableUnionWithDefaultValue5_methodinfo = { | ||||
| 30226 | { (JSJitGetterOp)passNullableUnionWithDefaultValue5 }, | ||||
| 30227 | { prototypes::id::TestJSImplInterface }, | ||||
| 30228 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30229 | JSJitInfo::Method, | ||||
| 30230 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30231 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30232 | false, /* isInfallible. False in setters. */ | ||||
| 30233 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30234 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30235 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30236 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30237 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30238 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30239 | }; | ||||
| 30240 | |||||
| 30241 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30242 | passNullableUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30243 | { | ||||
| 30244 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue6"); | ||||
| 30245 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30248( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30246 | "TestJSImplInterface", "passNullableUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30248( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30247 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30248( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30248 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30248( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30249 | |||||
| 30250 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30251 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30252 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30253 | if (objIsXray) { | ||||
| 30254 | unwrappedObj.emplace(cx, obj); | ||||
| 30255 | } | ||||
| 30256 | Nullable<FloatOrString > arg0; | ||||
| 30257 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 30258 | arg0.SetNull(); | ||||
| 30259 | } else { | ||||
| 30260 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30261 | return false; | ||||
| 30262 | } | ||||
| 30263 | } | ||||
| 30264 | if (objIsXray) { | ||||
| 30265 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30266 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30267 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30268 | if (!unwrappedObj.ref()) { | ||||
| 30269 | return false; | ||||
| 30270 | } | ||||
| 30271 | } | ||||
| 30272 | FastErrorResult rv; | ||||
| 30273 | // NOTE: This assert does NOT call the function. | ||||
| 30274 | 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"); | ||||
| 30275 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30276 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6" )), 0))) { | ||||
| 30277 | return false; | ||||
| 30278 | } | ||||
| 30279 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30279); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30279; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30280 | args.rval().setUndefined(); | ||||
| 30281 | return true; | ||||
| 30282 | } | ||||
| 30283 | |||||
| 30284 | static const JSJitInfo passNullableUnionWithDefaultValue6_methodinfo = { | ||||
| 30285 | { (JSJitGetterOp)passNullableUnionWithDefaultValue6 }, | ||||
| 30286 | { prototypes::id::TestJSImplInterface }, | ||||
| 30287 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30288 | JSJitInfo::Method, | ||||
| 30289 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30290 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30291 | false, /* isInfallible. False in setters. */ | ||||
| 30292 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30293 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30294 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30295 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30296 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30297 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30298 | }; | ||||
| 30299 | |||||
| 30300 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30301 | passNullableUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30302 | { | ||||
| 30303 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue7"); | ||||
| 30304 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30307( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30305 | "TestJSImplInterface", "passNullableUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30307( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30306 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30307( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30307 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30307( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30308 | |||||
| 30309 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30310 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30311 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30312 | if (objIsXray) { | ||||
| 30313 | unwrappedObj.emplace(cx, obj); | ||||
| 30314 | } | ||||
| 30315 | Nullable<UnrestrictedDoubleOrString > arg0; | ||||
| 30316 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30317 | arg0.SetNull(); | ||||
| 30318 | } else { | ||||
| 30319 | if (!(args.hasDefined(0))) { | ||||
| 30320 | arg0.SetValue().SetStringLiteral(u""); | ||||
| 30321 | } else { | ||||
| 30322 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30323 | return false; | ||||
| 30324 | } | ||||
| 30325 | } | ||||
| 30326 | } | ||||
| 30327 | if (objIsXray) { | ||||
| 30328 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30329 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30330 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30331 | if (!unwrappedObj.ref()) { | ||||
| 30332 | return false; | ||||
| 30333 | } | ||||
| 30334 | } | ||||
| 30335 | FastErrorResult rv; | ||||
| 30336 | // NOTE: This assert does NOT call the function. | ||||
| 30337 | 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"); | ||||
| 30338 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30339 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7" )), 0))) { | ||||
| 30340 | return false; | ||||
| 30341 | } | ||||
| 30342 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30342); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30342; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30343 | args.rval().setUndefined(); | ||||
| 30344 | return true; | ||||
| 30345 | } | ||||
| 30346 | |||||
| 30347 | static const JSJitInfo passNullableUnionWithDefaultValue7_methodinfo = { | ||||
| 30348 | { (JSJitGetterOp)passNullableUnionWithDefaultValue7 }, | ||||
| 30349 | { prototypes::id::TestJSImplInterface }, | ||||
| 30350 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30351 | JSJitInfo::Method, | ||||
| 30352 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30353 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30354 | false, /* isInfallible. False in setters. */ | ||||
| 30355 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30356 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30357 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30358 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30359 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30360 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30361 | }; | ||||
| 30362 | |||||
| 30363 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30364 | passNullableUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30365 | { | ||||
| 30366 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue8"); | ||||
| 30367 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30370( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30368 | "TestJSImplInterface", "passNullableUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30370( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30369 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30370( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30370 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30370( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30371 | |||||
| 30372 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30373 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30374 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30375 | if (objIsXray) { | ||||
| 30376 | unwrappedObj.emplace(cx, obj); | ||||
| 30377 | } | ||||
| 30378 | Nullable<UnrestrictedDoubleOrString > arg0; | ||||
| 30379 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30380 | arg0.SetNull(); | ||||
| 30381 | } else { | ||||
| 30382 | if (!(args.hasDefined(0))) { | ||||
| 30383 | arg0.SetValue().RawSetAsUnrestrictedDouble() = 1.0; | ||||
| 30384 | } else { | ||||
| 30385 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30386 | return false; | ||||
| 30387 | } | ||||
| 30388 | } | ||||
| 30389 | } | ||||
| 30390 | if (objIsXray) { | ||||
| 30391 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30392 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30393 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30394 | if (!unwrappedObj.ref()) { | ||||
| 30395 | return false; | ||||
| 30396 | } | ||||
| 30397 | } | ||||
| 30398 | FastErrorResult rv; | ||||
| 30399 | // NOTE: This assert does NOT call the function. | ||||
| 30400 | 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"); | ||||
| 30401 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30402 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8" )), 0))) { | ||||
| 30403 | return false; | ||||
| 30404 | } | ||||
| 30405 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30405); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30405; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30406 | args.rval().setUndefined(); | ||||
| 30407 | return true; | ||||
| 30408 | } | ||||
| 30409 | |||||
| 30410 | static const JSJitInfo passNullableUnionWithDefaultValue8_methodinfo = { | ||||
| 30411 | { (JSJitGetterOp)passNullableUnionWithDefaultValue8 }, | ||||
| 30412 | { prototypes::id::TestJSImplInterface }, | ||||
| 30413 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30414 | JSJitInfo::Method, | ||||
| 30415 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30416 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30417 | false, /* isInfallible. False in setters. */ | ||||
| 30418 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30419 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30420 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30421 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30422 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30423 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30424 | }; | ||||
| 30425 | |||||
| 30426 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30427 | passNullableUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30428 | { | ||||
| 30429 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue9"); | ||||
| 30430 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30433( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30431 | "TestJSImplInterface", "passNullableUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30433( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30432 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30433( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30433 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30433( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30434 | |||||
| 30435 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30436 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30437 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30438 | if (objIsXray) { | ||||
| 30439 | unwrappedObj.emplace(cx, obj); | ||||
| 30440 | } | ||||
| 30441 | Nullable<UnrestrictedDoubleOrString > arg0; | ||||
| 30442 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 30443 | arg0.SetNull(); | ||||
| 30444 | } else { | ||||
| 30445 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30446 | return false; | ||||
| 30447 | } | ||||
| 30448 | } | ||||
| 30449 | if (objIsXray) { | ||||
| 30450 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30451 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30452 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30453 | if (!unwrappedObj.ref()) { | ||||
| 30454 | return false; | ||||
| 30455 | } | ||||
| 30456 | } | ||||
| 30457 | FastErrorResult rv; | ||||
| 30458 | // NOTE: This assert does NOT call the function. | ||||
| 30459 | 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"); | ||||
| 30460 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30461 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9" )), 0))) { | ||||
| 30462 | return false; | ||||
| 30463 | } | ||||
| 30464 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30464); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30464; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30465 | args.rval().setUndefined(); | ||||
| 30466 | return true; | ||||
| 30467 | } | ||||
| 30468 | |||||
| 30469 | static const JSJitInfo passNullableUnionWithDefaultValue9_methodinfo = { | ||||
| 30470 | { (JSJitGetterOp)passNullableUnionWithDefaultValue9 }, | ||||
| 30471 | { prototypes::id::TestJSImplInterface }, | ||||
| 30472 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30473 | JSJitInfo::Method, | ||||
| 30474 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30475 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30476 | false, /* isInfallible. False in setters. */ | ||||
| 30477 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30478 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30479 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30480 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30481 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30482 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30483 | }; | ||||
| 30484 | |||||
| 30485 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30486 | passNullableUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30487 | { | ||||
| 30488 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue10"); | ||||
| 30489 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30492( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30490 | "TestJSImplInterface", "passNullableUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30492( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30491 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30492( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30492 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30492( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30493 | |||||
| 30494 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30495 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30496 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30497 | if (objIsXray) { | ||||
| 30498 | unwrappedObj.emplace(cx, obj); | ||||
| 30499 | } | ||||
| 30500 | Nullable<UnrestrictedFloatOrString > arg0; | ||||
| 30501 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30502 | arg0.SetNull(); | ||||
| 30503 | } else { | ||||
| 30504 | if (!(args.hasDefined(0))) { | ||||
| 30505 | arg0.SetValue().SetStringLiteral(u""); | ||||
| 30506 | } else { | ||||
| 30507 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30508 | return false; | ||||
| 30509 | } | ||||
| 30510 | } | ||||
| 30511 | } | ||||
| 30512 | if (objIsXray) { | ||||
| 30513 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30514 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30515 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30516 | if (!unwrappedObj.ref()) { | ||||
| 30517 | return false; | ||||
| 30518 | } | ||||
| 30519 | } | ||||
| 30520 | FastErrorResult rv; | ||||
| 30521 | // NOTE: This assert does NOT call the function. | ||||
| 30522 | 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"); | ||||
| 30523 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30524 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10" )), 0))) { | ||||
| 30525 | return false; | ||||
| 30526 | } | ||||
| 30527 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30527); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30527; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30528 | args.rval().setUndefined(); | ||||
| 30529 | return true; | ||||
| 30530 | } | ||||
| 30531 | |||||
| 30532 | static const JSJitInfo passNullableUnionWithDefaultValue10_methodinfo = { | ||||
| 30533 | { (JSJitGetterOp)passNullableUnionWithDefaultValue10 }, | ||||
| 30534 | { prototypes::id::TestJSImplInterface }, | ||||
| 30535 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30536 | JSJitInfo::Method, | ||||
| 30537 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30538 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30539 | false, /* isInfallible. False in setters. */ | ||||
| 30540 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30541 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30542 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30543 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30544 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30545 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30546 | }; | ||||
| 30547 | |||||
| 30548 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30549 | passNullableUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30550 | { | ||||
| 30551 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue11"); | ||||
| 30552 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30555( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30553 | "TestJSImplInterface", "passNullableUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30555( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30554 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30555( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30555 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30555( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30556 | |||||
| 30557 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30558 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30559 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30560 | if (objIsXray) { | ||||
| 30561 | unwrappedObj.emplace(cx, obj); | ||||
| 30562 | } | ||||
| 30563 | Nullable<UnrestrictedFloatOrString > arg0; | ||||
| 30564 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30565 | arg0.SetNull(); | ||||
| 30566 | } else { | ||||
| 30567 | if (!(args.hasDefined(0))) { | ||||
| 30568 | arg0.SetValue().RawSetAsUnrestrictedFloat() = 1.0F; | ||||
| 30569 | } else { | ||||
| 30570 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30571 | return false; | ||||
| 30572 | } | ||||
| 30573 | } | ||||
| 30574 | } | ||||
| 30575 | if (objIsXray) { | ||||
| 30576 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30577 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30578 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30579 | if (!unwrappedObj.ref()) { | ||||
| 30580 | return false; | ||||
| 30581 | } | ||||
| 30582 | } | ||||
| 30583 | FastErrorResult rv; | ||||
| 30584 | // NOTE: This assert does NOT call the function. | ||||
| 30585 | 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"); | ||||
| 30586 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30587 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11" )), 0))) { | ||||
| 30588 | return false; | ||||
| 30589 | } | ||||
| 30590 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30590); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30590; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30591 | args.rval().setUndefined(); | ||||
| 30592 | return true; | ||||
| 30593 | } | ||||
| 30594 | |||||
| 30595 | static const JSJitInfo passNullableUnionWithDefaultValue11_methodinfo = { | ||||
| 30596 | { (JSJitGetterOp)passNullableUnionWithDefaultValue11 }, | ||||
| 30597 | { prototypes::id::TestJSImplInterface }, | ||||
| 30598 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30599 | JSJitInfo::Method, | ||||
| 30600 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30601 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30602 | false, /* isInfallible. False in setters. */ | ||||
| 30603 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30604 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30605 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30606 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30607 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30608 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30609 | }; | ||||
| 30610 | |||||
| 30611 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30612 | passNullableUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30613 | { | ||||
| 30614 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue12"); | ||||
| 30615 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30618( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30616 | "TestJSImplInterface", "passNullableUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30618( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30617 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30618( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30618 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30618( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30619 | |||||
| 30620 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30621 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30622 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30623 | if (objIsXray) { | ||||
| 30624 | unwrappedObj.emplace(cx, obj); | ||||
| 30625 | } | ||||
| 30626 | Nullable<UnrestrictedFloatOrString > arg0; | ||||
| 30627 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 30628 | arg0.SetNull(); | ||||
| 30629 | } else { | ||||
| 30630 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30631 | return false; | ||||
| 30632 | } | ||||
| 30633 | } | ||||
| 30634 | if (objIsXray) { | ||||
| 30635 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30636 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30637 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30638 | if (!unwrappedObj.ref()) { | ||||
| 30639 | return false; | ||||
| 30640 | } | ||||
| 30641 | } | ||||
| 30642 | FastErrorResult rv; | ||||
| 30643 | // NOTE: This assert does NOT call the function. | ||||
| 30644 | 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"); | ||||
| 30645 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30646 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12" )), 0))) { | ||||
| 30647 | return false; | ||||
| 30648 | } | ||||
| 30649 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30649); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30649; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30650 | args.rval().setUndefined(); | ||||
| 30651 | return true; | ||||
| 30652 | } | ||||
| 30653 | |||||
| 30654 | static const JSJitInfo passNullableUnionWithDefaultValue12_methodinfo = { | ||||
| 30655 | { (JSJitGetterOp)passNullableUnionWithDefaultValue12 }, | ||||
| 30656 | { prototypes::id::TestJSImplInterface }, | ||||
| 30657 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30658 | JSJitInfo::Method, | ||||
| 30659 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30660 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30661 | false, /* isInfallible. False in setters. */ | ||||
| 30662 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30663 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30664 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30665 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30666 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30667 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30668 | }; | ||||
| 30669 | |||||
| 30670 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30671 | passNullableUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30672 | { | ||||
| 30673 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue13"); | ||||
| 30674 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30677( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30675 | "TestJSImplInterface", "passNullableUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30677( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30676 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30677( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30677 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30677( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30678 | |||||
| 30679 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30680 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30681 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30682 | if (objIsXray) { | ||||
| 30683 | unwrappedObj.emplace(cx, obj); | ||||
| 30684 | } | ||||
| 30685 | Nullable<DoubleOrByteString > arg0; | ||||
| 30686 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30687 | arg0.SetNull(); | ||||
| 30688 | } else { | ||||
| 30689 | if (!(args.hasDefined(0))) { | ||||
| 30690 | arg0.SetValue().SetStringLiteral(""); | ||||
| 30691 | } else { | ||||
| 30692 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30693 | return false; | ||||
| 30694 | } | ||||
| 30695 | } | ||||
| 30696 | } | ||||
| 30697 | if (objIsXray) { | ||||
| 30698 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30699 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30700 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30701 | if (!unwrappedObj.ref()) { | ||||
| 30702 | return false; | ||||
| 30703 | } | ||||
| 30704 | } | ||||
| 30705 | FastErrorResult rv; | ||||
| 30706 | // NOTE: This assert does NOT call the function. | ||||
| 30707 | 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"); | ||||
| 30708 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30709 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13" )), 0))) { | ||||
| 30710 | return false; | ||||
| 30711 | } | ||||
| 30712 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30712); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30712; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30713 | args.rval().setUndefined(); | ||||
| 30714 | return true; | ||||
| 30715 | } | ||||
| 30716 | |||||
| 30717 | static const JSJitInfo passNullableUnionWithDefaultValue13_methodinfo = { | ||||
| 30718 | { (JSJitGetterOp)passNullableUnionWithDefaultValue13 }, | ||||
| 30719 | { prototypes::id::TestJSImplInterface }, | ||||
| 30720 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30721 | JSJitInfo::Method, | ||||
| 30722 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30723 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30724 | false, /* isInfallible. False in setters. */ | ||||
| 30725 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30726 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30727 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30728 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30729 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30730 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30731 | }; | ||||
| 30732 | |||||
| 30733 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30734 | passNullableUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30735 | { | ||||
| 30736 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue14"); | ||||
| 30737 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30740( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30738 | "TestJSImplInterface", "passNullableUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30740( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30739 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30740( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30740 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30740( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30741 | |||||
| 30742 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30743 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30744 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30745 | if (objIsXray) { | ||||
| 30746 | unwrappedObj.emplace(cx, obj); | ||||
| 30747 | } | ||||
| 30748 | Nullable<DoubleOrByteString > arg0; | ||||
| 30749 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30750 | arg0.SetNull(); | ||||
| 30751 | } else { | ||||
| 30752 | if (!(args.hasDefined(0))) { | ||||
| 30753 | arg0.SetValue().RawSetAsDouble() = 1.0; | ||||
| 30754 | } else { | ||||
| 30755 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30756 | return false; | ||||
| 30757 | } | ||||
| 30758 | } | ||||
| 30759 | } | ||||
| 30760 | if (objIsXray) { | ||||
| 30761 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30762 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30763 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30764 | if (!unwrappedObj.ref()) { | ||||
| 30765 | return false; | ||||
| 30766 | } | ||||
| 30767 | } | ||||
| 30768 | FastErrorResult rv; | ||||
| 30769 | // NOTE: This assert does NOT call the function. | ||||
| 30770 | 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"); | ||||
| 30771 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30772 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14" )), 0))) { | ||||
| 30773 | return false; | ||||
| 30774 | } | ||||
| 30775 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30775); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30775; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30776 | args.rval().setUndefined(); | ||||
| 30777 | return true; | ||||
| 30778 | } | ||||
| 30779 | |||||
| 30780 | static const JSJitInfo passNullableUnionWithDefaultValue14_methodinfo = { | ||||
| 30781 | { (JSJitGetterOp)passNullableUnionWithDefaultValue14 }, | ||||
| 30782 | { prototypes::id::TestJSImplInterface }, | ||||
| 30783 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30784 | JSJitInfo::Method, | ||||
| 30785 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30786 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30787 | false, /* isInfallible. False in setters. */ | ||||
| 30788 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30789 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30790 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30791 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30792 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30793 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30794 | }; | ||||
| 30795 | |||||
| 30796 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30797 | passNullableUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30798 | { | ||||
| 30799 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue15"); | ||||
| 30800 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30803( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30801 | "TestJSImplInterface", "passNullableUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30803( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30802 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30803( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30803 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30803( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30804 | |||||
| 30805 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30806 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30807 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30808 | if (objIsXray) { | ||||
| 30809 | unwrappedObj.emplace(cx, obj); | ||||
| 30810 | } | ||||
| 30811 | Nullable<DoubleOrByteString > arg0; | ||||
| 30812 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30813 | arg0.SetNull(); | ||||
| 30814 | } else { | ||||
| 30815 | if (!(args.hasDefined(0))) { | ||||
| 30816 | arg0.SetValue().RawSetAsDouble() = 1.5; | ||||
| 30817 | } else { | ||||
| 30818 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30819 | return false; | ||||
| 30820 | } | ||||
| 30821 | } | ||||
| 30822 | } | ||||
| 30823 | if (objIsXray) { | ||||
| 30824 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30825 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30826 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30827 | if (!unwrappedObj.ref()) { | ||||
| 30828 | return false; | ||||
| 30829 | } | ||||
| 30830 | } | ||||
| 30831 | FastErrorResult rv; | ||||
| 30832 | // NOTE: This assert does NOT call the function. | ||||
| 30833 | 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"); | ||||
| 30834 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30835 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15" )), 0))) { | ||||
| 30836 | return false; | ||||
| 30837 | } | ||||
| 30838 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30838); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30838; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30839 | args.rval().setUndefined(); | ||||
| 30840 | return true; | ||||
| 30841 | } | ||||
| 30842 | |||||
| 30843 | static const JSJitInfo passNullableUnionWithDefaultValue15_methodinfo = { | ||||
| 30844 | { (JSJitGetterOp)passNullableUnionWithDefaultValue15 }, | ||||
| 30845 | { prototypes::id::TestJSImplInterface }, | ||||
| 30846 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30847 | JSJitInfo::Method, | ||||
| 30848 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30849 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30850 | false, /* isInfallible. False in setters. */ | ||||
| 30851 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30852 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30853 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30854 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30855 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30856 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30857 | }; | ||||
| 30858 | |||||
| 30859 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30860 | passNullableUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30861 | { | ||||
| 30862 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue16"); | ||||
| 30863 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30866( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30864 | "TestJSImplInterface", "passNullableUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30866( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30865 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30866( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30866 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30866( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30867 | |||||
| 30868 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30869 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30870 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30871 | if (objIsXray) { | ||||
| 30872 | unwrappedObj.emplace(cx, obj); | ||||
| 30873 | } | ||||
| 30874 | Nullable<DoubleOrByteString > arg0; | ||||
| 30875 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 30876 | arg0.SetNull(); | ||||
| 30877 | } else { | ||||
| 30878 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30879 | return false; | ||||
| 30880 | } | ||||
| 30881 | } | ||||
| 30882 | if (objIsXray) { | ||||
| 30883 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30884 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30885 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30886 | if (!unwrappedObj.ref()) { | ||||
| 30887 | return false; | ||||
| 30888 | } | ||||
| 30889 | } | ||||
| 30890 | FastErrorResult rv; | ||||
| 30891 | // NOTE: This assert does NOT call the function. | ||||
| 30892 | 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"); | ||||
| 30893 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30894 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16" )), 0))) { | ||||
| 30895 | return false; | ||||
| 30896 | } | ||||
| 30897 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30897); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30897; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30898 | args.rval().setUndefined(); | ||||
| 30899 | return true; | ||||
| 30900 | } | ||||
| 30901 | |||||
| 30902 | static const JSJitInfo passNullableUnionWithDefaultValue16_methodinfo = { | ||||
| 30903 | { (JSJitGetterOp)passNullableUnionWithDefaultValue16 }, | ||||
| 30904 | { prototypes::id::TestJSImplInterface }, | ||||
| 30905 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30906 | JSJitInfo::Method, | ||||
| 30907 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30908 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30909 | false, /* isInfallible. False in setters. */ | ||||
| 30910 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30911 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30912 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30913 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30914 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30915 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30916 | }; | ||||
| 30917 | |||||
| 30918 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30919 | passNullableUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30920 | { | ||||
| 30921 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue17"); | ||||
| 30922 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30925( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30923 | "TestJSImplInterface", "passNullableUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30925( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30924 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30925( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30925 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30925( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30926 | |||||
| 30927 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30928 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30929 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30930 | if (objIsXray) { | ||||
| 30931 | unwrappedObj.emplace(cx, obj); | ||||
| 30932 | } | ||||
| 30933 | Nullable<DoubleOrSupportedType > arg0; | ||||
| 30934 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30935 | arg0.SetNull(); | ||||
| 30936 | } else { | ||||
| 30937 | if (!(args.hasDefined(0))) { | ||||
| 30938 | arg0.SetValue().RawSetAsSupportedType() = SupportedType::Text_html; | ||||
| 30939 | } else { | ||||
| 30940 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 30941 | return false; | ||||
| 30942 | } | ||||
| 30943 | } | ||||
| 30944 | } | ||||
| 30945 | if (objIsXray) { | ||||
| 30946 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 30947 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 30948 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 30949 | if (!unwrappedObj.ref()) { | ||||
| 30950 | return false; | ||||
| 30951 | } | ||||
| 30952 | } | ||||
| 30953 | FastErrorResult rv; | ||||
| 30954 | // NOTE: This assert does NOT call the function. | ||||
| 30955 | 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"); | ||||
| 30956 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 30957 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17" )), 0))) { | ||||
| 30958 | return false; | ||||
| 30959 | } | ||||
| 30960 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 30960); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 30960; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 30961 | args.rval().setUndefined(); | ||||
| 30962 | return true; | ||||
| 30963 | } | ||||
| 30964 | |||||
| 30965 | static const JSJitInfo passNullableUnionWithDefaultValue17_methodinfo = { | ||||
| 30966 | { (JSJitGetterOp)passNullableUnionWithDefaultValue17 }, | ||||
| 30967 | { prototypes::id::TestJSImplInterface }, | ||||
| 30968 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 30969 | JSJitInfo::Method, | ||||
| 30970 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 30971 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 30972 | false, /* isInfallible. False in setters. */ | ||||
| 30973 | false, /* isMovable. Not relevant for setters. */ | ||||
| 30974 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 30975 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 30976 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 30977 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 30978 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 30979 | }; | ||||
| 30980 | |||||
| 30981 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 30982 | passNullableUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 30983 | { | ||||
| 30984 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue18"); | ||||
| 30985 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30988( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30986 | "TestJSImplInterface", "passNullableUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30988( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30987 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30988( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 30988 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30988( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 30989 | |||||
| 30990 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 30991 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 30992 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 30993 | if (objIsXray) { | ||||
| 30994 | unwrappedObj.emplace(cx, obj); | ||||
| 30995 | } | ||||
| 30996 | Nullable<DoubleOrSupportedType > arg0; | ||||
| 30997 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 30998 | arg0.SetNull(); | ||||
| 30999 | } else { | ||||
| 31000 | if (!(args.hasDefined(0))) { | ||||
| 31001 | arg0.SetValue().RawSetAsDouble() = 1.0; | ||||
| 31002 | } else { | ||||
| 31003 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31004 | return false; | ||||
| 31005 | } | ||||
| 31006 | } | ||||
| 31007 | } | ||||
| 31008 | if (objIsXray) { | ||||
| 31009 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31010 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31011 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31012 | if (!unwrappedObj.ref()) { | ||||
| 31013 | return false; | ||||
| 31014 | } | ||||
| 31015 | } | ||||
| 31016 | FastErrorResult rv; | ||||
| 31017 | // NOTE: This assert does NOT call the function. | ||||
| 31018 | 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"); | ||||
| 31019 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31020 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18" )), 0))) { | ||||
| 31021 | return false; | ||||
| 31022 | } | ||||
| 31023 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31023); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31023; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31024 | args.rval().setUndefined(); | ||||
| 31025 | return true; | ||||
| 31026 | } | ||||
| 31027 | |||||
| 31028 | static const JSJitInfo passNullableUnionWithDefaultValue18_methodinfo = { | ||||
| 31029 | { (JSJitGetterOp)passNullableUnionWithDefaultValue18 }, | ||||
| 31030 | { prototypes::id::TestJSImplInterface }, | ||||
| 31031 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31032 | JSJitInfo::Method, | ||||
| 31033 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31034 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31035 | false, /* isInfallible. False in setters. */ | ||||
| 31036 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31037 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31038 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31039 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31040 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31041 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31042 | }; | ||||
| 31043 | |||||
| 31044 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31045 | passNullableUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31046 | { | ||||
| 31047 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue19"); | ||||
| 31048 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31051( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31049 | "TestJSImplInterface", "passNullableUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31051( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31050 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31051( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31051 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31051( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31052 | |||||
| 31053 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31054 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31055 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31056 | if (objIsXray) { | ||||
| 31057 | unwrappedObj.emplace(cx, obj); | ||||
| 31058 | } | ||||
| 31059 | Nullable<DoubleOrSupportedType > arg0; | ||||
| 31060 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31061 | arg0.SetNull(); | ||||
| 31062 | } else { | ||||
| 31063 | if (!(args.hasDefined(0))) { | ||||
| 31064 | arg0.SetValue().RawSetAsDouble() = 1.5; | ||||
| 31065 | } else { | ||||
| 31066 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31067 | return false; | ||||
| 31068 | } | ||||
| 31069 | } | ||||
| 31070 | } | ||||
| 31071 | if (objIsXray) { | ||||
| 31072 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31073 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31074 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31075 | if (!unwrappedObj.ref()) { | ||||
| 31076 | return false; | ||||
| 31077 | } | ||||
| 31078 | } | ||||
| 31079 | FastErrorResult rv; | ||||
| 31080 | // NOTE: This assert does NOT call the function. | ||||
| 31081 | 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"); | ||||
| 31082 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31083 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19" )), 0))) { | ||||
| 31084 | return false; | ||||
| 31085 | } | ||||
| 31086 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31086); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31086; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31087 | args.rval().setUndefined(); | ||||
| 31088 | return true; | ||||
| 31089 | } | ||||
| 31090 | |||||
| 31091 | static const JSJitInfo passNullableUnionWithDefaultValue19_methodinfo = { | ||||
| 31092 | { (JSJitGetterOp)passNullableUnionWithDefaultValue19 }, | ||||
| 31093 | { prototypes::id::TestJSImplInterface }, | ||||
| 31094 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31095 | JSJitInfo::Method, | ||||
| 31096 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31097 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31098 | false, /* isInfallible. False in setters. */ | ||||
| 31099 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31100 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31101 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31102 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31103 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31104 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31105 | }; | ||||
| 31106 | |||||
| 31107 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31108 | passNullableUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31109 | { | ||||
| 31110 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue20"); | ||||
| 31111 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31114( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31112 | "TestJSImplInterface", "passNullableUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31114( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31113 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31114( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31114 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31114( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31115 | |||||
| 31116 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31117 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31118 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31119 | if (objIsXray) { | ||||
| 31120 | unwrappedObj.emplace(cx, obj); | ||||
| 31121 | } | ||||
| 31122 | Nullable<DoubleOrSupportedType > arg0; | ||||
| 31123 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 31124 | arg0.SetNull(); | ||||
| 31125 | } else { | ||||
| 31126 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31127 | return false; | ||||
| 31128 | } | ||||
| 31129 | } | ||||
| 31130 | if (objIsXray) { | ||||
| 31131 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31132 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31133 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31134 | if (!unwrappedObj.ref()) { | ||||
| 31135 | return false; | ||||
| 31136 | } | ||||
| 31137 | } | ||||
| 31138 | FastErrorResult rv; | ||||
| 31139 | // NOTE: This assert does NOT call the function. | ||||
| 31140 | 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"); | ||||
| 31141 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31142 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20" )), 0))) { | ||||
| 31143 | return false; | ||||
| 31144 | } | ||||
| 31145 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31145); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31145; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31146 | args.rval().setUndefined(); | ||||
| 31147 | return true; | ||||
| 31148 | } | ||||
| 31149 | |||||
| 31150 | static const JSJitInfo passNullableUnionWithDefaultValue20_methodinfo = { | ||||
| 31151 | { (JSJitGetterOp)passNullableUnionWithDefaultValue20 }, | ||||
| 31152 | { prototypes::id::TestJSImplInterface }, | ||||
| 31153 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31154 | JSJitInfo::Method, | ||||
| 31155 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31156 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31157 | false, /* isInfallible. False in setters. */ | ||||
| 31158 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31159 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31160 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31161 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31162 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31163 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31164 | }; | ||||
| 31165 | |||||
| 31166 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31167 | passNullableUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31168 | { | ||||
| 31169 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue21"); | ||||
| 31170 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31173( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31171 | "TestJSImplInterface", "passNullableUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31173( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31172 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31173( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31173 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31173( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31174 | |||||
| 31175 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31176 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31177 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31178 | if (objIsXray) { | ||||
| 31179 | unwrappedObj.emplace(cx, obj); | ||||
| 31180 | } | ||||
| 31181 | Nullable<DoubleOrUSVString > arg0; | ||||
| 31182 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31183 | arg0.SetNull(); | ||||
| 31184 | } else { | ||||
| 31185 | if (!(args.hasDefined(0))) { | ||||
| 31186 | arg0.SetValue().SetStringLiteral(u"abc"); | ||||
| 31187 | } else { | ||||
| 31188 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31189 | return false; | ||||
| 31190 | } | ||||
| 31191 | } | ||||
| 31192 | } | ||||
| 31193 | if (objIsXray) { | ||||
| 31194 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31195 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31196 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31197 | if (!unwrappedObj.ref()) { | ||||
| 31198 | return false; | ||||
| 31199 | } | ||||
| 31200 | } | ||||
| 31201 | FastErrorResult rv; | ||||
| 31202 | // NOTE: This assert does NOT call the function. | ||||
| 31203 | 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"); | ||||
| 31204 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31205 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21" )), 0))) { | ||||
| 31206 | return false; | ||||
| 31207 | } | ||||
| 31208 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31208); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31208; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31209 | args.rval().setUndefined(); | ||||
| 31210 | return true; | ||||
| 31211 | } | ||||
| 31212 | |||||
| 31213 | static const JSJitInfo passNullableUnionWithDefaultValue21_methodinfo = { | ||||
| 31214 | { (JSJitGetterOp)passNullableUnionWithDefaultValue21 }, | ||||
| 31215 | { prototypes::id::TestJSImplInterface }, | ||||
| 31216 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31217 | JSJitInfo::Method, | ||||
| 31218 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31219 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31220 | false, /* isInfallible. False in setters. */ | ||||
| 31221 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31222 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31223 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31224 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31225 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31226 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31227 | }; | ||||
| 31228 | |||||
| 31229 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31230 | passNullableUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31231 | { | ||||
| 31232 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue22"); | ||||
| 31233 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31236( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31234 | "TestJSImplInterface", "passNullableUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31236( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31235 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31236( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31236 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31236( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31237 | |||||
| 31238 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31239 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31240 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31241 | if (objIsXray) { | ||||
| 31242 | unwrappedObj.emplace(cx, obj); | ||||
| 31243 | } | ||||
| 31244 | Nullable<DoubleOrUSVString > arg0; | ||||
| 31245 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31246 | arg0.SetNull(); | ||||
| 31247 | } else { | ||||
| 31248 | if (!(args.hasDefined(0))) { | ||||
| 31249 | arg0.SetValue().RawSetAsDouble() = 1.0; | ||||
| 31250 | } else { | ||||
| 31251 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31252 | return false; | ||||
| 31253 | } | ||||
| 31254 | } | ||||
| 31255 | } | ||||
| 31256 | if (objIsXray) { | ||||
| 31257 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31258 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31259 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31260 | if (!unwrappedObj.ref()) { | ||||
| 31261 | return false; | ||||
| 31262 | } | ||||
| 31263 | } | ||||
| 31264 | FastErrorResult rv; | ||||
| 31265 | // NOTE: This assert does NOT call the function. | ||||
| 31266 | 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"); | ||||
| 31267 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31268 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22" )), 0))) { | ||||
| 31269 | return false; | ||||
| 31270 | } | ||||
| 31271 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31271); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31271; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31272 | args.rval().setUndefined(); | ||||
| 31273 | return true; | ||||
| 31274 | } | ||||
| 31275 | |||||
| 31276 | static const JSJitInfo passNullableUnionWithDefaultValue22_methodinfo = { | ||||
| 31277 | { (JSJitGetterOp)passNullableUnionWithDefaultValue22 }, | ||||
| 31278 | { prototypes::id::TestJSImplInterface }, | ||||
| 31279 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31280 | JSJitInfo::Method, | ||||
| 31281 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31282 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31283 | false, /* isInfallible. False in setters. */ | ||||
| 31284 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31285 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31286 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31287 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31288 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31289 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31290 | }; | ||||
| 31291 | |||||
| 31292 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31293 | passNullableUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31294 | { | ||||
| 31295 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue23"); | ||||
| 31296 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31299( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31297 | "TestJSImplInterface", "passNullableUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31299( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31298 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31299( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31299 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31299( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31300 | |||||
| 31301 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31302 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31303 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31304 | if (objIsXray) { | ||||
| 31305 | unwrappedObj.emplace(cx, obj); | ||||
| 31306 | } | ||||
| 31307 | Nullable<DoubleOrUSVString > arg0; | ||||
| 31308 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31309 | arg0.SetNull(); | ||||
| 31310 | } else { | ||||
| 31311 | if (!(args.hasDefined(0))) { | ||||
| 31312 | arg0.SetValue().RawSetAsDouble() = 1.5; | ||||
| 31313 | } else { | ||||
| 31314 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31315 | return false; | ||||
| 31316 | } | ||||
| 31317 | } | ||||
| 31318 | } | ||||
| 31319 | if (objIsXray) { | ||||
| 31320 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31321 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31322 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31323 | if (!unwrappedObj.ref()) { | ||||
| 31324 | return false; | ||||
| 31325 | } | ||||
| 31326 | } | ||||
| 31327 | FastErrorResult rv; | ||||
| 31328 | // NOTE: This assert does NOT call the function. | ||||
| 31329 | 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"); | ||||
| 31330 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31331 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23" )), 0))) { | ||||
| 31332 | return false; | ||||
| 31333 | } | ||||
| 31334 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31334); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31334; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31335 | args.rval().setUndefined(); | ||||
| 31336 | return true; | ||||
| 31337 | } | ||||
| 31338 | |||||
| 31339 | static const JSJitInfo passNullableUnionWithDefaultValue23_methodinfo = { | ||||
| 31340 | { (JSJitGetterOp)passNullableUnionWithDefaultValue23 }, | ||||
| 31341 | { prototypes::id::TestJSImplInterface }, | ||||
| 31342 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31343 | JSJitInfo::Method, | ||||
| 31344 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31345 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31346 | false, /* isInfallible. False in setters. */ | ||||
| 31347 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31348 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31349 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31350 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31351 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31352 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31353 | }; | ||||
| 31354 | |||||
| 31355 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31356 | passNullableUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31357 | { | ||||
| 31358 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue24"); | ||||
| 31359 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31362( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31360 | "TestJSImplInterface", "passNullableUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31362( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31361 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31362( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31362 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31362( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31363 | |||||
| 31364 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31365 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31366 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31367 | if (objIsXray) { | ||||
| 31368 | unwrappedObj.emplace(cx, obj); | ||||
| 31369 | } | ||||
| 31370 | Nullable<DoubleOrUSVString > arg0; | ||||
| 31371 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 31372 | arg0.SetNull(); | ||||
| 31373 | } else { | ||||
| 31374 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31375 | return false; | ||||
| 31376 | } | ||||
| 31377 | } | ||||
| 31378 | if (objIsXray) { | ||||
| 31379 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31380 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31381 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31382 | if (!unwrappedObj.ref()) { | ||||
| 31383 | return false; | ||||
| 31384 | } | ||||
| 31385 | } | ||||
| 31386 | FastErrorResult rv; | ||||
| 31387 | // NOTE: This assert does NOT call the function. | ||||
| 31388 | 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"); | ||||
| 31389 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31390 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24" )), 0))) { | ||||
| 31391 | return false; | ||||
| 31392 | } | ||||
| 31393 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31393); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31393; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31394 | args.rval().setUndefined(); | ||||
| 31395 | return true; | ||||
| 31396 | } | ||||
| 31397 | |||||
| 31398 | static const JSJitInfo passNullableUnionWithDefaultValue24_methodinfo = { | ||||
| 31399 | { (JSJitGetterOp)passNullableUnionWithDefaultValue24 }, | ||||
| 31400 | { prototypes::id::TestJSImplInterface }, | ||||
| 31401 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31402 | JSJitInfo::Method, | ||||
| 31403 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31404 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31405 | false, /* isInfallible. False in setters. */ | ||||
| 31406 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31407 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31408 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31409 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31410 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31411 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31412 | }; | ||||
| 31413 | |||||
| 31414 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31415 | passNullableUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31416 | { | ||||
| 31417 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue25"); | ||||
| 31418 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31421( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31419 | "TestJSImplInterface", "passNullableUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31421( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31420 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31421( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31421 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31421( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31422 | |||||
| 31423 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31424 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31425 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31426 | if (objIsXray) { | ||||
| 31427 | unwrappedObj.emplace(cx, obj); | ||||
| 31428 | } | ||||
| 31429 | Nullable<DoubleOrUTF8String > arg0; | ||||
| 31430 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31431 | arg0.SetNull(); | ||||
| 31432 | } else { | ||||
| 31433 | if (!(args.hasDefined(0))) { | ||||
| 31434 | arg0.SetValue().SetStringLiteral(""); | ||||
| 31435 | } else { | ||||
| 31436 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31437 | return false; | ||||
| 31438 | } | ||||
| 31439 | } | ||||
| 31440 | } | ||||
| 31441 | if (objIsXray) { | ||||
| 31442 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31443 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31444 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31445 | if (!unwrappedObj.ref()) { | ||||
| 31446 | return false; | ||||
| 31447 | } | ||||
| 31448 | } | ||||
| 31449 | FastErrorResult rv; | ||||
| 31450 | // NOTE: This assert does NOT call the function. | ||||
| 31451 | 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"); | ||||
| 31452 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31453 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25" )), 0))) { | ||||
| 31454 | return false; | ||||
| 31455 | } | ||||
| 31456 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31456); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31456; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31457 | args.rval().setUndefined(); | ||||
| 31458 | return true; | ||||
| 31459 | } | ||||
| 31460 | |||||
| 31461 | static const JSJitInfo passNullableUnionWithDefaultValue25_methodinfo = { | ||||
| 31462 | { (JSJitGetterOp)passNullableUnionWithDefaultValue25 }, | ||||
| 31463 | { prototypes::id::TestJSImplInterface }, | ||||
| 31464 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31465 | JSJitInfo::Method, | ||||
| 31466 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31467 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31468 | false, /* isInfallible. False in setters. */ | ||||
| 31469 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31470 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31471 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31472 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31473 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31474 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31475 | }; | ||||
| 31476 | |||||
| 31477 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31478 | passNullableUnionWithDefaultValue26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31479 | { | ||||
| 31480 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue26"); | ||||
| 31481 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31484( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31482 | "TestJSImplInterface", "passNullableUnionWithDefaultValue26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31484( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31483 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31484( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31484 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31484( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31485 | |||||
| 31486 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31487 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31488 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31489 | if (objIsXray) { | ||||
| 31490 | unwrappedObj.emplace(cx, obj); | ||||
| 31491 | } | ||||
| 31492 | Nullable<DoubleOrUTF8String > arg0; | ||||
| 31493 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31494 | arg0.SetNull(); | ||||
| 31495 | } else { | ||||
| 31496 | if (!(args.hasDefined(0))) { | ||||
| 31497 | arg0.SetValue().RawSetAsDouble() = 1.0; | ||||
| 31498 | } else { | ||||
| 31499 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31500 | return false; | ||||
| 31501 | } | ||||
| 31502 | } | ||||
| 31503 | } | ||||
| 31504 | if (objIsXray) { | ||||
| 31505 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31506 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31507 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31508 | if (!unwrappedObj.ref()) { | ||||
| 31509 | return false; | ||||
| 31510 | } | ||||
| 31511 | } | ||||
| 31512 | FastErrorResult rv; | ||||
| 31513 | // NOTE: This assert does NOT call the function. | ||||
| 31514 | 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"); | ||||
| 31515 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31516 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26" )), 0))) { | ||||
| 31517 | return false; | ||||
| 31518 | } | ||||
| 31519 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31519); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31519; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31520 | args.rval().setUndefined(); | ||||
| 31521 | return true; | ||||
| 31522 | } | ||||
| 31523 | |||||
| 31524 | static const JSJitInfo passNullableUnionWithDefaultValue26_methodinfo = { | ||||
| 31525 | { (JSJitGetterOp)passNullableUnionWithDefaultValue26 }, | ||||
| 31526 | { prototypes::id::TestJSImplInterface }, | ||||
| 31527 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31528 | JSJitInfo::Method, | ||||
| 31529 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31530 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31531 | false, /* isInfallible. False in setters. */ | ||||
| 31532 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31533 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31534 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31535 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31536 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31537 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31538 | }; | ||||
| 31539 | |||||
| 31540 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31541 | passNullableUnionWithDefaultValue27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31542 | { | ||||
| 31543 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue27"); | ||||
| 31544 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31547( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31545 | "TestJSImplInterface", "passNullableUnionWithDefaultValue27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31547( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31546 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31547( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31547 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31547( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31548 | |||||
| 31549 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31550 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31551 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31552 | if (objIsXray) { | ||||
| 31553 | unwrappedObj.emplace(cx, obj); | ||||
| 31554 | } | ||||
| 31555 | Nullable<DoubleOrUTF8String > arg0; | ||||
| 31556 | if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) { | ||||
| 31557 | arg0.SetNull(); | ||||
| 31558 | } else { | ||||
| 31559 | if (!(args.hasDefined(0))) { | ||||
| 31560 | arg0.SetValue().RawSetAsDouble() = 1.5; | ||||
| 31561 | } else { | ||||
| 31562 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31563 | return false; | ||||
| 31564 | } | ||||
| 31565 | } | ||||
| 31566 | } | ||||
| 31567 | if (objIsXray) { | ||||
| 31568 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31569 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31570 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31571 | if (!unwrappedObj.ref()) { | ||||
| 31572 | return false; | ||||
| 31573 | } | ||||
| 31574 | } | ||||
| 31575 | FastErrorResult rv; | ||||
| 31576 | // NOTE: This assert does NOT call the function. | ||||
| 31577 | 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"); | ||||
| 31578 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31579 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27" )), 0))) { | ||||
| 31580 | return false; | ||||
| 31581 | } | ||||
| 31582 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31582); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31582; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31583 | args.rval().setUndefined(); | ||||
| 31584 | return true; | ||||
| 31585 | } | ||||
| 31586 | |||||
| 31587 | static const JSJitInfo passNullableUnionWithDefaultValue27_methodinfo = { | ||||
| 31588 | { (JSJitGetterOp)passNullableUnionWithDefaultValue27 }, | ||||
| 31589 | { prototypes::id::TestJSImplInterface }, | ||||
| 31590 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31591 | JSJitInfo::Method, | ||||
| 31592 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31593 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31594 | false, /* isInfallible. False in setters. */ | ||||
| 31595 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31596 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31597 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31598 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31599 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31600 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31601 | }; | ||||
| 31602 | |||||
| 31603 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31604 | passNullableUnionWithDefaultValue28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31605 | { | ||||
| 31606 | BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue28"); | ||||
| 31607 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31610( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31608 | "TestJSImplInterface", "passNullableUnionWithDefaultValue28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31610( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31609 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31610( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31610 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31610( cx, "TestJSImplInterface" , "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31611 | |||||
| 31612 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31613 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31614 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31615 | if (objIsXray) { | ||||
| 31616 | unwrappedObj.emplace(cx, obj); | ||||
| 31617 | } | ||||
| 31618 | Nullable<DoubleOrUTF8String > arg0; | ||||
| 31619 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | ||||
| 31620 | arg0.SetNull(); | ||||
| 31621 | } else { | ||||
| 31622 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) { | ||||
| 31623 | return false; | ||||
| 31624 | } | ||||
| 31625 | } | ||||
| 31626 | if (objIsXray) { | ||||
| 31627 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31628 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31629 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31630 | if (!unwrappedObj.ref()) { | ||||
| 31631 | return false; | ||||
| 31632 | } | ||||
| 31633 | } | ||||
| 31634 | FastErrorResult rv; | ||||
| 31635 | // NOTE: This assert does NOT call the function. | ||||
| 31636 | 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"); | ||||
| 31637 | MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31638 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28" )), 0))) { | ||||
| 31639 | return false; | ||||
| 31640 | } | ||||
| 31641 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31641); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31641; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31642 | args.rval().setUndefined(); | ||||
| 31643 | return true; | ||||
| 31644 | } | ||||
| 31645 | |||||
| 31646 | static const JSJitInfo passNullableUnionWithDefaultValue28_methodinfo = { | ||||
| 31647 | { (JSJitGetterOp)passNullableUnionWithDefaultValue28 }, | ||||
| 31648 | { prototypes::id::TestJSImplInterface }, | ||||
| 31649 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31650 | JSJitInfo::Method, | ||||
| 31651 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31652 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31653 | false, /* isInfallible. False in setters. */ | ||||
| 31654 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31655 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31656 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31657 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31658 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31659 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31660 | }; | ||||
| 31661 | |||||
| 31662 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31663 | passSequenceOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31664 | { | ||||
| 31665 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions"); | ||||
| 31666 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31669( cx, "TestJSImplInterface" , "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31667 | "TestJSImplInterface", "passSequenceOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31669( cx, "TestJSImplInterface" , "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31668 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31669( cx, "TestJSImplInterface" , "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31669 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31669( cx, "TestJSImplInterface" , "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 31670 | |||||
| 31671 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31672 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfUnions", 1)) { | ||||
| 31673 | return false; | ||||
| 31674 | } | ||||
| 31675 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31676 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31677 | if (objIsXray) { | ||||
| 31678 | unwrappedObj.emplace(cx, obj); | ||||
| 31679 | } | ||||
| 31680 | binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0; | ||||
| 31681 | if (args[0].isObject()) { | ||||
| 31682 | JS::ForOfIterator iter(cx); | ||||
| 31683 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 31684 | return false; | ||||
| 31685 | } | ||||
| 31686 | if (!iter.valueIsIterable()) { | ||||
| 31687 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31688 | return false; | ||||
| 31689 | } | ||||
| 31690 | binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> &arr = arg0; | ||||
| 31691 | JS::Rooted<JS::Value> temp(cx); | ||||
| 31692 | while (true) { | ||||
| 31693 | bool done; | ||||
| 31694 | if (!iter.next(&temp, &done)) { | ||||
| 31695 | return false; | ||||
| 31696 | } | ||||
| 31697 | if (done) { | ||||
| 31698 | break; | ||||
| 31699 | } | ||||
| 31700 | OwningCanvasPatternOrCanvasGradient* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 31701 | if (!slotPtr) { | ||||
| 31702 | JS_ReportOutOfMemory(cx); | ||||
| 31703 | return false; | ||||
| 31704 | } | ||||
| 31705 | OwningCanvasPatternOrCanvasGradient& slot = *slotPtr; | ||||
| 31706 | if (!slot.Init(cx, temp, "Element of argument 1", true)) { | ||||
| 31707 | return false; | ||||
| 31708 | } | ||||
| 31709 | } | ||||
| 31710 | } else { | ||||
| 31711 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31712 | return false; | ||||
| 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)->PassSequenceOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here"); | ||||
| 31725 | MOZ_KnownLive(self)(self)->PassSequenceOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31726 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions" )), 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 { *(( volatile int*)__null) = 31729; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31730 | args.rval().setUndefined(); | ||||
| 31731 | return true; | ||||
| 31732 | } | ||||
| 31733 | |||||
| 31734 | static const JSJitInfo passSequenceOfUnions_methodinfo = { | ||||
| 31735 | { (JSJitGetterOp)passSequenceOfUnions }, | ||||
| 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 | |||||
| 31750 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31751 | passSequenceOfUnions2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31752 | { | ||||
| 31753 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions2"); | ||||
| 31754 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface" , "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31755 | "TestJSImplInterface", "passSequenceOfUnions2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface" , "passSequenceOfUnions2", 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" , "passSequenceOfUnions2", 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" , "passSequenceOfUnions2", 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.passSequenceOfUnions2", 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<OwningObjectOrLong> arg0; | ||||
| 31769 | SequenceRooter<OwningObjectOrLong> arg0_holder(cx, &arg0); | ||||
| 31770 | if (args[0].isObject()) { | ||||
| 31771 | JS::ForOfIterator iter(cx); | ||||
| 31772 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 31773 | return false; | ||||
| 31774 | } | ||||
| 31775 | if (!iter.valueIsIterable()) { | ||||
| 31776 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31777 | return false; | ||||
| 31778 | } | ||||
| 31779 | binding_detail::AutoSequence<OwningObjectOrLong> &arr = arg0; | ||||
| 31780 | JS::Rooted<JS::Value> temp(cx); | ||||
| 31781 | while (true) { | ||||
| 31782 | bool done; | ||||
| 31783 | if (!iter.next(&temp, &done)) { | ||||
| 31784 | return false; | ||||
| 31785 | } | ||||
| 31786 | if (done) { | ||||
| 31787 | break; | ||||
| 31788 | } | ||||
| 31789 | OwningObjectOrLong* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 31790 | if (!slotPtr) { | ||||
| 31791 | JS_ReportOutOfMemory(cx); | ||||
| 31792 | return false; | ||||
| 31793 | } | ||||
| 31794 | OwningObjectOrLong& slot = *slotPtr; | ||||
| 31795 | if (!slot.Init(cx, temp, "Element of argument 1", true)) { | ||||
| 31796 | return false; | ||||
| 31797 | } | ||||
| 31798 | } | ||||
| 31799 | } else { | ||||
| 31800 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31801 | return false; | ||||
| 31802 | } | ||||
| 31803 | if (objIsXray) { | ||||
| 31804 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31805 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31806 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31807 | if (!unwrappedObj.ref()) { | ||||
| 31808 | return false; | ||||
| 31809 | } | ||||
| 31810 | } | ||||
| 31811 | FastErrorResult rv; | ||||
| 31812 | // NOTE: This assert does NOT call the function. | ||||
| 31813 | 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"); | ||||
| 31814 | MOZ_KnownLive(self)(self)->PassSequenceOfUnions2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31815 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2" )), 0))) { | ||||
| 31816 | return false; | ||||
| 31817 | } | ||||
| 31818 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31818); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31818; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31819 | args.rval().setUndefined(); | ||||
| 31820 | return true; | ||||
| 31821 | } | ||||
| 31822 | |||||
| 31823 | static const JSJitInfo passSequenceOfUnions2_methodinfo = { | ||||
| 31824 | { (JSJitGetterOp)passSequenceOfUnions2 }, | ||||
| 31825 | { prototypes::id::TestJSImplInterface }, | ||||
| 31826 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31827 | JSJitInfo::Method, | ||||
| 31828 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31829 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31830 | false, /* isInfallible. False in setters. */ | ||||
| 31831 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31832 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31833 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31834 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31835 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31836 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31837 | }; | ||||
| 31838 | |||||
| 31839 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31840 | passVariadicUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31841 | { | ||||
| 31842 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicUnion"); | ||||
| 31843 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31846( cx, "TestJSImplInterface" , "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31844 | "TestJSImplInterface", "passVariadicUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31846( cx, "TestJSImplInterface" , "passVariadicUnion", 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::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31846( cx, "TestJSImplInterface" , "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 31846 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31846( cx, "TestJSImplInterface" , "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 31847 | |||||
| 31848 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31849 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31850 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31851 | if (objIsXray) { | ||||
| 31852 | unwrappedObj.emplace(cx, obj); | ||||
| 31853 | } | ||||
| 31854 | AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0; | ||||
| 31855 | if (args.length() > 0) { | ||||
| 31856 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 31857 | JS_ReportOutOfMemory(cx); | ||||
| 31858 | return false; | ||||
| 31859 | } | ||||
| 31860 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 31861 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 31862 | OwningCanvasPatternOrCanvasGradient& slot = *arg0.AppendElement(); | ||||
| 31863 | if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) { | ||||
| 31864 | return false; | ||||
| 31865 | } | ||||
| 31866 | } | ||||
| 31867 | } | ||||
| 31868 | if (objIsXray) { | ||||
| 31869 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31870 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31871 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31872 | if (!unwrappedObj.ref()) { | ||||
| 31873 | return false; | ||||
| 31874 | } | ||||
| 31875 | } | ||||
| 31876 | FastErrorResult rv; | ||||
| 31877 | // NOTE: This assert does NOT call the function. | ||||
| 31878 | 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"); | ||||
| 31879 | MOZ_KnownLive(self)(self)->PassVariadicUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31880 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion" )), 0))) { | ||||
| 31881 | return false; | ||||
| 31882 | } | ||||
| 31883 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31883); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31883; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31884 | args.rval().setUndefined(); | ||||
| 31885 | return true; | ||||
| 31886 | } | ||||
| 31887 | |||||
| 31888 | static const JSJitInfo passVariadicUnion_methodinfo = { | ||||
| 31889 | { (JSJitGetterOp)passVariadicUnion }, | ||||
| 31890 | { prototypes::id::TestJSImplInterface }, | ||||
| 31891 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31892 | JSJitInfo::Method, | ||||
| 31893 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31894 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31895 | false, /* isInfallible. False in setters. */ | ||||
| 31896 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31897 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31898 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31899 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31900 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31901 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31902 | }; | ||||
| 31903 | |||||
| 31904 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31905 | passSequenceOfNullableUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31906 | { | ||||
| 31907 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableUnions"); | ||||
| 31908 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31911( cx, "TestJSImplInterface" , "passSequenceOfNullableUnions", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31909 | "TestJSImplInterface", "passSequenceOfNullableUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31911( cx, "TestJSImplInterface" , "passSequenceOfNullableUnions", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31910 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31911( cx, "TestJSImplInterface" , "passSequenceOfNullableUnions", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 31911 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31911( cx, "TestJSImplInterface" , "passSequenceOfNullableUnions", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 31912 | |||||
| 31913 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 31914 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableUnions", 1)) { | ||||
| 31915 | return false; | ||||
| 31916 | } | ||||
| 31917 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 31918 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 31919 | if (objIsXray) { | ||||
| 31920 | unwrappedObj.emplace(cx, obj); | ||||
| 31921 | } | ||||
| 31922 | binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0; | ||||
| 31923 | if (args[0].isObject()) { | ||||
| 31924 | JS::ForOfIterator iter(cx); | ||||
| 31925 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 31926 | return false; | ||||
| 31927 | } | ||||
| 31928 | if (!iter.valueIsIterable()) { | ||||
| 31929 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31930 | return false; | ||||
| 31931 | } | ||||
| 31932 | binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> &arr = arg0; | ||||
| 31933 | JS::Rooted<JS::Value> temp(cx); | ||||
| 31934 | while (true) { | ||||
| 31935 | bool done; | ||||
| 31936 | if (!iter.next(&temp, &done)) { | ||||
| 31937 | return false; | ||||
| 31938 | } | ||||
| 31939 | if (done) { | ||||
| 31940 | break; | ||||
| 31941 | } | ||||
| 31942 | Nullable<OwningCanvasPatternOrCanvasGradient >* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 31943 | if (!slotPtr) { | ||||
| 31944 | JS_ReportOutOfMemory(cx); | ||||
| 31945 | return false; | ||||
| 31946 | } | ||||
| 31947 | Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *slotPtr; | ||||
| 31948 | if (temp.isNullOrUndefined()) { | ||||
| 31949 | slot.SetNull(); | ||||
| 31950 | } else { | ||||
| 31951 | if (!slot.SetValue().Init(cx, temp, "Element of argument 1", true)) { | ||||
| 31952 | return false; | ||||
| 31953 | } | ||||
| 31954 | } | ||||
| 31955 | } | ||||
| 31956 | } else { | ||||
| 31957 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 31958 | return false; | ||||
| 31959 | } | ||||
| 31960 | if (objIsXray) { | ||||
| 31961 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 31962 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 31963 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 31964 | if (!unwrappedObj.ref()) { | ||||
| 31965 | return false; | ||||
| 31966 | } | ||||
| 31967 | } | ||||
| 31968 | FastErrorResult rv; | ||||
| 31969 | // NOTE: This assert does NOT call the function. | ||||
| 31970 | 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"); | ||||
| 31971 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 31972 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions" )), 0))) { | ||||
| 31973 | return false; | ||||
| 31974 | } | ||||
| 31975 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 31975); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 31975; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 31976 | args.rval().setUndefined(); | ||||
| 31977 | return true; | ||||
| 31978 | } | ||||
| 31979 | |||||
| 31980 | static const JSJitInfo passSequenceOfNullableUnions_methodinfo = { | ||||
| 31981 | { (JSJitGetterOp)passSequenceOfNullableUnions }, | ||||
| 31982 | { prototypes::id::TestJSImplInterface }, | ||||
| 31983 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 31984 | JSJitInfo::Method, | ||||
| 31985 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 31986 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 31987 | false, /* isInfallible. False in setters. */ | ||||
| 31988 | false, /* isMovable. Not relevant for setters. */ | ||||
| 31989 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 31990 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 31991 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 31992 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 31993 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 31994 | }; | ||||
| 31995 | |||||
| 31996 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 31997 | passVariadicNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 31998 | { | ||||
| 31999 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableUnion"); | ||||
| 32000 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32003( cx, "TestJSImplInterface" , "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32001 | "TestJSImplInterface", "passVariadicNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32003( cx, "TestJSImplInterface" , "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32002 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32003( cx, "TestJSImplInterface" , "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32003 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32003( cx, "TestJSImplInterface" , "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 32004 | |||||
| 32005 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32006 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32007 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32008 | if (objIsXray) { | ||||
| 32009 | unwrappedObj.emplace(cx, obj); | ||||
| 32010 | } | ||||
| 32011 | AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0; | ||||
| 32012 | if (args.length() > 0) { | ||||
| 32013 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 32014 | JS_ReportOutOfMemory(cx); | ||||
| 32015 | return false; | ||||
| 32016 | } | ||||
| 32017 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 32018 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 32019 | Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *arg0.AppendElement(); | ||||
| 32020 | if (args[variadicArg].isNullOrUndefined()) { | ||||
| 32021 | slot.SetNull(); | ||||
| 32022 | } else { | ||||
| 32023 | if (!slot.SetValue().Init(cx, args[variadicArg], "Argument 1", true)) { | ||||
| 32024 | return false; | ||||
| 32025 | } | ||||
| 32026 | } | ||||
| 32027 | } | ||||
| 32028 | } | ||||
| 32029 | if (objIsXray) { | ||||
| 32030 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32031 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32032 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32033 | if (!unwrappedObj.ref()) { | ||||
| 32034 | return false; | ||||
| 32035 | } | ||||
| 32036 | } | ||||
| 32037 | FastErrorResult rv; | ||||
| 32038 | // NOTE: This assert does NOT call the function. | ||||
| 32039 | 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"); | ||||
| 32040 | MOZ_KnownLive(self)(self)->PassVariadicNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32041 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion" )), 0))) { | ||||
| 32042 | return false; | ||||
| 32043 | } | ||||
| 32044 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32044); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32044; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32045 | args.rval().setUndefined(); | ||||
| 32046 | return true; | ||||
| 32047 | } | ||||
| 32048 | |||||
| 32049 | static const JSJitInfo passVariadicNullableUnion_methodinfo = { | ||||
| 32050 | { (JSJitGetterOp)passVariadicNullableUnion }, | ||||
| 32051 | { prototypes::id::TestJSImplInterface }, | ||||
| 32052 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32053 | JSJitInfo::Method, | ||||
| 32054 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32055 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32056 | false, /* isInfallible. False in setters. */ | ||||
| 32057 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32058 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32059 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32060 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32061 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32062 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32063 | }; | ||||
| 32064 | |||||
| 32065 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32066 | passRecordOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32067 | { | ||||
| 32068 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfUnions"); | ||||
| 32069 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32072( cx, "TestJSImplInterface" , "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32070 | "TestJSImplInterface", "passRecordOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32072( cx, "TestJSImplInterface" , "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32071 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32072( cx, "TestJSImplInterface" , "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32072 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32072( cx, "TestJSImplInterface" , "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32073 | |||||
| 32074 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32075 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfUnions", 1)) { | ||||
| 32076 | return false; | ||||
| 32077 | } | ||||
| 32078 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32079 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32080 | if (objIsXray) { | ||||
| 32081 | unwrappedObj.emplace(cx, obj); | ||||
| 32082 | } | ||||
| 32083 | Record<nsString, OwningCanvasPatternOrCanvasGradient> arg0; | ||||
| 32084 | if (args[0].isObject()) { | ||||
| 32085 | auto& recordEntries = arg0.Entries(); | ||||
| 32086 | |||||
| 32087 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 32088 | JS::RootedVector<jsid> ids(cx); | ||||
| 32089 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 32090 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 32091 | return false; | ||||
| 32092 | } | ||||
| 32093 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 32094 | JS_ReportOutOfMemory(cx); | ||||
| 32095 | return false; | ||||
| 32096 | } | ||||
| 32097 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 32098 | JS::Rooted<JS::Value> temp(cx); | ||||
| 32099 | JS::Rooted<jsid> curId(cx); | ||||
| 32100 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 32101 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 32102 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 32103 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 32104 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 32105 | // around. | ||||
| 32106 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 32107 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 32108 | curId = ids[i]; | ||||
| 32109 | |||||
| 32110 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 32111 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 32112 | &desc)) { | ||||
| 32113 | return false; | ||||
| 32114 | } | ||||
| 32115 | |||||
| 32116 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 32117 | continue; | ||||
| 32118 | } | ||||
| 32119 | |||||
| 32120 | idVal = js::IdToValue(curId); | ||||
| 32121 | nsString propName; | ||||
| 32122 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 32123 | // to do. | ||||
| 32124 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 32125 | return false; | ||||
| 32126 | } | ||||
| 32127 | |||||
| 32128 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 32129 | return false; | ||||
| 32130 | } | ||||
| 32131 | |||||
| 32132 | Record<nsString, OwningCanvasPatternOrCanvasGradient>::EntryType* entry; | ||||
| 32133 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 32134 | // Find the existing entry. | ||||
| 32135 | auto idx = recordEntries.IndexOf(propName); | ||||
| 32136 | 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", 32137); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 32137; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 32137 | "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", 32137); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 32137; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 32138 | // Now blow it away to make it look like it was just added | ||||
| 32139 | // to the array, because it's not obvious that it's | ||||
| 32140 | // safe to write to its already-initialized mValue via our | ||||
| 32141 | // normal codegen conversions. For example, the value | ||||
| 32142 | // could be a union and this would change its type, but | ||||
| 32143 | // codegen assumes we won't do that. | ||||
| 32144 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 32145 | } else { | ||||
| 32146 | // Safe to do an infallible append here, because we did a | ||||
| 32147 | // SetCapacity above to the right capacity. | ||||
| 32148 | entry = recordEntries.AppendElement(); | ||||
| 32149 | } | ||||
| 32150 | entry->mKey = propName; | ||||
| 32151 | OwningCanvasPatternOrCanvasGradient& slot = entry->mValue; | ||||
| 32152 | if (!slot.Init(cx, temp, "Value in argument 1", true)) { | ||||
| 32153 | return false; | ||||
| 32154 | } | ||||
| 32155 | } | ||||
| 32156 | } else { | ||||
| 32157 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 32158 | return false; | ||||
| 32159 | } | ||||
| 32160 | if (objIsXray) { | ||||
| 32161 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32162 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32163 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32164 | if (!unwrappedObj.ref()) { | ||||
| 32165 | return false; | ||||
| 32166 | } | ||||
| 32167 | } | ||||
| 32168 | FastErrorResult rv; | ||||
| 32169 | // NOTE: This assert does NOT call the function. | ||||
| 32170 | 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"); | ||||
| 32171 | MOZ_KnownLive(self)(self)->PassRecordOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32172 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions" )), 0))) { | ||||
| 32173 | return false; | ||||
| 32174 | } | ||||
| 32175 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32175; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32176 | args.rval().setUndefined(); | ||||
| 32177 | return true; | ||||
| 32178 | } | ||||
| 32179 | |||||
| 32180 | static const JSJitInfo passRecordOfUnions_methodinfo = { | ||||
| 32181 | { (JSJitGetterOp)passRecordOfUnions }, | ||||
| 32182 | { prototypes::id::TestJSImplInterface }, | ||||
| 32183 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32184 | JSJitInfo::Method, | ||||
| 32185 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32186 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32187 | false, /* isInfallible. False in setters. */ | ||||
| 32188 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32189 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32190 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32191 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32192 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32193 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32194 | }; | ||||
| 32195 | |||||
| 32196 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32197 | receiveUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32198 | { | ||||
| 32199 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32202( cx, "TestJSImplInterface" , "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32200 | "TestJSImplInterface", "receiveUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32202( cx, "TestJSImplInterface" , "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32201 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32202( cx, "TestJSImplInterface" , "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32202 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32202( cx, "TestJSImplInterface" , "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32203 | |||||
| 32204 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32205 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32206 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32207 | if (objIsXray) { | ||||
| 32208 | unwrappedObj.emplace(cx, obj); | ||||
| 32209 | } | ||||
| 32210 | if (objIsXray) { | ||||
| 32211 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32212 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32213 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32214 | if (!unwrappedObj.ref()) { | ||||
| 32215 | return false; | ||||
| 32216 | } | ||||
| 32217 | } | ||||
| 32218 | FastErrorResult rv; | ||||
| 32219 | OwningCanvasPatternOrCanvasGradient result; | ||||
| 32220 | // NOTE: This assert does NOT call the function. | ||||
| 32221 | 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"); | ||||
| 32222 | MOZ_KnownLive(self)(self)->ReceiveUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32223 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion" )), 0))) { | ||||
| 32224 | return false; | ||||
| 32225 | } | ||||
| 32226 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32226); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32226; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32227 | if (!result.ToJSVal(cx, obj, args.rval())) { | ||||
| 32228 | return false; | ||||
| 32229 | } | ||||
| 32230 | return true; | ||||
| 32231 | } | ||||
| 32232 | |||||
| 32233 | static const JSJitInfo receiveUnion_methodinfo = { | ||||
| 32234 | { (JSJitGetterOp)receiveUnion }, | ||||
| 32235 | { prototypes::id::TestJSImplInterface }, | ||||
| 32236 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32237 | JSJitInfo::Method, | ||||
| 32238 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32239 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 32240 | false, /* isInfallible. False in setters. */ | ||||
| 32241 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32242 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32243 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32244 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32245 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32246 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32247 | }; | ||||
| 32248 | |||||
| 32249 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32250 | receiveUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32251 | { | ||||
| 32252 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32255( cx, "TestJSImplInterface" , "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32253 | "TestJSImplInterface", "receiveUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32255( cx, "TestJSImplInterface" , "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32254 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32255( cx, "TestJSImplInterface" , "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32255 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32255( cx, "TestJSImplInterface" , "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32256 | |||||
| 32257 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32258 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32259 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32260 | if (objIsXray) { | ||||
| 32261 | unwrappedObj.emplace(cx, obj); | ||||
| 32262 | } | ||||
| 32263 | if (objIsXray) { | ||||
| 32264 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32265 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32266 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32267 | if (!unwrappedObj.ref()) { | ||||
| 32268 | return false; | ||||
| 32269 | } | ||||
| 32270 | } | ||||
| 32271 | FastErrorResult rv; | ||||
| 32272 | RootedUnion<OwningObjectOrLong> result(cx); | ||||
| 32273 | // NOTE: This assert does NOT call the function. | ||||
| 32274 | 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"); | ||||
| 32275 | MOZ_KnownLive(self)(self)->ReceiveUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32276 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2" )), 0))) { | ||||
| 32277 | return false; | ||||
| 32278 | } | ||||
| 32279 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32279); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32279; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32280 | if (!result.ToJSVal(cx, obj, args.rval())) { | ||||
| 32281 | return false; | ||||
| 32282 | } | ||||
| 32283 | return true; | ||||
| 32284 | } | ||||
| 32285 | |||||
| 32286 | static const JSJitInfo receiveUnion2_methodinfo = { | ||||
| 32287 | { (JSJitGetterOp)receiveUnion2 }, | ||||
| 32288 | { prototypes::id::TestJSImplInterface }, | ||||
| 32289 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32290 | JSJitInfo::Method, | ||||
| 32291 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32292 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32293 | false, /* isInfallible. False in setters. */ | ||||
| 32294 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32295 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32296 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32297 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32298 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32299 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32300 | }; | ||||
| 32301 | |||||
| 32302 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32303 | receiveUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32304 | { | ||||
| 32305 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32308( cx, "TestJSImplInterface" , "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32306 | "TestJSImplInterface", "receiveUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32308( cx, "TestJSImplInterface" , "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32307 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32308( cx, "TestJSImplInterface" , "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32308 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32308( cx, "TestJSImplInterface" , "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 32309 | |||||
| 32310 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32311 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32312 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32313 | if (objIsXray) { | ||||
| 32314 | unwrappedObj.emplace(cx, obj); | ||||
| 32315 | } | ||||
| 32316 | if (objIsXray) { | ||||
| 32317 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32318 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32319 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32320 | if (!unwrappedObj.ref()) { | ||||
| 32321 | return false; | ||||
| 32322 | } | ||||
| 32323 | } | ||||
| 32324 | FastErrorResult rv; | ||||
| 32325 | OwningCanvasPatternOrNullOrCanvasGradient result; | ||||
| 32326 | // NOTE: This assert does NOT call the function. | ||||
| 32327 | 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"); | ||||
| 32328 | MOZ_KnownLive(self)(self)->ReceiveUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32329 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull" )), 0))) { | ||||
| 32330 | return false; | ||||
| 32331 | } | ||||
| 32332 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32332); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32332; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32333 | if (!result.ToJSVal(cx, obj, args.rval())) { | ||||
| 32334 | return false; | ||||
| 32335 | } | ||||
| 32336 | return true; | ||||
| 32337 | } | ||||
| 32338 | |||||
| 32339 | static const JSJitInfo receiveUnionContainingNull_methodinfo = { | ||||
| 32340 | { (JSJitGetterOp)receiveUnionContainingNull }, | ||||
| 32341 | { prototypes::id::TestJSImplInterface }, | ||||
| 32342 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32343 | JSJitInfo::Method, | ||||
| 32344 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32345 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32346 | false, /* isInfallible. False in setters. */ | ||||
| 32347 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32348 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32349 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32350 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32351 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32352 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32353 | }; | ||||
| 32354 | |||||
| 32355 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32356 | receiveNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32357 | { | ||||
| 32358 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32361( cx, "TestJSImplInterface" , "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32359 | "TestJSImplInterface", "receiveNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32361( cx, "TestJSImplInterface" , "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32360 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32361( cx, "TestJSImplInterface" , "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32361 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32361( cx, "TestJSImplInterface" , "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32362 | |||||
| 32363 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32364 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32365 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32366 | if (objIsXray) { | ||||
| 32367 | unwrappedObj.emplace(cx, obj); | ||||
| 32368 | } | ||||
| 32369 | if (objIsXray) { | ||||
| 32370 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32371 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32372 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32373 | if (!unwrappedObj.ref()) { | ||||
| 32374 | return false; | ||||
| 32375 | } | ||||
| 32376 | } | ||||
| 32377 | FastErrorResult rv; | ||||
| 32378 | Nullable<OwningCanvasPatternOrCanvasGradient> result; | ||||
| 32379 | // NOTE: This assert does NOT call the function. | ||||
| 32380 | 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"); | ||||
| 32381 | MOZ_KnownLive(self)(self)->ReceiveNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32382 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion" )), 0))) { | ||||
| 32383 | return false; | ||||
| 32384 | } | ||||
| 32385 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32385); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32385; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32386 | if (result.IsNull()) { | ||||
| 32387 | args.rval().setNull(); | ||||
| 32388 | return true; | ||||
| 32389 | } | ||||
| 32390 | if (!result.Value().ToJSVal(cx, obj, args.rval())) { | ||||
| 32391 | return false; | ||||
| 32392 | } | ||||
| 32393 | return true; | ||||
| 32394 | } | ||||
| 32395 | |||||
| 32396 | static const JSJitInfo receiveNullableUnion_methodinfo = { | ||||
| 32397 | { (JSJitGetterOp)receiveNullableUnion }, | ||||
| 32398 | { prototypes::id::TestJSImplInterface }, | ||||
| 32399 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32400 | JSJitInfo::Method, | ||||
| 32401 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32402 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32403 | false, /* isInfallible. False in setters. */ | ||||
| 32404 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32405 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32406 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32407 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32408 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32409 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32410 | }; | ||||
| 32411 | |||||
| 32412 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32413 | receiveNullableUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32414 | { | ||||
| 32415 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32418( cx, "TestJSImplInterface" , "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32416 | "TestJSImplInterface", "receiveNullableUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32418( cx, "TestJSImplInterface" , "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32417 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32418( cx, "TestJSImplInterface" , "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32418 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32418( cx, "TestJSImplInterface" , "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32419 | |||||
| 32420 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32421 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32422 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32423 | if (objIsXray) { | ||||
| 32424 | unwrappedObj.emplace(cx, obj); | ||||
| 32425 | } | ||||
| 32426 | if (objIsXray) { | ||||
| 32427 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32428 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32429 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32430 | if (!unwrappedObj.ref()) { | ||||
| 32431 | return false; | ||||
| 32432 | } | ||||
| 32433 | } | ||||
| 32434 | FastErrorResult rv; | ||||
| 32435 | NullableRootedUnion<OwningObjectOrLong> result(cx); | ||||
| 32436 | // NOTE: This assert does NOT call the function. | ||||
| 32437 | 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"); | ||||
| 32438 | MOZ_KnownLive(self)(self)->ReceiveNullableUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32439 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2" )), 0))) { | ||||
| 32440 | return false; | ||||
| 32441 | } | ||||
| 32442 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32442); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32442; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32443 | if (result.IsNull()) { | ||||
| 32444 | args.rval().setNull(); | ||||
| 32445 | return true; | ||||
| 32446 | } | ||||
| 32447 | if (!result.Value().ToJSVal(cx, obj, args.rval())) { | ||||
| 32448 | return false; | ||||
| 32449 | } | ||||
| 32450 | return true; | ||||
| 32451 | } | ||||
| 32452 | |||||
| 32453 | static const JSJitInfo receiveNullableUnion2_methodinfo = { | ||||
| 32454 | { (JSJitGetterOp)receiveNullableUnion2 }, | ||||
| 32455 | { prototypes::id::TestJSImplInterface }, | ||||
| 32456 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32457 | JSJitInfo::Method, | ||||
| 32458 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32459 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32460 | false, /* isInfallible. False in setters. */ | ||||
| 32461 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32462 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32463 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32464 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32465 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32466 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32467 | }; | ||||
| 32468 | |||||
| 32469 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32470 | get_writableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 32471 | { | ||||
| 32472 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32475( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32473 | "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32475( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32474 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32475( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32475 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32475( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32476 | |||||
| 32477 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32478 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32479 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32480 | if (objIsXray) { | ||||
| 32481 | unwrappedObj.emplace(cx, obj); | ||||
| 32482 | } | ||||
| 32483 | if (objIsXray) { | ||||
| 32484 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32485 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32486 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32487 | if (!unwrappedObj.ref()) { | ||||
| 32488 | return false; | ||||
| 32489 | } | ||||
| 32490 | } | ||||
| 32491 | FastErrorResult rv; | ||||
| 32492 | OwningCanvasPatternOrCanvasGradient result; | ||||
| 32493 | // NOTE: This assert does NOT call the function. | ||||
| 32494 | 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"); | ||||
| 32495 | MOZ_KnownLive(self)(self)->GetWritableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32496 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter" )), 0))) { | ||||
| 32497 | return false; | ||||
| 32498 | } | ||||
| 32499 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32499); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32499; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32500 | if (!result.ToJSVal(cx, obj, args.rval())) { | ||||
| 32501 | return false; | ||||
| 32502 | } | ||||
| 32503 | return true; | ||||
| 32504 | } | ||||
| 32505 | |||||
| 32506 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32507 | set_writableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 32508 | { | ||||
| 32509 | BindingCallContext cx(cx_, "TestJSImplInterface.writableUnion setter"); | ||||
| 32510 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32513( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32511 | "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32513( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32512 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32513( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32513 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32513( cx, "TestJSImplInterface" , "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32514 | |||||
| 32515 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32516 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32517 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32518 | if (objIsXray) { | ||||
| 32519 | unwrappedObj.emplace(cx, obj); | ||||
| 32520 | } | ||||
| 32521 | CanvasPatternOrCanvasGradient arg0; | ||||
| 32522 | if (!arg0.Init(cx, args[0], "Value being assigned", true)) { | ||||
| 32523 | return false; | ||||
| 32524 | } | ||||
| 32525 | if (objIsXray) { | ||||
| 32526 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32527 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32528 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32529 | if (!unwrappedObj.ref()) { | ||||
| 32530 | return false; | ||||
| 32531 | } | ||||
| 32532 | } | ||||
| 32533 | FastErrorResult rv; | ||||
| 32534 | // NOTE: This assert does NOT call the function. | ||||
| 32535 | 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"); | ||||
| 32536 | MOZ_KnownLive(self)(self)->SetWritableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32537 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter" )), 0))) { | ||||
| 32538 | return false; | ||||
| 32539 | } | ||||
| 32540 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32540); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32540; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32541 | |||||
| 32542 | return true; | ||||
| 32543 | } | ||||
| 32544 | |||||
| 32545 | static const JSJitInfo writableUnion_getterinfo = { | ||||
| 32546 | { get_writableUnion }, | ||||
| 32547 | { prototypes::id::TestJSImplInterface }, | ||||
| 32548 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32549 | JSJitInfo::Getter, | ||||
| 32550 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32551 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 32552 | false, /* isInfallible. False in setters. */ | ||||
| 32553 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32554 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32555 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32556 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32557 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32558 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32559 | }; | ||||
| 32560 | static const JSJitInfo writableUnion_setterinfo = { | ||||
| 32561 | { (JSJitGetterOp)set_writableUnion }, | ||||
| 32562 | { prototypes::id::TestJSImplInterface }, | ||||
| 32563 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32564 | JSJitInfo::Setter, | ||||
| 32565 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32566 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32567 | false, /* isInfallible. False in setters. */ | ||||
| 32568 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32569 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32570 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32571 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32572 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32573 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32574 | }; | ||||
| 32575 | |||||
| 32576 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32577 | get_writableUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 32578 | { | ||||
| 32579 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32582( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32580 | "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32582( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32581 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32582( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32582 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32582( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 32583 | |||||
| 32584 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32585 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32586 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32587 | if (objIsXray) { | ||||
| 32588 | unwrappedObj.emplace(cx, obj); | ||||
| 32589 | } | ||||
| 32590 | if (objIsXray) { | ||||
| 32591 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32592 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32593 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32594 | if (!unwrappedObj.ref()) { | ||||
| 32595 | return false; | ||||
| 32596 | } | ||||
| 32597 | } | ||||
| 32598 | FastErrorResult rv; | ||||
| 32599 | OwningCanvasPatternOrNullOrCanvasGradient result; | ||||
| 32600 | // NOTE: This assert does NOT call the function. | ||||
| 32601 | 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"); | ||||
| 32602 | MOZ_KnownLive(self)(self)->GetWritableUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32603 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter" )), 0))) { | ||||
| 32604 | return false; | ||||
| 32605 | } | ||||
| 32606 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32606); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32606; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32607 | if (!result.ToJSVal(cx, obj, args.rval())) { | ||||
| 32608 | return false; | ||||
| 32609 | } | ||||
| 32610 | return true; | ||||
| 32611 | } | ||||
| 32612 | |||||
| 32613 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32614 | set_writableUnionContainingNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 32615 | { | ||||
| 32616 | BindingCallContext cx(cx_, "TestJSImplInterface.writableUnionContainingNull setter"); | ||||
| 32617 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32620( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32618 | "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32620( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32619 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32620( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 32620 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32620( cx, "TestJSImplInterface" , "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 32621 | |||||
| 32622 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32623 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32624 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32625 | if (objIsXray) { | ||||
| 32626 | unwrappedObj.emplace(cx, obj); | ||||
| 32627 | } | ||||
| 32628 | CanvasPatternOrNullOrCanvasGradient arg0; | ||||
| 32629 | if (!arg0.Init(cx, args[0], "Value being assigned", true)) { | ||||
| 32630 | return false; | ||||
| 32631 | } | ||||
| 32632 | if (objIsXray) { | ||||
| 32633 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32634 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32635 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32636 | if (!unwrappedObj.ref()) { | ||||
| 32637 | return false; | ||||
| 32638 | } | ||||
| 32639 | } | ||||
| 32640 | FastErrorResult rv; | ||||
| 32641 | // NOTE: This assert does NOT call the function. | ||||
| 32642 | 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"); | ||||
| 32643 | MOZ_KnownLive(self)(self)->SetWritableUnionContainingNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32644 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter" )), 0))) { | ||||
| 32645 | return false; | ||||
| 32646 | } | ||||
| 32647 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32647); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32647; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32648 | |||||
| 32649 | return true; | ||||
| 32650 | } | ||||
| 32651 | |||||
| 32652 | static const JSJitInfo writableUnionContainingNull_getterinfo = { | ||||
| 32653 | { get_writableUnionContainingNull }, | ||||
| 32654 | { prototypes::id::TestJSImplInterface }, | ||||
| 32655 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32656 | JSJitInfo::Getter, | ||||
| 32657 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32658 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32659 | false, /* isInfallible. False in setters. */ | ||||
| 32660 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32661 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32662 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32663 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32664 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32665 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32666 | }; | ||||
| 32667 | static const JSJitInfo writableUnionContainingNull_setterinfo = { | ||||
| 32668 | { (JSJitGetterOp)set_writableUnionContainingNull }, | ||||
| 32669 | { prototypes::id::TestJSImplInterface }, | ||||
| 32670 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32671 | JSJitInfo::Setter, | ||||
| 32672 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32673 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32674 | false, /* isInfallible. False in setters. */ | ||||
| 32675 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32676 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32677 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32678 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32679 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32680 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32681 | }; | ||||
| 32682 | |||||
| 32683 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32684 | get_writableNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 32685 | { | ||||
| 32686 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32689( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32687 | "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32689( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32688 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32689( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32689 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32689( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32690 | |||||
| 32691 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32692 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32693 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32694 | if (objIsXray) { | ||||
| 32695 | unwrappedObj.emplace(cx, obj); | ||||
| 32696 | } | ||||
| 32697 | if (objIsXray) { | ||||
| 32698 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32699 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32700 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32701 | if (!unwrappedObj.ref()) { | ||||
| 32702 | return false; | ||||
| 32703 | } | ||||
| 32704 | } | ||||
| 32705 | FastErrorResult rv; | ||||
| 32706 | Nullable<OwningCanvasPatternOrCanvasGradient> result; | ||||
| 32707 | // NOTE: This assert does NOT call the function. | ||||
| 32708 | 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"); | ||||
| 32709 | MOZ_KnownLive(self)(self)->GetWritableNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32710 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter" )), 0))) { | ||||
| 32711 | return false; | ||||
| 32712 | } | ||||
| 32713 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32713); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32713; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32714 | if (result.IsNull()) { | ||||
| 32715 | args.rval().setNull(); | ||||
| 32716 | return true; | ||||
| 32717 | } | ||||
| 32718 | if (!result.Value().ToJSVal(cx, obj, args.rval())) { | ||||
| 32719 | return false; | ||||
| 32720 | } | ||||
| 32721 | return true; | ||||
| 32722 | } | ||||
| 32723 | |||||
| 32724 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32725 | set_writableNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 32726 | { | ||||
| 32727 | BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableUnion setter"); | ||||
| 32728 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32731( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32729 | "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32731( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32730 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32731( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32731 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32731( cx, "TestJSImplInterface" , "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32732 | |||||
| 32733 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32734 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32735 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32736 | if (objIsXray) { | ||||
| 32737 | unwrappedObj.emplace(cx, obj); | ||||
| 32738 | } | ||||
| 32739 | Nullable<CanvasPatternOrCanvasGradient > arg0; | ||||
| 32740 | if (args[0].isNullOrUndefined()) { | ||||
| 32741 | arg0.SetNull(); | ||||
| 32742 | } else { | ||||
| 32743 | if (!arg0.SetValue().Init(cx, args[0], "Value being assigned", true)) { | ||||
| 32744 | return false; | ||||
| 32745 | } | ||||
| 32746 | } | ||||
| 32747 | if (objIsXray) { | ||||
| 32748 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32749 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32750 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32751 | if (!unwrappedObj.ref()) { | ||||
| 32752 | return false; | ||||
| 32753 | } | ||||
| 32754 | } | ||||
| 32755 | FastErrorResult rv; | ||||
| 32756 | // NOTE: This assert does NOT call the function. | ||||
| 32757 | 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"); | ||||
| 32758 | MOZ_KnownLive(self)(self)->SetWritableNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32759 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter" )), 0))) { | ||||
| 32760 | return false; | ||||
| 32761 | } | ||||
| 32762 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32762); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32762; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32763 | |||||
| 32764 | return true; | ||||
| 32765 | } | ||||
| 32766 | |||||
| 32767 | static const JSJitInfo writableNullableUnion_getterinfo = { | ||||
| 32768 | { get_writableNullableUnion }, | ||||
| 32769 | { prototypes::id::TestJSImplInterface }, | ||||
| 32770 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32771 | JSJitInfo::Getter, | ||||
| 32772 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32773 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 32774 | false, /* isInfallible. False in setters. */ | ||||
| 32775 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32776 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32777 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32778 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32779 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32780 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32781 | }; | ||||
| 32782 | static const JSJitInfo writableNullableUnion_setterinfo = { | ||||
| 32783 | { (JSJitGetterOp)set_writableNullableUnion }, | ||||
| 32784 | { prototypes::id::TestJSImplInterface }, | ||||
| 32785 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32786 | JSJitInfo::Setter, | ||||
| 32787 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32788 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32789 | false, /* isInfallible. False in setters. */ | ||||
| 32790 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32791 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32792 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32793 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32794 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32795 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32796 | }; | ||||
| 32797 | |||||
| 32798 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32799 | passPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32800 | { | ||||
| 32801 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32804( cx, "TestJSImplInterface" , "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32802 | "TestJSImplInterface", "passPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32804( cx, "TestJSImplInterface" , "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32803 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32804( cx, "TestJSImplInterface" , "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32804 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32804( cx, "TestJSImplInterface" , "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32805 | |||||
| 32806 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32807 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromise", 1)) { | ||||
| 32808 | return false; | ||||
| 32809 | } | ||||
| 32810 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32811 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32812 | if (objIsXray) { | ||||
| 32813 | unwrappedObj.emplace(cx, obj); | ||||
| 32814 | } | ||||
| 32815 | OwningNonNull<Promise> arg0; | ||||
| 32816 | { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm, | ||||
| 32817 | // etc. | ||||
| 32818 | |||||
| 32819 | JS::Rooted<JSObject*> globalObj(cx); | ||||
| 32820 | globalObj = JS::CurrentGlobalOrNull(cx); | ||||
| 32821 | JSAutoRealm ar(cx, globalObj); | ||||
| 32822 | GlobalObject promiseGlobal(cx, globalObj); | ||||
| 32823 | if (promiseGlobal.Failed()) { | ||||
| 32824 | return false; | ||||
| 32825 | } | ||||
| 32826 | |||||
| 32827 | JS::Rooted<JS::Value> valueToResolve(cx, args[0]); | ||||
| 32828 | if (!JS_WrapValue(cx, &valueToResolve)) { | ||||
| 32829 | return false; | ||||
| 32830 | } | ||||
| 32831 | binding_detail::FastErrorResult promiseRv; | ||||
| 32832 | nsCOMPtr<nsIGlobalObject> global = | ||||
| 32833 | do_QueryInterface(promiseGlobal.GetAsSupports()); | ||||
| 32834 | if (!global) { | ||||
| 32835 | promiseRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 32836 | 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" , 32836); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)" ")"); do { *((volatile int*)__null) = 32836; __attribute__(( nomerge)) ::abort(); } while (false); } while (false); } } while (false); | ||||
| 32837 | return false; | ||||
| 32838 | } | ||||
| 32839 | arg0 = Promise::Resolve(global, cx, valueToResolve, | ||||
| 32840 | promiseRv); | ||||
| 32841 | if (promiseRv.MaybeSetPendingException(cx)) { | ||||
| 32842 | return false; | ||||
| 32843 | } | ||||
| 32844 | } | ||||
| 32845 | if (objIsXray) { | ||||
| 32846 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32847 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32848 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32849 | if (!unwrappedObj.ref()) { | ||||
| 32850 | return false; | ||||
| 32851 | } | ||||
| 32852 | } | ||||
| 32853 | FastErrorResult rv; | ||||
| 32854 | // NOTE: This assert does NOT call the function. | ||||
| 32855 | 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"); | ||||
| 32856 | MOZ_KnownLive(self)(self)->PassPromise(NonNullHelper(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32857 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise" )), 0))) { | ||||
| 32858 | return false; | ||||
| 32859 | } | ||||
| 32860 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32860); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32860; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32861 | args.rval().setUndefined(); | ||||
| 32862 | return true; | ||||
| 32863 | } | ||||
| 32864 | |||||
| 32865 | static const JSJitInfo passPromise_methodinfo = { | ||||
| 32866 | { (JSJitGetterOp)passPromise }, | ||||
| 32867 | { prototypes::id::TestJSImplInterface }, | ||||
| 32868 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32869 | JSJitInfo::Method, | ||||
| 32870 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32871 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32872 | false, /* isInfallible. False in setters. */ | ||||
| 32873 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32874 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32875 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32876 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32877 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32878 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32879 | }; | ||||
| 32880 | |||||
| 32881 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32882 | passOptionalPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32883 | { | ||||
| 32884 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32887( cx, "TestJSImplInterface" , "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32885 | "TestJSImplInterface", "passOptionalPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32887( cx, "TestJSImplInterface" , "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32886 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32887( cx, "TestJSImplInterface" , "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32887 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32887( cx, "TestJSImplInterface" , "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32888 | |||||
| 32889 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32890 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32891 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32892 | if (objIsXray) { | ||||
| 32893 | unwrappedObj.emplace(cx, obj); | ||||
| 32894 | } | ||||
| 32895 | Optional<OwningNonNull<Promise>> arg0; | ||||
| 32896 | if (args.hasDefined(0)) { | ||||
| 32897 | arg0.Construct(); | ||||
| 32898 | { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm, | ||||
| 32899 | // etc. | ||||
| 32900 | |||||
| 32901 | JS::Rooted<JSObject*> globalObj(cx); | ||||
| 32902 | globalObj = JS::CurrentGlobalOrNull(cx); | ||||
| 32903 | JSAutoRealm ar(cx, globalObj); | ||||
| 32904 | GlobalObject promiseGlobal(cx, globalObj); | ||||
| 32905 | if (promiseGlobal.Failed()) { | ||||
| 32906 | return false; | ||||
| 32907 | } | ||||
| 32908 | |||||
| 32909 | JS::Rooted<JS::Value> valueToResolve(cx, args[0]); | ||||
| 32910 | if (!JS_WrapValue(cx, &valueToResolve)) { | ||||
| 32911 | return false; | ||||
| 32912 | } | ||||
| 32913 | binding_detail::FastErrorResult promiseRv; | ||||
| 32914 | nsCOMPtr<nsIGlobalObject> global = | ||||
| 32915 | do_QueryInterface(promiseGlobal.GetAsSupports()); | ||||
| 32916 | if (!global) { | ||||
| 32917 | promiseRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 32918 | 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" , 32918); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)" ")"); do { *((volatile int*)__null) = 32918; __attribute__(( nomerge)) ::abort(); } while (false); } while (false); } } while (false); | ||||
| 32919 | return false; | ||||
| 32920 | } | ||||
| 32921 | arg0.Value() = Promise::Resolve(global, cx, valueToResolve, | ||||
| 32922 | promiseRv); | ||||
| 32923 | if (promiseRv.MaybeSetPendingException(cx)) { | ||||
| 32924 | return false; | ||||
| 32925 | } | ||||
| 32926 | } | ||||
| 32927 | } | ||||
| 32928 | if (objIsXray) { | ||||
| 32929 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 32930 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 32931 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 32932 | if (!unwrappedObj.ref()) { | ||||
| 32933 | return false; | ||||
| 32934 | } | ||||
| 32935 | } | ||||
| 32936 | FastErrorResult rv; | ||||
| 32937 | // NOTE: This assert does NOT call the function. | ||||
| 32938 | 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"); | ||||
| 32939 | MOZ_KnownLive(self)(self)->PassOptionalPromise(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 32940 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise" )), 0))) { | ||||
| 32941 | return false; | ||||
| 32942 | } | ||||
| 32943 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 32943); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 32943; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 32944 | args.rval().setUndefined(); | ||||
| 32945 | return true; | ||||
| 32946 | } | ||||
| 32947 | |||||
| 32948 | static const JSJitInfo passOptionalPromise_methodinfo = { | ||||
| 32949 | { (JSJitGetterOp)passOptionalPromise }, | ||||
| 32950 | { prototypes::id::TestJSImplInterface }, | ||||
| 32951 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 32952 | JSJitInfo::Method, | ||||
| 32953 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 32954 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 32955 | false, /* isInfallible. False in setters. */ | ||||
| 32956 | false, /* isMovable. Not relevant for setters. */ | ||||
| 32957 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 32958 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 32959 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 32960 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 32961 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 32962 | }; | ||||
| 32963 | |||||
| 32964 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 32965 | passPromiseSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 32966 | { | ||||
| 32967 | BindingCallContext cx(cx_, "TestJSImplInterface.passPromiseSequence"); | ||||
| 32968 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32971( cx, "TestJSImplInterface" , "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32969 | "TestJSImplInterface", "passPromiseSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32971( cx, "TestJSImplInterface" , "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32970 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32971( cx, "TestJSImplInterface" , "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 32971 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32971( cx, "TestJSImplInterface" , "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 32972 | |||||
| 32973 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 32974 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromiseSequence", 1)) { | ||||
| 32975 | return false; | ||||
| 32976 | } | ||||
| 32977 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 32978 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 32979 | if (objIsXray) { | ||||
| 32980 | unwrappedObj.emplace(cx, obj); | ||||
| 32981 | } | ||||
| 32982 | binding_detail::AutoSequence<OwningNonNull<Promise>> arg0; | ||||
| 32983 | if (args[0].isObject()) { | ||||
| 32984 | JS::ForOfIterator iter(cx); | ||||
| 32985 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 32986 | return false; | ||||
| 32987 | } | ||||
| 32988 | if (!iter.valueIsIterable()) { | ||||
| 32989 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 32990 | return false; | ||||
| 32991 | } | ||||
| 32992 | binding_detail::AutoSequence<OwningNonNull<Promise>> &arr = arg0; | ||||
| 32993 | JS::Rooted<JS::Value> temp(cx); | ||||
| 32994 | while (true) { | ||||
| 32995 | bool done; | ||||
| 32996 | if (!iter.next(&temp, &done)) { | ||||
| 32997 | return false; | ||||
| 32998 | } | ||||
| 32999 | if (done) { | ||||
| 33000 | break; | ||||
| 33001 | } | ||||
| 33002 | OwningNonNull<Promise>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 33003 | if (!slotPtr) { | ||||
| 33004 | JS_ReportOutOfMemory(cx); | ||||
| 33005 | return false; | ||||
| 33006 | } | ||||
| 33007 | OwningNonNull<Promise>& slot = *slotPtr; | ||||
| 33008 | { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm, | ||||
| 33009 | // etc. | ||||
| 33010 | |||||
| 33011 | JS::Rooted<JSObject*> globalObj(cx); | ||||
| 33012 | globalObj = JS::CurrentGlobalOrNull(cx); | ||||
| 33013 | JSAutoRealm ar(cx, globalObj); | ||||
| 33014 | GlobalObject promiseGlobal(cx, globalObj); | ||||
| 33015 | if (promiseGlobal.Failed()) { | ||||
| 33016 | return false; | ||||
| 33017 | } | ||||
| 33018 | |||||
| 33019 | JS::Rooted<JS::Value> valueToResolve(cx, temp); | ||||
| 33020 | if (!JS_WrapValue(cx, &valueToResolve)) { | ||||
| 33021 | return false; | ||||
| 33022 | } | ||||
| 33023 | binding_detail::FastErrorResult promiseRv; | ||||
| 33024 | nsCOMPtr<nsIGlobalObject> global = | ||||
| 33025 | do_QueryInterface(promiseGlobal.GetAsSupports()); | ||||
| 33026 | if (!global) { | ||||
| 33027 | promiseRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 33028 | 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" , 33028); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)" ")"); do { *((volatile int*)__null) = 33028; __attribute__(( nomerge)) ::abort(); } while (false); } while (false); } } while (false); | ||||
| 33029 | return false; | ||||
| 33030 | } | ||||
| 33031 | slot = Promise::Resolve(global, cx, valueToResolve, | ||||
| 33032 | promiseRv); | ||||
| 33033 | if (promiseRv.MaybeSetPendingException(cx)) { | ||||
| 33034 | return false; | ||||
| 33035 | } | ||||
| 33036 | } | ||||
| 33037 | } | ||||
| 33038 | } else { | ||||
| 33039 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 33040 | return false; | ||||
| 33041 | } | ||||
| 33042 | if (objIsXray) { | ||||
| 33043 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33044 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33045 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33046 | if (!unwrappedObj.ref()) { | ||||
| 33047 | return false; | ||||
| 33048 | } | ||||
| 33049 | } | ||||
| 33050 | FastErrorResult rv; | ||||
| 33051 | // NOTE: This assert does NOT call the function. | ||||
| 33052 | 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"); | ||||
| 33053 | MOZ_KnownLive(self)(self)->PassPromiseSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33054 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence" )), 0))) { | ||||
| 33055 | return false; | ||||
| 33056 | } | ||||
| 33057 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33057); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33057; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33058 | args.rval().setUndefined(); | ||||
| 33059 | return true; | ||||
| 33060 | } | ||||
| 33061 | |||||
| 33062 | static const JSJitInfo passPromiseSequence_methodinfo = { | ||||
| 33063 | { (JSJitGetterOp)passPromiseSequence }, | ||||
| 33064 | { prototypes::id::TestJSImplInterface }, | ||||
| 33065 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33066 | JSJitInfo::Method, | ||||
| 33067 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33068 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33069 | false, /* isInfallible. False in setters. */ | ||||
| 33070 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33071 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33072 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33073 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33074 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33075 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33076 | }; | ||||
| 33077 | |||||
| 33078 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33079 | receivePromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33080 | { | ||||
| 33081 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33084( cx, "TestJSImplInterface" , "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33082 | "TestJSImplInterface", "receivePromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33084( cx, "TestJSImplInterface" , "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33083 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33084( cx, "TestJSImplInterface" , "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33084 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33084( cx, "TestJSImplInterface" , "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33085 | |||||
| 33086 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33087 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33088 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33089 | if (objIsXray) { | ||||
| 33090 | unwrappedObj.emplace(cx, obj); | ||||
| 33091 | } | ||||
| 33092 | if (objIsXray) { | ||||
| 33093 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33094 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33095 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33096 | if (!unwrappedObj.ref()) { | ||||
| 33097 | return false; | ||||
| 33098 | } | ||||
| 33099 | } | ||||
| 33100 | FastErrorResult rv; | ||||
| 33101 | auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceivePromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 33102 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise" )), 0))) { | ||||
| 33103 | return false; | ||||
| 33104 | } | ||||
| 33105 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33105); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33105; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33106 | if (!ToJSValue(cx, result, args.rval())) { | ||||
| 33107 | return false; | ||||
| 33108 | } | ||||
| 33109 | return true; | ||||
| 33110 | } | ||||
| 33111 | |||||
| 33112 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33113 | receivePromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33114 | { | ||||
| 33115 | bool ok = receivePromise(cx, obj, void_self, args); | ||||
| 33116 | if (ok) { | ||||
| 33117 | return true; | ||||
| 33118 | } | ||||
| 33119 | return ConvertExceptionToPromise(cx, args.rval()); | ||||
| 33120 | } | ||||
| 33121 | |||||
| 33122 | static const JSJitInfo receivePromise_methodinfo = { | ||||
| 33123 | { (JSJitGetterOp)receivePromise_promiseWrapper }, | ||||
| 33124 | { prototypes::id::TestJSImplInterface }, | ||||
| 33125 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33126 | JSJitInfo::Method, | ||||
| 33127 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33128 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 33129 | false, /* isInfallible. False in setters. */ | ||||
| 33130 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33131 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33132 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33133 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33134 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33135 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33136 | }; | ||||
| 33137 | |||||
| 33138 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33139 | receiveAddrefedPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33140 | { | ||||
| 33141 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33144( cx, "TestJSImplInterface" , "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33142 | "TestJSImplInterface", "receiveAddrefedPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33144( cx, "TestJSImplInterface" , "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33143 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33144( cx, "TestJSImplInterface" , "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33144 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33144( cx, "TestJSImplInterface" , "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33145 | |||||
| 33146 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33147 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33148 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33149 | if (objIsXray) { | ||||
| 33150 | unwrappedObj.emplace(cx, obj); | ||||
| 33151 | } | ||||
| 33152 | if (objIsXray) { | ||||
| 33153 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33154 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33155 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33156 | if (!unwrappedObj.ref()) { | ||||
| 33157 | return false; | ||||
| 33158 | } | ||||
| 33159 | } | ||||
| 33160 | FastErrorResult rv; | ||||
| 33161 | auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceiveAddrefedPromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 33162 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise" )), 0))) { | ||||
| 33163 | return false; | ||||
| 33164 | } | ||||
| 33165 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33165); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33165; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33166 | if (!ToJSValue(cx, result, args.rval())) { | ||||
| 33167 | return false; | ||||
| 33168 | } | ||||
| 33169 | return true; | ||||
| 33170 | } | ||||
| 33171 | |||||
| 33172 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33173 | receiveAddrefedPromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33174 | { | ||||
| 33175 | bool ok = receiveAddrefedPromise(cx, obj, void_self, args); | ||||
| 33176 | if (ok) { | ||||
| 33177 | return true; | ||||
| 33178 | } | ||||
| 33179 | return ConvertExceptionToPromise(cx, args.rval()); | ||||
| 33180 | } | ||||
| 33181 | |||||
| 33182 | static const JSJitInfo receiveAddrefedPromise_methodinfo = { | ||||
| 33183 | { (JSJitGetterOp)receiveAddrefedPromise_promiseWrapper }, | ||||
| 33184 | { prototypes::id::TestJSImplInterface }, | ||||
| 33185 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33186 | JSJitInfo::Method, | ||||
| 33187 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33188 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 33189 | false, /* isInfallible. False in setters. */ | ||||
| 33190 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33191 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33192 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33193 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33194 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33195 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33196 | }; | ||||
| 33197 | |||||
| 33198 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33199 | methodRenamedFrom(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33200 | { | ||||
| 33201 | BindingCallContext cx(cx_, "TestJSImplInterface.methodRenamedFrom"); | ||||
| 33202 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33205( cx, "TestJSImplInterface" , "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33203 | "TestJSImplInterface", "methodRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33205( cx, "TestJSImplInterface" , "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33204 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33205( cx, "TestJSImplInterface" , "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33205 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33205( cx, "TestJSImplInterface" , "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33206 | |||||
| 33207 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33208 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 33209 | switch (argcount) { | ||||
| 33210 | case 0: { | ||||
| 33211 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33212 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33213 | if (objIsXray) { | ||||
| 33214 | unwrappedObj.emplace(cx, obj); | ||||
| 33215 | } | ||||
| 33216 | if (objIsXray) { | ||||
| 33217 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33218 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33219 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33220 | if (!unwrappedObj.ref()) { | ||||
| 33221 | return false; | ||||
| 33222 | } | ||||
| 33223 | } | ||||
| 33224 | FastErrorResult rv; | ||||
| 33225 | // NOTE: This assert does NOT call the function. | ||||
| 33226 | 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"); | ||||
| 33227 | MOZ_KnownLive(self)(self)->MethodRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33228 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom" )), 0))) { | ||||
| 33229 | return false; | ||||
| 33230 | } | ||||
| 33231 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33231); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33231; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33232 | args.rval().setUndefined(); | ||||
| 33233 | return true; | ||||
| 33234 | break; | ||||
| 33235 | } | ||||
| 33236 | case 1: { | ||||
| 33237 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33238 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33239 | if (objIsXray) { | ||||
| 33240 | unwrappedObj.emplace(cx, obj); | ||||
| 33241 | } | ||||
| 33242 | int8_t arg0; | ||||
| 33243 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 33244 | return false; | ||||
| 33245 | } | ||||
| 33246 | if (objIsXray) { | ||||
| 33247 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33248 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33249 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33250 | if (!unwrappedObj.ref()) { | ||||
| 33251 | return false; | ||||
| 33252 | } | ||||
| 33253 | } | ||||
| 33254 | FastErrorResult rv; | ||||
| 33255 | // NOTE: This assert does NOT call the function. | ||||
| 33256 | 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"); | ||||
| 33257 | MOZ_KnownLive(self)(self)->MethodRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33258 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom" )), 0))) { | ||||
| 33259 | return false; | ||||
| 33260 | } | ||||
| 33261 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33261); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33261; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33262 | args.rval().setUndefined(); | ||||
| 33263 | return true; | ||||
| 33264 | break; | ||||
| 33265 | } | ||||
| 33266 | default: { | ||||
| 33267 | // Using nsPrintfCString here would require including that | ||||
| 33268 | // header. Let's not worry about it. | ||||
| 33269 | nsAutoCString argCountStr; | ||||
| 33270 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 33271 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 33272 | } | ||||
| 33273 | } | ||||
| 33274 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 33274); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 33274; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 33275 | return false; | ||||
| 33276 | } | ||||
| 33277 | |||||
| 33278 | static const JSJitInfo methodRenamedFrom_methodinfo = { | ||||
| 33279 | { (JSJitGetterOp)methodRenamedFrom }, | ||||
| 33280 | { prototypes::id::TestJSImplInterface }, | ||||
| 33281 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33282 | JSJitInfo::Method, | ||||
| 33283 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33284 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33285 | false, /* isInfallible. False in setters. */ | ||||
| 33286 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33287 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33288 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33289 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33290 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33291 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33292 | }; | ||||
| 33293 | |||||
| 33294 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33295 | get_attributeGetterRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 33296 | { | ||||
| 33297 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33300( cx, "TestJSImplInterface" , "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33298 | "TestJSImplInterface", "attributeGetterRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33300( cx, "TestJSImplInterface" , "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33299 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33300( cx, "TestJSImplInterface" , "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33300 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33300( cx, "TestJSImplInterface" , "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 33301 | |||||
| 33302 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33303 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33304 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33305 | if (objIsXray) { | ||||
| 33306 | unwrappedObj.emplace(cx, obj); | ||||
| 33307 | } | ||||
| 33308 | if (objIsXray) { | ||||
| 33309 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33310 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33311 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33312 | if (!unwrappedObj.ref()) { | ||||
| 33313 | return false; | ||||
| 33314 | } | ||||
| 33315 | } | ||||
| 33316 | FastErrorResult rv; | ||||
| 33317 | int8_t result(MOZ_KnownLive(self)(self)->GetAttributeGetterRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 33318 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter" )), 0))) { | ||||
| 33319 | return false; | ||||
| 33320 | } | ||||
| 33321 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33321); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33321; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33322 | args.rval().setInt32(int32_t(result)); | ||||
| 33323 | return true; | ||||
| 33324 | } | ||||
| 33325 | |||||
| 33326 | static const JSJitInfo attributeGetterRenamedFrom_getterinfo = { | ||||
| 33327 | { get_attributeGetterRenamedFrom }, | ||||
| 33328 | { prototypes::id::TestJSImplInterface }, | ||||
| 33329 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33330 | JSJitInfo::Getter, | ||||
| 33331 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33332 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 33333 | false, /* isInfallible. False in setters. */ | ||||
| 33334 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33335 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33336 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33337 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33338 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33339 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33340 | }; | ||||
| 33341 | |||||
| 33342 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33343 | get_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 33344 | { | ||||
| 33345 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33348( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33346 | "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33348( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33347 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33348( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33348 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33348( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33349 | |||||
| 33350 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33351 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33352 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33353 | if (objIsXray) { | ||||
| 33354 | unwrappedObj.emplace(cx, obj); | ||||
| 33355 | } | ||||
| 33356 | if (objIsXray) { | ||||
| 33357 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33358 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33359 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33360 | if (!unwrappedObj.ref()) { | ||||
| 33361 | return false; | ||||
| 33362 | } | ||||
| 33363 | } | ||||
| 33364 | FastErrorResult rv; | ||||
| 33365 | int8_t result(MOZ_KnownLive(self)(self)->GetAttributeRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 33366 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter" )), 0))) { | ||||
| 33367 | return false; | ||||
| 33368 | } | ||||
| 33369 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33369); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33369; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33370 | args.rval().setInt32(int32_t(result)); | ||||
| 33371 | return true; | ||||
| 33372 | } | ||||
| 33373 | |||||
| 33374 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33375 | set_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 33376 | { | ||||
| 33377 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33380( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33378 | "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33380( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33379 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject33380( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33380 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33380( cx, "TestJSImplInterface" , "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33381 | |||||
| 33382 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33383 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33384 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33385 | if (objIsXray) { | ||||
| 33386 | unwrappedObj.emplace(cx, obj); | ||||
| 33387 | } | ||||
| 33388 | int8_t arg0; | ||||
| 33389 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 33390 | return false; | ||||
| 33391 | } | ||||
| 33392 | if (objIsXray) { | ||||
| 33393 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33394 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33395 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33396 | if (!unwrappedObj.ref()) { | ||||
| 33397 | return false; | ||||
| 33398 | } | ||||
| 33399 | } | ||||
| 33400 | FastErrorResult rv; | ||||
| 33401 | // NOTE: This assert does NOT call the function. | ||||
| 33402 | 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"); | ||||
| 33403 | MOZ_KnownLive(self)(self)->SetAttributeRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33404 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter" )), 0))) { | ||||
| 33405 | return false; | ||||
| 33406 | } | ||||
| 33407 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33407); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33407; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33408 | |||||
| 33409 | return true; | ||||
| 33410 | } | ||||
| 33411 | |||||
| 33412 | static const JSJitInfo attributeRenamedFrom_getterinfo = { | ||||
| 33413 | { get_attributeRenamedFrom }, | ||||
| 33414 | { prototypes::id::TestJSImplInterface }, | ||||
| 33415 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33416 | JSJitInfo::Getter, | ||||
| 33417 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33418 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 33419 | false, /* isInfallible. False in setters. */ | ||||
| 33420 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33421 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33422 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33423 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33424 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33425 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33426 | }; | ||||
| 33427 | static const JSJitInfo attributeRenamedFrom_setterinfo = { | ||||
| 33428 | { (JSJitGetterOp)set_attributeRenamedFrom }, | ||||
| 33429 | { prototypes::id::TestJSImplInterface }, | ||||
| 33430 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33431 | JSJitInfo::Setter, | ||||
| 33432 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33433 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33434 | false, /* isInfallible. False in setters. */ | ||||
| 33435 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33436 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33437 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33438 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33439 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33440 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33441 | }; | ||||
| 33442 | |||||
| 33443 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33444 | passDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33445 | { | ||||
| 33446 | BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary"); | ||||
| 33447 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33450( cx, "TestJSImplInterface" , "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33448 | "TestJSImplInterface", "passDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33450( cx, "TestJSImplInterface" , "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33449 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33450( cx, "TestJSImplInterface" , "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33450 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33450( cx, "TestJSImplInterface" , "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33451 | |||||
| 33452 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33453 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33454 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33455 | if (objIsXray) { | ||||
| 33456 | unwrappedObj.emplace(cx, obj); | ||||
| 33457 | } | ||||
| 33458 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 33459 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 33460 | return false; | ||||
| 33461 | } | ||||
| 33462 | if (objIsXray) { | ||||
| 33463 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33464 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33465 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33466 | if (!unwrappedObj.ref()) { | ||||
| 33467 | return false; | ||||
| 33468 | } | ||||
| 33469 | } | ||||
| 33470 | FastErrorResult rv; | ||||
| 33471 | // NOTE: This assert does NOT call the function. | ||||
| 33472 | 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"); | ||||
| 33473 | MOZ_KnownLive(self)(self)->PassDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33474 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary" )), 0))) { | ||||
| 33475 | return false; | ||||
| 33476 | } | ||||
| 33477 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33477); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33477; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33478 | args.rval().setUndefined(); | ||||
| 33479 | return true; | ||||
| 33480 | } | ||||
| 33481 | |||||
| 33482 | static const JSJitInfo passDictionary_methodinfo = { | ||||
| 33483 | { (JSJitGetterOp)passDictionary }, | ||||
| 33484 | { prototypes::id::TestJSImplInterface }, | ||||
| 33485 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33486 | JSJitInfo::Method, | ||||
| 33487 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33488 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33489 | false, /* isInfallible. False in setters. */ | ||||
| 33490 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33491 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33492 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33493 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33494 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33495 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33496 | }; | ||||
| 33497 | |||||
| 33498 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33499 | passDictionary2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33500 | { | ||||
| 33501 | BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary2"); | ||||
| 33502 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33505( cx, "TestJSImplInterface" , "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33503 | "TestJSImplInterface", "passDictionary2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33505( cx, "TestJSImplInterface" , "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33504 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33505( cx, "TestJSImplInterface" , "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33505 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33505( cx, "TestJSImplInterface" , "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33506 | |||||
| 33507 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33508 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passDictionary2", 1)) { | ||||
| 33509 | return false; | ||||
| 33510 | } | ||||
| 33511 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33512 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33513 | if (objIsXray) { | ||||
| 33514 | unwrappedObj.emplace(cx, obj); | ||||
| 33515 | } | ||||
| 33516 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 33517 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 33518 | return false; | ||||
| 33519 | } | ||||
| 33520 | if (objIsXray) { | ||||
| 33521 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33522 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33523 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33524 | if (!unwrappedObj.ref()) { | ||||
| 33525 | return false; | ||||
| 33526 | } | ||||
| 33527 | } | ||||
| 33528 | FastErrorResult rv; | ||||
| 33529 | // NOTE: This assert does NOT call the function. | ||||
| 33530 | 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"); | ||||
| 33531 | MOZ_KnownLive(self)(self)->PassDictionary2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33532 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2" )), 0))) { | ||||
| 33533 | return false; | ||||
| 33534 | } | ||||
| 33535 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33535); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33535; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33536 | args.rval().setUndefined(); | ||||
| 33537 | return true; | ||||
| 33538 | } | ||||
| 33539 | |||||
| 33540 | static const JSJitInfo passDictionary2_methodinfo = { | ||||
| 33541 | { (JSJitGetterOp)passDictionary2 }, | ||||
| 33542 | { prototypes::id::TestJSImplInterface }, | ||||
| 33543 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33544 | JSJitInfo::Method, | ||||
| 33545 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33546 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33547 | false, /* isInfallible. False in setters. */ | ||||
| 33548 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33549 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33550 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33551 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33552 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33553 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33554 | }; | ||||
| 33555 | |||||
| 33556 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33557 | receiveDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33558 | { | ||||
| 33559 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33562( cx, "TestJSImplInterface" , "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33560 | "TestJSImplInterface", "receiveDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33562( cx, "TestJSImplInterface" , "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33561 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33562( cx, "TestJSImplInterface" , "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33562 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33562( cx, "TestJSImplInterface" , "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33563 | |||||
| 33564 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33565 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33566 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33567 | if (objIsXray) { | ||||
| 33568 | unwrappedObj.emplace(cx, obj); | ||||
| 33569 | } | ||||
| 33570 | if (objIsXray) { | ||||
| 33571 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33572 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33573 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33574 | if (!unwrappedObj.ref()) { | ||||
| 33575 | return false; | ||||
| 33576 | } | ||||
| 33577 | } | ||||
| 33578 | FastErrorResult rv; | ||||
| 33579 | RootedDictionary<Dict> result(cx); | ||||
| 33580 | // NOTE: This assert does NOT call the function. | ||||
| 33581 | 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"); | ||||
| 33582 | MOZ_KnownLive(self)(self)->ReceiveDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33583 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary" )), 0))) { | ||||
| 33584 | return false; | ||||
| 33585 | } | ||||
| 33586 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33586); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33586; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33587 | if (!result.ToObjectInternal(cx, args.rval())) { | ||||
| 33588 | return false; | ||||
| 33589 | } | ||||
| 33590 | return true; | ||||
| 33591 | } | ||||
| 33592 | |||||
| 33593 | static const JSJitInfo receiveDictionary_methodinfo = { | ||||
| 33594 | { (JSJitGetterOp)receiveDictionary }, | ||||
| 33595 | { prototypes::id::TestJSImplInterface }, | ||||
| 33596 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33597 | JSJitInfo::Method, | ||||
| 33598 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33599 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 33600 | false, /* isInfallible. False in setters. */ | ||||
| 33601 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33602 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33603 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33604 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33605 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33606 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33607 | }; | ||||
| 33608 | |||||
| 33609 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33610 | receiveNullableDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33611 | { | ||||
| 33612 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33615( cx, "TestJSImplInterface" , "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33613 | "TestJSImplInterface", "receiveNullableDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33615( cx, "TestJSImplInterface" , "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33614 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33615( cx, "TestJSImplInterface" , "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33615 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33615( cx, "TestJSImplInterface" , "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 33616 | |||||
| 33617 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33618 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33619 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33620 | if (objIsXray) { | ||||
| 33621 | unwrappedObj.emplace(cx, obj); | ||||
| 33622 | } | ||||
| 33623 | if (objIsXray) { | ||||
| 33624 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33625 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33626 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33627 | if (!unwrappedObj.ref()) { | ||||
| 33628 | return false; | ||||
| 33629 | } | ||||
| 33630 | } | ||||
| 33631 | FastErrorResult rv; | ||||
| 33632 | NullableRootedDictionary<Dict> result(cx); | ||||
| 33633 | // NOTE: This assert does NOT call the function. | ||||
| 33634 | 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"); | ||||
| 33635 | MOZ_KnownLive(self)(self)->ReceiveNullableDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33636 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary" )), 0))) { | ||||
| 33637 | return false; | ||||
| 33638 | } | ||||
| 33639 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33639); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33639; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33640 | if (result.IsNull()) { | ||||
| 33641 | args.rval().setNull(); | ||||
| 33642 | return true; | ||||
| 33643 | } | ||||
| 33644 | if (!result.Value().ToObjectInternal(cx, args.rval())) { | ||||
| 33645 | return false; | ||||
| 33646 | } | ||||
| 33647 | return true; | ||||
| 33648 | } | ||||
| 33649 | |||||
| 33650 | static const JSJitInfo receiveNullableDictionary_methodinfo = { | ||||
| 33651 | { (JSJitGetterOp)receiveNullableDictionary }, | ||||
| 33652 | { prototypes::id::TestJSImplInterface }, | ||||
| 33653 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33654 | JSJitInfo::Method, | ||||
| 33655 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33656 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 33657 | false, /* isInfallible. False in setters. */ | ||||
| 33658 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33659 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33660 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33661 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33662 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33663 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33664 | }; | ||||
| 33665 | |||||
| 33666 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33667 | passOtherDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33668 | { | ||||
| 33669 | BindingCallContext cx(cx_, "TestJSImplInterface.passOtherDictionary"); | ||||
| 33670 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33673( cx, "TestJSImplInterface" , "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33671 | "TestJSImplInterface", "passOtherDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33673( cx, "TestJSImplInterface" , "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33672 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33673( cx, "TestJSImplInterface" , "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33673 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33673( cx, "TestJSImplInterface" , "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33674 | |||||
| 33675 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33676 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33677 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33678 | if (objIsXray) { | ||||
| 33679 | unwrappedObj.emplace(cx, obj); | ||||
| 33680 | } | ||||
| 33681 | binding_detail::FastGrandparentDict arg0; | ||||
| 33682 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 33683 | return false; | ||||
| 33684 | } | ||||
| 33685 | if (objIsXray) { | ||||
| 33686 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33687 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33688 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33689 | if (!unwrappedObj.ref()) { | ||||
| 33690 | return false; | ||||
| 33691 | } | ||||
| 33692 | } | ||||
| 33693 | FastErrorResult rv; | ||||
| 33694 | // NOTE: This assert does NOT call the function. | ||||
| 33695 | 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"); | ||||
| 33696 | MOZ_KnownLive(self)(self)->PassOtherDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33697 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary" )), 0))) { | ||||
| 33698 | return false; | ||||
| 33699 | } | ||||
| 33700 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33700); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33700; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33701 | args.rval().setUndefined(); | ||||
| 33702 | return true; | ||||
| 33703 | } | ||||
| 33704 | |||||
| 33705 | static const JSJitInfo passOtherDictionary_methodinfo = { | ||||
| 33706 | { (JSJitGetterOp)passOtherDictionary }, | ||||
| 33707 | { prototypes::id::TestJSImplInterface }, | ||||
| 33708 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33709 | JSJitInfo::Method, | ||||
| 33710 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33711 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33712 | false, /* isInfallible. False in setters. */ | ||||
| 33713 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33714 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33715 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33716 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33717 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33718 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33719 | }; | ||||
| 33720 | |||||
| 33721 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33722 | passSequenceOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33723 | { | ||||
| 33724 | BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfDictionaries"); | ||||
| 33725 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33728( cx, "TestJSImplInterface" , "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33726 | "TestJSImplInterface", "passSequenceOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33728( cx, "TestJSImplInterface" , "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33727 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33728( cx, "TestJSImplInterface" , "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33728 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33728( cx, "TestJSImplInterface" , "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 33729 | |||||
| 33730 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33731 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfDictionaries", 1)) { | ||||
| 33732 | return false; | ||||
| 33733 | } | ||||
| 33734 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33735 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33736 | if (objIsXray) { | ||||
| 33737 | unwrappedObj.emplace(cx, obj); | ||||
| 33738 | } | ||||
| 33739 | binding_detail::AutoSequence<Dict> arg0; | ||||
| 33740 | SequenceRooter<Dict> arg0_holder(cx, &arg0); | ||||
| 33741 | if (args[0].isObject()) { | ||||
| 33742 | JS::ForOfIterator iter(cx); | ||||
| 33743 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 33744 | return false; | ||||
| 33745 | } | ||||
| 33746 | if (!iter.valueIsIterable()) { | ||||
| 33747 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 33748 | return false; | ||||
| 33749 | } | ||||
| 33750 | binding_detail::AutoSequence<Dict> &arr = arg0; | ||||
| 33751 | JS::Rooted<JS::Value> temp(cx); | ||||
| 33752 | while (true) { | ||||
| 33753 | bool done; | ||||
| 33754 | if (!iter.next(&temp, &done)) { | ||||
| 33755 | return false; | ||||
| 33756 | } | ||||
| 33757 | if (done) { | ||||
| 33758 | break; | ||||
| 33759 | } | ||||
| 33760 | Dict* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 33761 | if (!slotPtr) { | ||||
| 33762 | JS_ReportOutOfMemory(cx); | ||||
| 33763 | return false; | ||||
| 33764 | } | ||||
| 33765 | Dict& slot = *slotPtr; | ||||
| 33766 | if (!slot.Init(cx, temp, "Element of argument 1", true)) { | ||||
| 33767 | return false; | ||||
| 33768 | } | ||||
| 33769 | } | ||||
| 33770 | } else { | ||||
| 33771 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | ||||
| 33772 | return false; | ||||
| 33773 | } | ||||
| 33774 | if (objIsXray) { | ||||
| 33775 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33776 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33777 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33778 | if (!unwrappedObj.ref()) { | ||||
| 33779 | return false; | ||||
| 33780 | } | ||||
| 33781 | } | ||||
| 33782 | FastErrorResult rv; | ||||
| 33783 | // NOTE: This assert does NOT call the function. | ||||
| 33784 | 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"); | ||||
| 33785 | MOZ_KnownLive(self)(self)->PassSequenceOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33786 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries" )), 0))) { | ||||
| 33787 | return false; | ||||
| 33788 | } | ||||
| 33789 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33789); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33789; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33790 | args.rval().setUndefined(); | ||||
| 33791 | return true; | ||||
| 33792 | } | ||||
| 33793 | |||||
| 33794 | static const JSJitInfo passSequenceOfDictionaries_methodinfo = { | ||||
| 33795 | { (JSJitGetterOp)passSequenceOfDictionaries }, | ||||
| 33796 | { prototypes::id::TestJSImplInterface }, | ||||
| 33797 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33798 | JSJitInfo::Method, | ||||
| 33799 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33800 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33801 | false, /* isInfallible. False in setters. */ | ||||
| 33802 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33803 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33804 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33805 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33806 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33807 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33808 | }; | ||||
| 33809 | |||||
| 33810 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33811 | passRecordOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33812 | { | ||||
| 33813 | BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfDictionaries"); | ||||
| 33814 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33817( cx, "TestJSImplInterface" , "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33815 | "TestJSImplInterface", "passRecordOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33817( cx, "TestJSImplInterface" , "passRecordOfDictionaries", 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::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33817( cx, "TestJSImplInterface" , "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 33817 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33817( cx, "TestJSImplInterface" , "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 33818 | |||||
| 33819 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33820 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfDictionaries", 1)) { | ||||
| 33821 | return false; | ||||
| 33822 | } | ||||
| 33823 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33824 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33825 | if (objIsXray) { | ||||
| 33826 | unwrappedObj.emplace(cx, obj); | ||||
| 33827 | } | ||||
| 33828 | Record<nsString, GrandparentDict> arg0; | ||||
| 33829 | if (args[0].isObject()) { | ||||
| 33830 | auto& recordEntries = arg0.Entries(); | ||||
| 33831 | |||||
| 33832 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 33833 | JS::RootedVector<jsid> ids(cx); | ||||
| 33834 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 33835 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 33836 | return false; | ||||
| 33837 | } | ||||
| 33838 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 33839 | JS_ReportOutOfMemory(cx); | ||||
| 33840 | return false; | ||||
| 33841 | } | ||||
| 33842 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 33843 | JS::Rooted<JS::Value> temp(cx); | ||||
| 33844 | JS::Rooted<jsid> curId(cx); | ||||
| 33845 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 33846 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 33847 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 33848 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 33849 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 33850 | // around. | ||||
| 33851 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 33852 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 33853 | curId = ids[i]; | ||||
| 33854 | |||||
| 33855 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 33856 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 33857 | &desc)) { | ||||
| 33858 | return false; | ||||
| 33859 | } | ||||
| 33860 | |||||
| 33861 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 33862 | continue; | ||||
| 33863 | } | ||||
| 33864 | |||||
| 33865 | idVal = js::IdToValue(curId); | ||||
| 33866 | nsString propName; | ||||
| 33867 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 33868 | // to do. | ||||
| 33869 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 33870 | return false; | ||||
| 33871 | } | ||||
| 33872 | |||||
| 33873 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 33874 | return false; | ||||
| 33875 | } | ||||
| 33876 | |||||
| 33877 | Record<nsString, GrandparentDict>::EntryType* entry; | ||||
| 33878 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 33879 | // Find the existing entry. | ||||
| 33880 | auto idx = recordEntries.IndexOf(propName); | ||||
| 33881 | 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", 33882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 33882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 33882 | "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", 33882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 33882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 33883 | // Now blow it away to make it look like it was just added | ||||
| 33884 | // to the array, because it's not obvious that it's | ||||
| 33885 | // safe to write to its already-initialized mValue via our | ||||
| 33886 | // normal codegen conversions. For example, the value | ||||
| 33887 | // could be a union and this would change its type, but | ||||
| 33888 | // codegen assumes we won't do that. | ||||
| 33889 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 33890 | } else { | ||||
| 33891 | // Safe to do an infallible append here, because we did a | ||||
| 33892 | // SetCapacity above to the right capacity. | ||||
| 33893 | entry = recordEntries.AppendElement(); | ||||
| 33894 | } | ||||
| 33895 | entry->mKey = propName; | ||||
| 33896 | GrandparentDict& slot = entry->mValue; | ||||
| 33897 | if (!slot.Init(cx, temp, "Value in argument 1", true)) { | ||||
| 33898 | return false; | ||||
| 33899 | } | ||||
| 33900 | } | ||||
| 33901 | } else { | ||||
| 33902 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 33903 | return false; | ||||
| 33904 | } | ||||
| 33905 | if (objIsXray) { | ||||
| 33906 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33907 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33908 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33909 | if (!unwrappedObj.ref()) { | ||||
| 33910 | return false; | ||||
| 33911 | } | ||||
| 33912 | } | ||||
| 33913 | FastErrorResult rv; | ||||
| 33914 | // NOTE: This assert does NOT call the function. | ||||
| 33915 | 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"); | ||||
| 33916 | MOZ_KnownLive(self)(self)->PassRecordOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33917 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries" )), 0))) { | ||||
| 33918 | return false; | ||||
| 33919 | } | ||||
| 33920 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33920); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33920; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33921 | args.rval().setUndefined(); | ||||
| 33922 | return true; | ||||
| 33923 | } | ||||
| 33924 | |||||
| 33925 | static const JSJitInfo passRecordOfDictionaries_methodinfo = { | ||||
| 33926 | { (JSJitGetterOp)passRecordOfDictionaries }, | ||||
| 33927 | { prototypes::id::TestJSImplInterface }, | ||||
| 33928 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 33929 | JSJitInfo::Method, | ||||
| 33930 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 33931 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 33932 | false, /* isInfallible. False in setters. */ | ||||
| 33933 | false, /* isMovable. Not relevant for setters. */ | ||||
| 33934 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 33935 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 33936 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 33937 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 33938 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 33939 | }; | ||||
| 33940 | |||||
| 33941 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 33942 | passDictionaryOrLong(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 33943 | { | ||||
| 33944 | BindingCallContext cx(cx_, "TestJSImplInterface.passDictionaryOrLong"); | ||||
| 33945 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33948( cx, "TestJSImplInterface" , "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33946 | "TestJSImplInterface", "passDictionaryOrLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33948( cx, "TestJSImplInterface" , "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33947 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33948( cx, "TestJSImplInterface" , "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 33948 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33948( cx, "TestJSImplInterface" , "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 33949 | |||||
| 33950 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 33951 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 33952 | switch (argcount) { | ||||
| 33953 | case 0: { | ||||
| 33954 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33955 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33956 | if (objIsXray) { | ||||
| 33957 | unwrappedObj.emplace(cx, obj); | ||||
| 33958 | } | ||||
| 33959 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 33960 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 33961 | return false; | ||||
| 33962 | } | ||||
| 33963 | if (objIsXray) { | ||||
| 33964 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33965 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33966 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33967 | if (!unwrappedObj.ref()) { | ||||
| 33968 | return false; | ||||
| 33969 | } | ||||
| 33970 | } | ||||
| 33971 | FastErrorResult rv; | ||||
| 33972 | // NOTE: This assert does NOT call the function. | ||||
| 33973 | 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"); | ||||
| 33974 | MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 33975 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong" )), 0))) { | ||||
| 33976 | return false; | ||||
| 33977 | } | ||||
| 33978 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 33978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 33978; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 33979 | args.rval().setUndefined(); | ||||
| 33980 | return true; | ||||
| 33981 | break; | ||||
| 33982 | } | ||||
| 33983 | case 1: { | ||||
| 33984 | if (args[0].isNullOrUndefined()) { | ||||
| 33985 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 33986 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 33987 | return false; | ||||
| 33988 | } | ||||
| 33989 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 33990 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 33991 | if (objIsXray) { | ||||
| 33992 | unwrappedObj.emplace(cx, obj); | ||||
| 33993 | } | ||||
| 33994 | if (objIsXray) { | ||||
| 33995 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 33996 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 33997 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 33998 | if (!unwrappedObj.ref()) { | ||||
| 33999 | return false; | ||||
| 34000 | } | ||||
| 34001 | } | ||||
| 34002 | FastErrorResult rv; | ||||
| 34003 | // NOTE: This assert does NOT call the function. | ||||
| 34004 | 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"); | ||||
| 34005 | MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34006 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong" )), 0))) { | ||||
| 34007 | return false; | ||||
| 34008 | } | ||||
| 34009 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34009); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34009; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34010 | args.rval().setUndefined(); | ||||
| 34011 | return true; | ||||
| 34012 | } | ||||
| 34013 | if (args[0].isObject()) { | ||||
| 34014 | do { | ||||
| 34015 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 34016 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 34017 | return false; | ||||
| 34018 | } | ||||
| 34019 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34020 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34021 | if (objIsXray) { | ||||
| 34022 | unwrappedObj.emplace(cx, obj); | ||||
| 34023 | } | ||||
| 34024 | if (objIsXray) { | ||||
| 34025 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34026 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34027 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34028 | if (!unwrappedObj.ref()) { | ||||
| 34029 | return false; | ||||
| 34030 | } | ||||
| 34031 | } | ||||
| 34032 | FastErrorResult rv; | ||||
| 34033 | // NOTE: This assert does NOT call the function. | ||||
| 34034 | 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"); | ||||
| 34035 | MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34036 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong" )), 0))) { | ||||
| 34037 | return false; | ||||
| 34038 | } | ||||
| 34039 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34039); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34039; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34040 | args.rval().setUndefined(); | ||||
| 34041 | return true; | ||||
| 34042 | } while (false); | ||||
| 34043 | } | ||||
| 34044 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34045 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34046 | if (objIsXray) { | ||||
| 34047 | unwrappedObj.emplace(cx, obj); | ||||
| 34048 | } | ||||
| 34049 | int32_t arg0; | ||||
| 34050 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 34051 | return false; | ||||
| 34052 | } | ||||
| 34053 | if (objIsXray) { | ||||
| 34054 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34055 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34056 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34057 | if (!unwrappedObj.ref()) { | ||||
| 34058 | return false; | ||||
| 34059 | } | ||||
| 34060 | } | ||||
| 34061 | FastErrorResult rv; | ||||
| 34062 | // NOTE: This assert does NOT call the function. | ||||
| 34063 | 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"); | ||||
| 34064 | MOZ_KnownLive(self)(self)->PassDictionaryOrLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34065 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong" )), 0))) { | ||||
| 34066 | return false; | ||||
| 34067 | } | ||||
| 34068 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34068); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34068; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34069 | args.rval().setUndefined(); | ||||
| 34070 | return true; | ||||
| 34071 | break; | ||||
| 34072 | } | ||||
| 34073 | default: { | ||||
| 34074 | // Using nsPrintfCString here would require including that | ||||
| 34075 | // header. Let's not worry about it. | ||||
| 34076 | nsAutoCString argCountStr; | ||||
| 34077 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 34078 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 34079 | } | ||||
| 34080 | } | ||||
| 34081 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 34081); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 34081; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 34082 | return false; | ||||
| 34083 | } | ||||
| 34084 | |||||
| 34085 | static const JSJitInfo passDictionaryOrLong_methodinfo = { | ||||
| 34086 | { (JSJitGetterOp)passDictionaryOrLong }, | ||||
| 34087 | { prototypes::id::TestJSImplInterface }, | ||||
| 34088 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34089 | JSJitInfo::Method, | ||||
| 34090 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34091 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34092 | false, /* isInfallible. False in setters. */ | ||||
| 34093 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34094 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34095 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34096 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34097 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34098 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34099 | }; | ||||
| 34100 | |||||
| 34101 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34102 | passDictContainingDict(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34103 | { | ||||
| 34104 | BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingDict"); | ||||
| 34105 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34108( cx, "TestJSImplInterface" , "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34106 | "TestJSImplInterface", "passDictContainingDict", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34108( cx, "TestJSImplInterface" , "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34107 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34108( cx, "TestJSImplInterface" , "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34108 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34108( cx, "TestJSImplInterface" , "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34109 | |||||
| 34110 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34111 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34112 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34113 | if (objIsXray) { | ||||
| 34114 | unwrappedObj.emplace(cx, obj); | ||||
| 34115 | } | ||||
| 34116 | RootedDictionary<binding_detail::FastDictContainingDict> arg0(cx); | ||||
| 34117 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 34118 | return false; | ||||
| 34119 | } | ||||
| 34120 | if (objIsXray) { | ||||
| 34121 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34122 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34123 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34124 | if (!unwrappedObj.ref()) { | ||||
| 34125 | return false; | ||||
| 34126 | } | ||||
| 34127 | } | ||||
| 34128 | FastErrorResult rv; | ||||
| 34129 | // NOTE: This assert does NOT call the function. | ||||
| 34130 | 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"); | ||||
| 34131 | MOZ_KnownLive(self)(self)->PassDictContainingDict(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34132 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict" )), 0))) { | ||||
| 34133 | return false; | ||||
| 34134 | } | ||||
| 34135 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34135); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34135; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34136 | args.rval().setUndefined(); | ||||
| 34137 | return true; | ||||
| 34138 | } | ||||
| 34139 | |||||
| 34140 | static const JSJitInfo passDictContainingDict_methodinfo = { | ||||
| 34141 | { (JSJitGetterOp)passDictContainingDict }, | ||||
| 34142 | { prototypes::id::TestJSImplInterface }, | ||||
| 34143 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34144 | JSJitInfo::Method, | ||||
| 34145 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34146 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34147 | false, /* isInfallible. False in setters. */ | ||||
| 34148 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34149 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34150 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34151 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34152 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34153 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34154 | }; | ||||
| 34155 | |||||
| 34156 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34157 | passDictContainingSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34158 | { | ||||
| 34159 | BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingSequence"); | ||||
| 34160 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34163( cx, "TestJSImplInterface" , "passDictContainingSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34161 | "TestJSImplInterface", "passDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34163( cx, "TestJSImplInterface" , "passDictContainingSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34162 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34163( cx, "TestJSImplInterface" , "passDictContainingSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34163 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34163( cx, "TestJSImplInterface" , "passDictContainingSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 34164 | |||||
| 34165 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34166 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34167 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34168 | if (objIsXray) { | ||||
| 34169 | unwrappedObj.emplace(cx, obj); | ||||
| 34170 | } | ||||
| 34171 | RootedDictionary<binding_detail::FastDictContainingSequence> arg0(cx); | ||||
| 34172 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 34173 | return false; | ||||
| 34174 | } | ||||
| 34175 | if (objIsXray) { | ||||
| 34176 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34177 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34178 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34179 | if (!unwrappedObj.ref()) { | ||||
| 34180 | return false; | ||||
| 34181 | } | ||||
| 34182 | } | ||||
| 34183 | FastErrorResult rv; | ||||
| 34184 | // NOTE: This assert does NOT call the function. | ||||
| 34185 | 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"); | ||||
| 34186 | MOZ_KnownLive(self)(self)->PassDictContainingSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34187 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence" )), 0))) { | ||||
| 34188 | return false; | ||||
| 34189 | } | ||||
| 34190 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34190); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34190; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34191 | args.rval().setUndefined(); | ||||
| 34192 | return true; | ||||
| 34193 | } | ||||
| 34194 | |||||
| 34195 | static const JSJitInfo passDictContainingSequence_methodinfo = { | ||||
| 34196 | { (JSJitGetterOp)passDictContainingSequence }, | ||||
| 34197 | { prototypes::id::TestJSImplInterface }, | ||||
| 34198 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34199 | JSJitInfo::Method, | ||||
| 34200 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34201 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34202 | false, /* isInfallible. False in setters. */ | ||||
| 34203 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34204 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34205 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34206 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34207 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34208 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34209 | }; | ||||
| 34210 | |||||
| 34211 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34212 | receiveDictContainingSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34213 | { | ||||
| 34214 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34217( cx, "TestJSImplInterface" , "receiveDictContainingSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34215 | "TestJSImplInterface", "receiveDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34217( cx, "TestJSImplInterface" , "receiveDictContainingSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34216 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34217( cx, "TestJSImplInterface" , "receiveDictContainingSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 34217 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34217( cx, "TestJSImplInterface" , "receiveDictContainingSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 34218 | |||||
| 34219 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34220 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34221 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34222 | if (objIsXray) { | ||||
| 34223 | unwrappedObj.emplace(cx, obj); | ||||
| 34224 | } | ||||
| 34225 | if (objIsXray) { | ||||
| 34226 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34227 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34228 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34229 | if (!unwrappedObj.ref()) { | ||||
| 34230 | return false; | ||||
| 34231 | } | ||||
| 34232 | } | ||||
| 34233 | FastErrorResult rv; | ||||
| 34234 | RootedDictionary<DictContainingSequence> result(cx); | ||||
| 34235 | // NOTE: This assert does NOT call the function. | ||||
| 34236 | 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"); | ||||
| 34237 | MOZ_KnownLive(self)(self)->ReceiveDictContainingSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34238 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence" )), 0))) { | ||||
| 34239 | return false; | ||||
| 34240 | } | ||||
| 34241 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34241); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34241; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34242 | if (!result.ToObjectInternal(cx, args.rval())) { | ||||
| 34243 | return false; | ||||
| 34244 | } | ||||
| 34245 | return true; | ||||
| 34246 | } | ||||
| 34247 | |||||
| 34248 | static const JSJitInfo receiveDictContainingSequence_methodinfo = { | ||||
| 34249 | { (JSJitGetterOp)receiveDictContainingSequence }, | ||||
| 34250 | { prototypes::id::TestJSImplInterface }, | ||||
| 34251 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34252 | JSJitInfo::Method, | ||||
| 34253 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34254 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 34255 | false, /* isInfallible. False in setters. */ | ||||
| 34256 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34257 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34258 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34259 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34260 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34261 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34262 | }; | ||||
| 34263 | |||||
| 34264 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34265 | passVariadicDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34266 | { | ||||
| 34267 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicDictionary"); | ||||
| 34268 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34271( cx, "TestJSImplInterface" , "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34269 | "TestJSImplInterface", "passVariadicDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34271( cx, "TestJSImplInterface" , "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34270 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34271( cx, "TestJSImplInterface" , "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34271 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34271( cx, "TestJSImplInterface" , "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34272 | |||||
| 34273 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34274 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34275 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34276 | if (objIsXray) { | ||||
| 34277 | unwrappedObj.emplace(cx, obj); | ||||
| 34278 | } | ||||
| 34279 | AutoSequence<Dict> arg0; | ||||
| 34280 | SequenceRooter<Dict> arg0_holder(cx, &arg0); | ||||
| 34281 | if (args.length() > 0) { | ||||
| 34282 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | ||||
| 34283 | JS_ReportOutOfMemory(cx); | ||||
| 34284 | return false; | ||||
| 34285 | } | ||||
| 34286 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | ||||
| 34287 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 34288 | Dict& slot = *arg0.AppendElement(); | ||||
| 34289 | if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) { | ||||
| 34290 | return false; | ||||
| 34291 | } | ||||
| 34292 | } | ||||
| 34293 | } | ||||
| 34294 | if (objIsXray) { | ||||
| 34295 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34296 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34297 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34298 | if (!unwrappedObj.ref()) { | ||||
| 34299 | return false; | ||||
| 34300 | } | ||||
| 34301 | } | ||||
| 34302 | FastErrorResult rv; | ||||
| 34303 | // NOTE: This assert does NOT call the function. | ||||
| 34304 | 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"); | ||||
| 34305 | MOZ_KnownLive(self)(self)->PassVariadicDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34306 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary" )), 0))) { | ||||
| 34307 | return false; | ||||
| 34308 | } | ||||
| 34309 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34309); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34309; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34310 | args.rval().setUndefined(); | ||||
| 34311 | return true; | ||||
| 34312 | } | ||||
| 34313 | |||||
| 34314 | static const JSJitInfo passVariadicDictionary_methodinfo = { | ||||
| 34315 | { (JSJitGetterOp)passVariadicDictionary }, | ||||
| 34316 | { prototypes::id::TestJSImplInterface }, | ||||
| 34317 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34318 | JSJitInfo::Method, | ||||
| 34319 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34320 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34321 | false, /* isInfallible. False in setters. */ | ||||
| 34322 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34323 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34324 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34325 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34326 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34327 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34328 | }; | ||||
| 34329 | |||||
| 34330 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34331 | dontEnforceRangeOrClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34332 | { | ||||
| 34333 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34336( cx, "TestJSImplInterface" , "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34334 | "TestJSImplInterface", "dontEnforceRangeOrClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34336( cx, "TestJSImplInterface" , "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34335 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34336( cx, "TestJSImplInterface" , "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34336 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34336( cx, "TestJSImplInterface" , "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34337 | |||||
| 34338 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34339 | if (!args.requireAtLeast(cx, "TestJSImplInterface.dontEnforceRangeOrClamp", 1)) { | ||||
| 34340 | return false; | ||||
| 34341 | } | ||||
| 34342 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34343 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34344 | if (objIsXray) { | ||||
| 34345 | unwrappedObj.emplace(cx, obj); | ||||
| 34346 | } | ||||
| 34347 | int8_t arg0; | ||||
| 34348 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 34349 | return false; | ||||
| 34350 | } | ||||
| 34351 | if (objIsXray) { | ||||
| 34352 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34353 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34354 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34355 | if (!unwrappedObj.ref()) { | ||||
| 34356 | return false; | ||||
| 34357 | } | ||||
| 34358 | } | ||||
| 34359 | FastErrorResult rv; | ||||
| 34360 | // NOTE: This assert does NOT call the function. | ||||
| 34361 | 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"); | ||||
| 34362 | MOZ_KnownLive(self)(self)->DontEnforceRangeOrClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34363 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp" )), 0))) { | ||||
| 34364 | return false; | ||||
| 34365 | } | ||||
| 34366 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34366); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34366; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34367 | args.rval().setUndefined(); | ||||
| 34368 | return true; | ||||
| 34369 | } | ||||
| 34370 | |||||
| 34371 | static const JSJitInfo dontEnforceRangeOrClamp_methodinfo = { | ||||
| 34372 | { (JSJitGetterOp)dontEnforceRangeOrClamp }, | ||||
| 34373 | { prototypes::id::TestJSImplInterface }, | ||||
| 34374 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34375 | JSJitInfo::Method, | ||||
| 34376 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34377 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34378 | false, /* isInfallible. False in setters. */ | ||||
| 34379 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34380 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34381 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34382 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34383 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34384 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34385 | }; | ||||
| 34386 | |||||
| 34387 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34388 | doEnforceRange(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34389 | { | ||||
| 34390 | BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRange"); | ||||
| 34391 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34394( cx, "TestJSImplInterface" , "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34392 | "TestJSImplInterface", "doEnforceRange", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34394( cx, "TestJSImplInterface" , "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34393 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34394( cx, "TestJSImplInterface" , "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34394 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34394( cx, "TestJSImplInterface" , "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34395 | |||||
| 34396 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34397 | if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRange", 1)) { | ||||
| 34398 | return false; | ||||
| 34399 | } | ||||
| 34400 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34401 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34402 | if (objIsXray) { | ||||
| 34403 | unwrappedObj.emplace(cx, obj); | ||||
| 34404 | } | ||||
| 34405 | int8_t arg0; | ||||
| 34406 | if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 34407 | return false; | ||||
| 34408 | } | ||||
| 34409 | if (objIsXray) { | ||||
| 34410 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34411 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34412 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34413 | if (!unwrappedObj.ref()) { | ||||
| 34414 | return false; | ||||
| 34415 | } | ||||
| 34416 | } | ||||
| 34417 | FastErrorResult rv; | ||||
| 34418 | // NOTE: This assert does NOT call the function. | ||||
| 34419 | 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"); | ||||
| 34420 | MOZ_KnownLive(self)(self)->DoEnforceRange(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34421 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange" )), 0))) { | ||||
| 34422 | return false; | ||||
| 34423 | } | ||||
| 34424 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34424); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34424; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34425 | args.rval().setUndefined(); | ||||
| 34426 | return true; | ||||
| 34427 | } | ||||
| 34428 | |||||
| 34429 | static const JSJitInfo doEnforceRange_methodinfo = { | ||||
| 34430 | { (JSJitGetterOp)doEnforceRange }, | ||||
| 34431 | { prototypes::id::TestJSImplInterface }, | ||||
| 34432 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34433 | JSJitInfo::Method, | ||||
| 34434 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34435 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34436 | false, /* isInfallible. False in setters. */ | ||||
| 34437 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34438 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34439 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34440 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34441 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34442 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34443 | }; | ||||
| 34444 | |||||
| 34445 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34446 | doEnforceRangeNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34447 | { | ||||
| 34448 | BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRangeNullable"); | ||||
| 34449 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34452( cx, "TestJSImplInterface" , "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34450 | "TestJSImplInterface", "doEnforceRangeNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34452( cx, "TestJSImplInterface" , "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34451 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34452( cx, "TestJSImplInterface" , "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34452 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34452( cx, "TestJSImplInterface" , "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34453 | |||||
| 34454 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34455 | if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRangeNullable", 1)) { | ||||
| 34456 | return false; | ||||
| 34457 | } | ||||
| 34458 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34459 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34460 | if (objIsXray) { | ||||
| 34461 | unwrappedObj.emplace(cx, obj); | ||||
| 34462 | } | ||||
| 34463 | Nullable<int8_t> arg0; | ||||
| 34464 | if (args[0].isNullOrUndefined()) { | ||||
| 34465 | arg0.SetNull(); | ||||
| 34466 | } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 34467 | return false; | ||||
| 34468 | } | ||||
| 34469 | if (objIsXray) { | ||||
| 34470 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34471 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34472 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34473 | if (!unwrappedObj.ref()) { | ||||
| 34474 | return false; | ||||
| 34475 | } | ||||
| 34476 | } | ||||
| 34477 | FastErrorResult rv; | ||||
| 34478 | // NOTE: This assert does NOT call the function. | ||||
| 34479 | 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"); | ||||
| 34480 | MOZ_KnownLive(self)(self)->DoEnforceRangeNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34481 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable" )), 0))) { | ||||
| 34482 | return false; | ||||
| 34483 | } | ||||
| 34484 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34484); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34484; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34485 | args.rval().setUndefined(); | ||||
| 34486 | return true; | ||||
| 34487 | } | ||||
| 34488 | |||||
| 34489 | static const JSJitInfo doEnforceRangeNullable_methodinfo = { | ||||
| 34490 | { (JSJitGetterOp)doEnforceRangeNullable }, | ||||
| 34491 | { prototypes::id::TestJSImplInterface }, | ||||
| 34492 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34493 | JSJitInfo::Method, | ||||
| 34494 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34495 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34496 | false, /* isInfallible. False in setters. */ | ||||
| 34497 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34498 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34499 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34500 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34501 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34502 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34503 | }; | ||||
| 34504 | |||||
| 34505 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34506 | doClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34507 | { | ||||
| 34508 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34511( cx, "TestJSImplInterface" , "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 34509 | "TestJSImplInterface", "doClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34511( cx, "TestJSImplInterface" , "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 34510 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34511( cx, "TestJSImplInterface" , "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 34511 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34511( cx, "TestJSImplInterface" , "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 34512 | |||||
| 34513 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34514 | if (!args.requireAtLeast(cx, "TestJSImplInterface.doClamp", 1)) { | ||||
| 34515 | return false; | ||||
| 34516 | } | ||||
| 34517 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34518 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34519 | if (objIsXray) { | ||||
| 34520 | unwrappedObj.emplace(cx, obj); | ||||
| 34521 | } | ||||
| 34522 | int8_t arg0; | ||||
| 34523 | if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 34524 | return false; | ||||
| 34525 | } | ||||
| 34526 | if (objIsXray) { | ||||
| 34527 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34528 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34529 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34530 | if (!unwrappedObj.ref()) { | ||||
| 34531 | return false; | ||||
| 34532 | } | ||||
| 34533 | } | ||||
| 34534 | FastErrorResult rv; | ||||
| 34535 | // NOTE: This assert does NOT call the function. | ||||
| 34536 | 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"); | ||||
| 34537 | MOZ_KnownLive(self)(self)->DoClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34538 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp" )), 0))) { | ||||
| 34539 | return false; | ||||
| 34540 | } | ||||
| 34541 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34541); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34541; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34542 | args.rval().setUndefined(); | ||||
| 34543 | return true; | ||||
| 34544 | } | ||||
| 34545 | |||||
| 34546 | static const JSJitInfo doClamp_methodinfo = { | ||||
| 34547 | { (JSJitGetterOp)doClamp }, | ||||
| 34548 | { prototypes::id::TestJSImplInterface }, | ||||
| 34549 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34550 | JSJitInfo::Method, | ||||
| 34551 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34552 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34553 | false, /* isInfallible. False in setters. */ | ||||
| 34554 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34555 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34556 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34557 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34558 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34559 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34560 | }; | ||||
| 34561 | |||||
| 34562 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34563 | doClampNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 34564 | { | ||||
| 34565 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34568( cx, "TestJSImplInterface" , "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34566 | "TestJSImplInterface", "doClampNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34568( cx, "TestJSImplInterface" , "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34567 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34568( cx, "TestJSImplInterface" , "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34568 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34568( cx, "TestJSImplInterface" , "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34569 | |||||
| 34570 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34571 | if (!args.requireAtLeast(cx, "TestJSImplInterface.doClampNullable", 1)) { | ||||
| 34572 | return false; | ||||
| 34573 | } | ||||
| 34574 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34575 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34576 | if (objIsXray) { | ||||
| 34577 | unwrappedObj.emplace(cx, obj); | ||||
| 34578 | } | ||||
| 34579 | Nullable<int8_t> arg0; | ||||
| 34580 | if (args[0].isNullOrUndefined()) { | ||||
| 34581 | arg0.SetNull(); | ||||
| 34582 | } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 34583 | return false; | ||||
| 34584 | } | ||||
| 34585 | if (objIsXray) { | ||||
| 34586 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34587 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34588 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34589 | if (!unwrappedObj.ref()) { | ||||
| 34590 | return false; | ||||
| 34591 | } | ||||
| 34592 | } | ||||
| 34593 | FastErrorResult rv; | ||||
| 34594 | // NOTE: This assert does NOT call the function. | ||||
| 34595 | 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"); | ||||
| 34596 | MOZ_KnownLive(self)(self)->DoClampNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34597 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable" )), 0))) { | ||||
| 34598 | return false; | ||||
| 34599 | } | ||||
| 34600 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34600); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34600; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34601 | args.rval().setUndefined(); | ||||
| 34602 | return true; | ||||
| 34603 | } | ||||
| 34604 | |||||
| 34605 | static const JSJitInfo doClampNullable_methodinfo = { | ||||
| 34606 | { (JSJitGetterOp)doClampNullable }, | ||||
| 34607 | { prototypes::id::TestJSImplInterface }, | ||||
| 34608 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34609 | JSJitInfo::Method, | ||||
| 34610 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34611 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34612 | false, /* isInfallible. False in setters. */ | ||||
| 34613 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34614 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34615 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34616 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34617 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34618 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34619 | }; | ||||
| 34620 | |||||
| 34621 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34622 | get_enforcedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 34623 | { | ||||
| 34624 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34627( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34625 | "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34627( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34626 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34627( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34627 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34627( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34628 | |||||
| 34629 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34630 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34631 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34632 | if (objIsXray) { | ||||
| 34633 | unwrappedObj.emplace(cx, obj); | ||||
| 34634 | } | ||||
| 34635 | if (objIsXray) { | ||||
| 34636 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34637 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34638 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34639 | if (!unwrappedObj.ref()) { | ||||
| 34640 | return false; | ||||
| 34641 | } | ||||
| 34642 | } | ||||
| 34643 | FastErrorResult rv; | ||||
| 34644 | int8_t result(MOZ_KnownLive(self)(self)->GetEnforcedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 34645 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter" )), 0))) { | ||||
| 34646 | return false; | ||||
| 34647 | } | ||||
| 34648 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34648); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34648; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34649 | args.rval().setInt32(int32_t(result)); | ||||
| 34650 | return true; | ||||
| 34651 | } | ||||
| 34652 | |||||
| 34653 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34654 | set_enforcedByte(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 34655 | { | ||||
| 34656 | BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByte setter"); | ||||
| 34657 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34660( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34658 | "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34660( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34659 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34660( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34660 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34660( cx, "TestJSImplInterface" , "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34661 | |||||
| 34662 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34663 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34664 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34665 | if (objIsXray) { | ||||
| 34666 | unwrappedObj.emplace(cx, obj); | ||||
| 34667 | } | ||||
| 34668 | int8_t arg0; | ||||
| 34669 | if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 34670 | return false; | ||||
| 34671 | } | ||||
| 34672 | if (objIsXray) { | ||||
| 34673 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34674 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34675 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34676 | if (!unwrappedObj.ref()) { | ||||
| 34677 | return false; | ||||
| 34678 | } | ||||
| 34679 | } | ||||
| 34680 | FastErrorResult rv; | ||||
| 34681 | // NOTE: This assert does NOT call the function. | ||||
| 34682 | 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"); | ||||
| 34683 | MOZ_KnownLive(self)(self)->SetEnforcedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34684 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter" )), 0))) { | ||||
| 34685 | return false; | ||||
| 34686 | } | ||||
| 34687 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34687); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34687; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34688 | |||||
| 34689 | return true; | ||||
| 34690 | } | ||||
| 34691 | |||||
| 34692 | static const JSJitInfo enforcedByte_getterinfo = { | ||||
| 34693 | { get_enforcedByte }, | ||||
| 34694 | { prototypes::id::TestJSImplInterface }, | ||||
| 34695 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34696 | JSJitInfo::Getter, | ||||
| 34697 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34698 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 34699 | false, /* isInfallible. False in setters. */ | ||||
| 34700 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34701 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34702 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34703 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34704 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34705 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34706 | }; | ||||
| 34707 | static const JSJitInfo enforcedByte_setterinfo = { | ||||
| 34708 | { (JSJitGetterOp)set_enforcedByte }, | ||||
| 34709 | { prototypes::id::TestJSImplInterface }, | ||||
| 34710 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34711 | JSJitInfo::Setter, | ||||
| 34712 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34713 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34714 | false, /* isInfallible. False in setters. */ | ||||
| 34715 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34716 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34717 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34718 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34719 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34720 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34721 | }; | ||||
| 34722 | |||||
| 34723 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34724 | get_enforcedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 34725 | { | ||||
| 34726 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34729( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34727 | "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34729( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34728 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34729( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34729 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34729( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34730 | |||||
| 34731 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34732 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34733 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34734 | if (objIsXray
| ||||
| |||||
| 34735 | unwrappedObj.emplace(cx, obj); | ||||
| 34736 | } | ||||
| 34737 | if (objIsXray
| ||||
| 34738 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34739 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34740 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34741 | if (!unwrappedObj.ref()) { | ||||
| 34742 | return false; | ||||
| 34743 | } | ||||
| 34744 | } | ||||
| 34745 | FastErrorResult rv; | ||||
| 34746 | Nullable<int8_t> result(MOZ_KnownLive(self)(self)->GetEnforcedByteNullable(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 34747 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter" )), 0))) { | ||||
| 34748 | return false; | ||||
| 34749 | } | ||||
| 34750 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34750); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34750; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34751 | if (result.IsNull()) { | ||||
| 34752 | args.rval().setNull(); | ||||
| 34753 | return true; | ||||
| 34754 | } | ||||
| 34755 | args.rval().setInt32(int32_t(result.Value())); | ||||
| 34756 | return true; | ||||
| 34757 | } | ||||
| 34758 | |||||
| 34759 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34760 | set_enforcedByteNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 34761 | { | ||||
| 34762 | BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByteNullable setter"); | ||||
| 34763 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34766( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34764 | "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34766( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34765 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34766( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34766 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34766( cx, "TestJSImplInterface" , "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34767 | |||||
| 34768 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34769 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34770 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34771 | if (objIsXray) { | ||||
| 34772 | unwrappedObj.emplace(cx, obj); | ||||
| 34773 | } | ||||
| 34774 | Nullable<int8_t> arg0; | ||||
| 34775 | if (args[0].isNullOrUndefined()) { | ||||
| 34776 | arg0.SetNull(); | ||||
| 34777 | } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | ||||
| 34778 | return false; | ||||
| 34779 | } | ||||
| 34780 | if (objIsXray) { | ||||
| 34781 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34782 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34783 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34784 | if (!unwrappedObj.ref()) { | ||||
| 34785 | return false; | ||||
| 34786 | } | ||||
| 34787 | } | ||||
| 34788 | FastErrorResult rv; | ||||
| 34789 | // NOTE: This assert does NOT call the function. | ||||
| 34790 | 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"); | ||||
| 34791 | MOZ_KnownLive(self)(self)->SetEnforcedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34792 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter" )), 0))) { | ||||
| 34793 | return false; | ||||
| 34794 | } | ||||
| 34795 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34795); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34795; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34796 | |||||
| 34797 | return true; | ||||
| 34798 | } | ||||
| 34799 | |||||
| 34800 | static const JSJitInfo enforcedByteNullable_getterinfo = { | ||||
| 34801 | { get_enforcedByteNullable }, | ||||
| 34802 | { prototypes::id::TestJSImplInterface }, | ||||
| 34803 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34804 | JSJitInfo::Getter, | ||||
| 34805 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34806 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 34807 | false, /* isInfallible. False in setters. */ | ||||
| 34808 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34809 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34810 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34811 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34812 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34813 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34814 | }; | ||||
| 34815 | static const JSJitInfo enforcedByteNullable_setterinfo = { | ||||
| 34816 | { (JSJitGetterOp)set_enforcedByteNullable }, | ||||
| 34817 | { prototypes::id::TestJSImplInterface }, | ||||
| 34818 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34819 | JSJitInfo::Setter, | ||||
| 34820 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34821 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34822 | false, /* isInfallible. False in setters. */ | ||||
| 34823 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34824 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34825 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34826 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34827 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34828 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34829 | }; | ||||
| 34830 | |||||
| 34831 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34832 | get_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 34833 | { | ||||
| 34834 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34837( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34835 | "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34837( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34836 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34837( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34837 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34837( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34838 | |||||
| 34839 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34840 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34841 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34842 | if (objIsXray) { | ||||
| 34843 | unwrappedObj.emplace(cx, obj); | ||||
| 34844 | } | ||||
| 34845 | if (objIsXray) { | ||||
| 34846 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34847 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34848 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34849 | if (!unwrappedObj.ref()) { | ||||
| 34850 | return false; | ||||
| 34851 | } | ||||
| 34852 | } | ||||
| 34853 | FastErrorResult rv; | ||||
| 34854 | int8_t result(MOZ_KnownLive(self)(self)->GetClampedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 34855 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter" )), 0))) { | ||||
| 34856 | return false; | ||||
| 34857 | } | ||||
| 34858 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34858); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34858; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34859 | args.rval().setInt32(int32_t(result)); | ||||
| 34860 | return true; | ||||
| 34861 | } | ||||
| 34862 | |||||
| 34863 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34864 | set_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 34865 | { | ||||
| 34866 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34869( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34867 | "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34869( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34868 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34869( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34869 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34869( cx, "TestJSImplInterface" , "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34870 | |||||
| 34871 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34872 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34873 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34874 | if (objIsXray) { | ||||
| 34875 | unwrappedObj.emplace(cx, obj); | ||||
| 34876 | } | ||||
| 34877 | int8_t arg0; | ||||
| 34878 | if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 34879 | return false; | ||||
| 34880 | } | ||||
| 34881 | if (objIsXray) { | ||||
| 34882 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34883 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34884 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34885 | if (!unwrappedObj.ref()) { | ||||
| 34886 | return false; | ||||
| 34887 | } | ||||
| 34888 | } | ||||
| 34889 | FastErrorResult rv; | ||||
| 34890 | // NOTE: This assert does NOT call the function. | ||||
| 34891 | 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"); | ||||
| 34892 | MOZ_KnownLive(self)(self)->SetClampedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 34893 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter" )), 0))) { | ||||
| 34894 | return false; | ||||
| 34895 | } | ||||
| 34896 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34896); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34896; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34897 | |||||
| 34898 | return true; | ||||
| 34899 | } | ||||
| 34900 | |||||
| 34901 | static const JSJitInfo clampedByte_getterinfo = { | ||||
| 34902 | { get_clampedByte }, | ||||
| 34903 | { prototypes::id::TestJSImplInterface }, | ||||
| 34904 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34905 | JSJitInfo::Getter, | ||||
| 34906 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34907 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 34908 | false, /* isInfallible. False in setters. */ | ||||
| 34909 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34910 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34911 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34912 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34913 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34914 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34915 | }; | ||||
| 34916 | static const JSJitInfo clampedByte_setterinfo = { | ||||
| 34917 | { (JSJitGetterOp)set_clampedByte }, | ||||
| 34918 | { prototypes::id::TestJSImplInterface }, | ||||
| 34919 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 34920 | JSJitInfo::Setter, | ||||
| 34921 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 34922 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 34923 | false, /* isInfallible. False in setters. */ | ||||
| 34924 | false, /* isMovable. Not relevant for setters. */ | ||||
| 34925 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 34926 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 34927 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 34928 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 34929 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 34930 | }; | ||||
| 34931 | |||||
| 34932 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34933 | get_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 34934 | { | ||||
| 34935 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34938( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34936 | "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34938( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34937 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34938( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34938 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34938( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34939 | |||||
| 34940 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34941 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34942 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34943 | if (objIsXray) { | ||||
| 34944 | unwrappedObj.emplace(cx, obj); | ||||
| 34945 | } | ||||
| 34946 | if (objIsXray) { | ||||
| 34947 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34948 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34949 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34950 | if (!unwrappedObj.ref()) { | ||||
| 34951 | return false; | ||||
| 34952 | } | ||||
| 34953 | } | ||||
| 34954 | FastErrorResult rv; | ||||
| 34955 | Nullable<int8_t> result(MOZ_KnownLive(self)(self)->GetClampedByteNullable(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 34956 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter" )), 0))) { | ||||
| 34957 | return false; | ||||
| 34958 | } | ||||
| 34959 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 34959); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 34959; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 34960 | if (result.IsNull()) { | ||||
| 34961 | args.rval().setNull(); | ||||
| 34962 | return true; | ||||
| 34963 | } | ||||
| 34964 | args.rval().setInt32(int32_t(result.Value())); | ||||
| 34965 | return true; | ||||
| 34966 | } | ||||
| 34967 | |||||
| 34968 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 34969 | set_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 34970 | { | ||||
| 34971 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34974( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34972 | "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34974( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34973 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34974( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 34974 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34974( cx, "TestJSImplInterface" , "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 34975 | |||||
| 34976 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 34977 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 34978 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 34979 | if (objIsXray) { | ||||
| 34980 | unwrappedObj.emplace(cx, obj); | ||||
| 34981 | } | ||||
| 34982 | Nullable<int8_t> arg0; | ||||
| 34983 | if (args[0].isNullOrUndefined()) { | ||||
| 34984 | arg0.SetNull(); | ||||
| 34985 | } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | ||||
| 34986 | return false; | ||||
| 34987 | } | ||||
| 34988 | if (objIsXray) { | ||||
| 34989 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 34990 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 34991 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 34992 | if (!unwrappedObj.ref()) { | ||||
| 34993 | return false; | ||||
| 34994 | } | ||||
| 34995 | } | ||||
| 34996 | FastErrorResult rv; | ||||
| 34997 | // NOTE: This assert does NOT call the function. | ||||
| 34998 | 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"); | ||||
| 34999 | MOZ_KnownLive(self)(self)->SetClampedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35000 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter" )), 0))) { | ||||
| 35001 | return false; | ||||
| 35002 | } | ||||
| 35003 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35003); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35003; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35004 | |||||
| 35005 | return true; | ||||
| 35006 | } | ||||
| 35007 | |||||
| 35008 | static const JSJitInfo clampedByteNullable_getterinfo = { | ||||
| 35009 | { get_clampedByteNullable }, | ||||
| 35010 | { prototypes::id::TestJSImplInterface }, | ||||
| 35011 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35012 | JSJitInfo::Getter, | ||||
| 35013 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35014 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 35015 | false, /* isInfallible. False in setters. */ | ||||
| 35016 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35017 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35018 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35019 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35020 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35021 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35022 | }; | ||||
| 35023 | static const JSJitInfo clampedByteNullable_setterinfo = { | ||||
| 35024 | { (JSJitGetterOp)set_clampedByteNullable }, | ||||
| 35025 | { prototypes::id::TestJSImplInterface }, | ||||
| 35026 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35027 | JSJitInfo::Setter, | ||||
| 35028 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35029 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35030 | false, /* isInfallible. False in setters. */ | ||||
| 35031 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35032 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35033 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35034 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35035 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35036 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35037 | }; | ||||
| 35038 | |||||
| 35039 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35040 | exerciseTypedefInterfaces1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35041 | { | ||||
| 35042 | BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces1"); | ||||
| 35043 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35046( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35044 | "TestJSImplInterface", "exerciseTypedefInterfaces1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35046( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35045 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35046( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35046 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35046( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 35047 | |||||
| 35048 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35049 | if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces1", 1)) { | ||||
| 35050 | return false; | ||||
| 35051 | } | ||||
| 35052 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35053 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35054 | if (objIsXray) { | ||||
| 35055 | unwrappedObj.emplace(cx, obj); | ||||
| 35056 | } | ||||
| 35057 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35058 | if (args[0].isObject()) { | ||||
| 35059 | { | ||||
| 35060 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35061 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35062 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35063 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface"); | ||||
| 35064 | return false; | ||||
| 35065 | } | ||||
| 35066 | } | ||||
| 35067 | } else { | ||||
| 35068 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 35069 | return false; | ||||
| 35070 | } | ||||
| 35071 | if (objIsXray) { | ||||
| 35072 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35073 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35074 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35075 | if (!unwrappedObj.ref()) { | ||||
| 35076 | return false; | ||||
| 35077 | } | ||||
| 35078 | } | ||||
| 35079 | FastErrorResult rv; | ||||
| 35080 | // NOTE: This assert does NOT call the function. | ||||
| 35081 | 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"); | ||||
| 35082 | MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35083 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1" )), 0))) { | ||||
| 35084 | return false; | ||||
| 35085 | } | ||||
| 35086 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35086); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35086; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35087 | args.rval().setUndefined(); | ||||
| 35088 | return true; | ||||
| 35089 | } | ||||
| 35090 | |||||
| 35091 | static const JSJitInfo exerciseTypedefInterfaces1_methodinfo = { | ||||
| 35092 | { (JSJitGetterOp)exerciseTypedefInterfaces1 }, | ||||
| 35093 | { prototypes::id::TestJSImplInterface }, | ||||
| 35094 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35095 | JSJitInfo::Method, | ||||
| 35096 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35097 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35098 | false, /* isInfallible. False in setters. */ | ||||
| 35099 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35100 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35101 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35102 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35103 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35104 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35105 | }; | ||||
| 35106 | |||||
| 35107 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35108 | exerciseTypedefInterfaces2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35109 | { | ||||
| 35110 | BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces2"); | ||||
| 35111 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35114( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35112 | "TestJSImplInterface", "exerciseTypedefInterfaces2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35114( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35113 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35114( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35114 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35114( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 35115 | |||||
| 35116 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35117 | if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces2", 1)) { | ||||
| 35118 | return false; | ||||
| 35119 | } | ||||
| 35120 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35121 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35122 | if (objIsXray) { | ||||
| 35123 | unwrappedObj.emplace(cx, obj); | ||||
| 35124 | } | ||||
| 35125 | mozilla::dom::TestJSImplInterface* arg0; | ||||
| 35126 | if (args[0].isObject()) { | ||||
| 35127 | { | ||||
| 35128 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35129 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35130 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35131 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface"); | ||||
| 35132 | return false; | ||||
| 35133 | } | ||||
| 35134 | } | ||||
| 35135 | } else if (args[0].isNullOrUndefined()) { | ||||
| 35136 | arg0 = nullptr; | ||||
| 35137 | } else { | ||||
| 35138 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 35139 | return false; | ||||
| 35140 | } | ||||
| 35141 | if (objIsXray) { | ||||
| 35142 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35143 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35144 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35145 | if (!unwrappedObj.ref()) { | ||||
| 35146 | return false; | ||||
| 35147 | } | ||||
| 35148 | } | ||||
| 35149 | FastErrorResult rv; | ||||
| 35150 | 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))))); | ||||
| 35151 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2" )), 0))) { | ||||
| 35152 | return false; | ||||
| 35153 | } | ||||
| 35154 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35154); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35154; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35155 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | ||||
| 35156 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35156); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 35156; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 35157 | return false; | ||||
| 35158 | } | ||||
| 35159 | return true; | ||||
| 35160 | } | ||||
| 35161 | |||||
| 35162 | static const JSJitInfo exerciseTypedefInterfaces2_methodinfo = { | ||||
| 35163 | { (JSJitGetterOp)exerciseTypedefInterfaces2 }, | ||||
| 35164 | { prototypes::id::TestJSImplInterface }, | ||||
| 35165 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35166 | JSJitInfo::Method, | ||||
| 35167 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35168 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 35169 | false, /* isInfallible. False in setters. */ | ||||
| 35170 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35171 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35172 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35173 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35174 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35175 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35176 | }; | ||||
| 35177 | |||||
| 35178 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35179 | exerciseTypedefInterfaces3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35180 | { | ||||
| 35181 | BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces3"); | ||||
| 35182 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35185( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35183 | "TestJSImplInterface", "exerciseTypedefInterfaces3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35185( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35184 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35185( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35185 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35185( cx, "TestJSImplInterface" , "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 35186 | |||||
| 35187 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35188 | if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces3", 1)) { | ||||
| 35189 | return false; | ||||
| 35190 | } | ||||
| 35191 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35192 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35193 | if (objIsXray) { | ||||
| 35194 | unwrappedObj.emplace(cx, obj); | ||||
| 35195 | } | ||||
| 35196 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35197 | if (args[0].isObject()) { | ||||
| 35198 | { | ||||
| 35199 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35200 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35201 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35202 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface"); | ||||
| 35203 | return false; | ||||
| 35204 | } | ||||
| 35205 | } | ||||
| 35206 | } else { | ||||
| 35207 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 35208 | return false; | ||||
| 35209 | } | ||||
| 35210 | if (objIsXray) { | ||||
| 35211 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35212 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35213 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35214 | if (!unwrappedObj.ref()) { | ||||
| 35215 | return false; | ||||
| 35216 | } | ||||
| 35217 | } | ||||
| 35218 | FastErrorResult rv; | ||||
| 35219 | // NOTE: This assert does NOT call the function. | ||||
| 35220 | 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"); | ||||
| 35221 | MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35222 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3" )), 0))) { | ||||
| 35223 | return false; | ||||
| 35224 | } | ||||
| 35225 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35225); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35225; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35226 | args.rval().setUndefined(); | ||||
| 35227 | return true; | ||||
| 35228 | } | ||||
| 35229 | |||||
| 35230 | static const JSJitInfo exerciseTypedefInterfaces3_methodinfo = { | ||||
| 35231 | { (JSJitGetterOp)exerciseTypedefInterfaces3 }, | ||||
| 35232 | { prototypes::id::TestJSImplInterface }, | ||||
| 35233 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35234 | JSJitInfo::Method, | ||||
| 35235 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35236 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35237 | false, /* isInfallible. False in setters. */ | ||||
| 35238 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35239 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35240 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35241 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35242 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35243 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35244 | }; | ||||
| 35245 | |||||
| 35246 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35247 | get_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 35248 | { | ||||
| 35249 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35252( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35250 | "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35252( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35251 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject35252( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35252 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35252( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 35253 | |||||
| 35254 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35255 | DeprecationWarning(cx, obj, DeprecatedOperations::eComponents); | ||||
| 35256 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35257 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35258 | if (objIsXray) { | ||||
| 35259 | unwrappedObj.emplace(cx, obj); | ||||
| 35260 | } | ||||
| 35261 | if (objIsXray) { | ||||
| 35262 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35263 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35264 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35265 | if (!unwrappedObj.ref()) { | ||||
| 35266 | return false; | ||||
| 35267 | } | ||||
| 35268 | } | ||||
| 35269 | FastErrorResult rv; | ||||
| 35270 | int8_t result(MOZ_KnownLive(self)(self)->GetDeprecatedAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 35271 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter" )), 0))) { | ||||
| 35272 | return false; | ||||
| 35273 | } | ||||
| 35274 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35274); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35274; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35275 | args.rval().setInt32(int32_t(result)); | ||||
| 35276 | return true; | ||||
| 35277 | } | ||||
| 35278 | |||||
| 35279 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35280 | set_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 35281 | { | ||||
| 35282 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35285( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35283 | "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35285( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35284 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject35285( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35285 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35285( cx, "TestJSImplInterface" , "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 35286 | |||||
| 35287 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35288 | DeprecationWarning(cx, obj, DeprecatedOperations::eComponents); | ||||
| 35289 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35290 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35291 | if (objIsXray) { | ||||
| 35292 | unwrappedObj.emplace(cx, obj); | ||||
| 35293 | } | ||||
| 35294 | int8_t arg0; | ||||
| 35295 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 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)->SetDeprecatedAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here"); | ||||
| 35309 | MOZ_KnownLive(self)(self)->SetDeprecatedAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35310 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter" )), 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 { *(( volatile int*)__null) = 35313; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35314 | |||||
| 35315 | return true; | ||||
| 35316 | } | ||||
| 35317 | |||||
| 35318 | static const JSJitInfo deprecatedAttribute_getterinfo = { | ||||
| 35319 | { get_deprecatedAttribute }, | ||||
| 35320 | { prototypes::id::TestJSImplInterface }, | ||||
| 35321 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35322 | JSJitInfo::Getter, | ||||
| 35323 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35324 | JSVAL_TYPE_INT32, /* 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 | static const JSJitInfo deprecatedAttribute_setterinfo = { | ||||
| 35334 | { (JSJitGetterOp)set_deprecatedAttribute }, | ||||
| 35335 | { prototypes::id::TestJSImplInterface }, | ||||
| 35336 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35337 | JSJitInfo::Setter, | ||||
| 35338 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35339 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35340 | false, /* isInfallible. False in setters. */ | ||||
| 35341 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35342 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35343 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35344 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35345 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35346 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35347 | }; | ||||
| 35348 | |||||
| 35349 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35350 | deprecatedMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35351 | { | ||||
| 35352 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35355( cx, "TestJSImplInterface" , "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35353 | "TestJSImplInterface", "deprecatedMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35355( cx, "TestJSImplInterface" , "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35354 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35355( cx, "TestJSImplInterface" , "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 35355 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35355( cx, "TestJSImplInterface" , "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 35356 | |||||
| 35357 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35358 | DeprecationWarning(cx, obj, DeprecatedOperations::eComponents); | ||||
| 35359 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35360 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35361 | if (objIsXray) { | ||||
| 35362 | unwrappedObj.emplace(cx, obj); | ||||
| 35363 | } | ||||
| 35364 | if (objIsXray) { | ||||
| 35365 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35366 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35367 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35368 | if (!unwrappedObj.ref()) { | ||||
| 35369 | return false; | ||||
| 35370 | } | ||||
| 35371 | } | ||||
| 35372 | FastErrorResult rv; | ||||
| 35373 | int8_t result(MOZ_KnownLive(self)(self)->DeprecatedMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 35374 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod" )), 0))) { | ||||
| 35375 | return false; | ||||
| 35376 | } | ||||
| 35377 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35377); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35377; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35378 | args.rval().setInt32(int32_t(result)); | ||||
| 35379 | return true; | ||||
| 35380 | } | ||||
| 35381 | |||||
| 35382 | static const JSJitInfo deprecatedMethod_methodinfo = { | ||||
| 35383 | { (JSJitGetterOp)deprecatedMethod }, | ||||
| 35384 | { prototypes::id::TestJSImplInterface }, | ||||
| 35385 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35386 | JSJitInfo::Method, | ||||
| 35387 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35388 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 35389 | false, /* isInfallible. False in setters. */ | ||||
| 35390 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35391 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35392 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35393 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35394 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35395 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35396 | }; | ||||
| 35397 | |||||
| 35398 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35399 | deprecatedMethodWithContext(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35400 | { | ||||
| 35401 | BindingCallContext cx(cx_, "TestJSImplInterface.deprecatedMethodWithContext"); | ||||
| 35402 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35405( cx, "TestJSImplInterface" , "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35403 | "TestJSImplInterface", "deprecatedMethodWithContext", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35405( cx, "TestJSImplInterface" , "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35404 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35405( cx, "TestJSImplInterface" , "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 35405 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35405( cx, "TestJSImplInterface" , "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 35406 | |||||
| 35407 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35408 | if (!args.requireAtLeast(cx, "TestJSImplInterface.deprecatedMethodWithContext", 1)) { | ||||
| 35409 | return false; | ||||
| 35410 | } | ||||
| 35411 | DeprecationWarning(cx, obj, DeprecatedOperations::eComponents); | ||||
| 35412 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35413 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35414 | if (objIsXray) { | ||||
| 35415 | unwrappedObj.emplace(cx, obj); | ||||
| 35416 | } | ||||
| 35417 | JS::Rooted<JS::Value> arg0(cx); | ||||
| 35418 | #ifdef __clang__1 | ||||
| 35419 | #pragma clang diagnostic push | ||||
| 35420 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 35421 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 35422 | #endif // __clang__ | ||||
| 35423 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 35424 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 35425 | return false; | ||||
| 35426 | } | ||||
| 35427 | #ifdef __clang__1 | ||||
| 35428 | #pragma clang diagnostic pop | ||||
| 35429 | #endif // __clang__ | ||||
| 35430 | arg0 = args[0]; | ||||
| 35431 | if (objIsXray) { | ||||
| 35432 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35433 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35434 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35435 | if (!unwrappedObj.ref()) { | ||||
| 35436 | return false; | ||||
| 35437 | } | ||||
| 35438 | } | ||||
| 35439 | FastErrorResult rv; | ||||
| 35440 | // NOTE: This assert does NOT call the function. | ||||
| 35441 | 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"); | ||||
| 35442 | MOZ_KnownLive(self)(self)->DeprecatedMethodWithContext(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35443 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext" )), 0))) { | ||||
| 35444 | return false; | ||||
| 35445 | } | ||||
| 35446 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35446); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35446; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35447 | args.rval().setUndefined(); | ||||
| 35448 | return true; | ||||
| 35449 | } | ||||
| 35450 | |||||
| 35451 | static const JSJitInfo deprecatedMethodWithContext_methodinfo = { | ||||
| 35452 | { (JSJitGetterOp)deprecatedMethodWithContext }, | ||||
| 35453 | { prototypes::id::TestJSImplInterface }, | ||||
| 35454 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35455 | JSJitInfo::Method, | ||||
| 35456 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35457 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35458 | false, /* isInfallible. False in setters. */ | ||||
| 35459 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35460 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35461 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35462 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35463 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35464 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35465 | }; | ||||
| 35466 | |||||
| 35467 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35468 | overload1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35469 | { | ||||
| 35470 | BindingCallContext cx(cx_, "TestJSImplInterface.overload1"); | ||||
| 35471 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35474( cx, "TestJSImplInterface" , "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35472 | "TestJSImplInterface", "overload1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35474( cx, "TestJSImplInterface" , "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35473 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35474( cx, "TestJSImplInterface" , "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35474 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35474( cx, "TestJSImplInterface" , "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 35475 | |||||
| 35476 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35477 | unsigned argcount = std::min(args.length(), 2u); | ||||
| 35478 | switch (argcount) { | ||||
| 35479 | case 1: { | ||||
| 35480 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35481 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35482 | if (objIsXray) { | ||||
| 35483 | unwrappedObj.emplace(cx, obj); | ||||
| 35484 | } | ||||
| 35485 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35486 | if (args[0].isObject()) { | ||||
| 35487 | { | ||||
| 35488 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35489 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35490 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35491 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface"); | ||||
| 35492 | return false; | ||||
| 35493 | } | ||||
| 35494 | } | ||||
| 35495 | } else { | ||||
| 35496 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 35497 | return false; | ||||
| 35498 | } | ||||
| 35499 | if (objIsXray) { | ||||
| 35500 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35501 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35502 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35503 | if (!unwrappedObj.ref()) { | ||||
| 35504 | return false; | ||||
| 35505 | } | ||||
| 35506 | } | ||||
| 35507 | FastErrorResult rv; | ||||
| 35508 | bool result(MOZ_KnownLive(self)(self)->Overload1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 35509 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1" )), 0))) { | ||||
| 35510 | return false; | ||||
| 35511 | } | ||||
| 35512 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35512); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35512; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35513 | args.rval().setBoolean(result); | ||||
| 35514 | return true; | ||||
| 35515 | break; | ||||
| 35516 | } | ||||
| 35517 | case 2: { | ||||
| 35518 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35519 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35520 | if (objIsXray) { | ||||
| 35521 | unwrappedObj.emplace(cx, obj); | ||||
| 35522 | } | ||||
| 35523 | binding_detail::FakeString<char16_t> arg0; | ||||
| 35524 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 35525 | return false; | ||||
| 35526 | } | ||||
| 35527 | NonNull<mozilla::dom::TestJSImplInterface> arg1; | ||||
| 35528 | if (args[1].isObject()) { | ||||
| 35529 | { | ||||
| 35530 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35531 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[1], arg1, cx); | ||||
| 35532 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35533 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestJSImplInterface"); | ||||
| 35534 | return false; | ||||
| 35535 | } | ||||
| 35536 | } | ||||
| 35537 | } else { | ||||
| 35538 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2"); | ||||
| 35539 | return false; | ||||
| 35540 | } | ||||
| 35541 | if (objIsXray) { | ||||
| 35542 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35543 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35544 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35545 | if (!unwrappedObj.ref()) { | ||||
| 35546 | return false; | ||||
| 35547 | } | ||||
| 35548 | } | ||||
| 35549 | FastErrorResult rv; | ||||
| 35550 | 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))))); | ||||
| 35551 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1" )), 0))) { | ||||
| 35552 | return false; | ||||
| 35553 | } | ||||
| 35554 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35554); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35554; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35555 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | ||||
| 35556 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35556); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 35556; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 35557 | return false; | ||||
| 35558 | } | ||||
| 35559 | return true; | ||||
| 35560 | break; | ||||
| 35561 | } | ||||
| 35562 | default: { | ||||
| 35563 | // Using nsPrintfCString here would require including that | ||||
| 35564 | // header. Let's not worry about it. | ||||
| 35565 | nsAutoCString argCountStr; | ||||
| 35566 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 35567 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 35568 | } | ||||
| 35569 | } | ||||
| 35570 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 35570); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 35570; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 35571 | return false; | ||||
| 35572 | } | ||||
| 35573 | |||||
| 35574 | static const JSJitInfo overload1_methodinfo = { | ||||
| 35575 | { (JSJitGetterOp)overload1 }, | ||||
| 35576 | { prototypes::id::TestJSImplInterface }, | ||||
| 35577 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35578 | JSJitInfo::Method, | ||||
| 35579 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35580 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 35581 | false, /* isInfallible. False in setters. */ | ||||
| 35582 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35583 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35584 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35585 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35586 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35587 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35588 | }; | ||||
| 35589 | |||||
| 35590 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35591 | overload2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35592 | { | ||||
| 35593 | BindingCallContext cx(cx_, "TestJSImplInterface.overload2"); | ||||
| 35594 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35597( cx, "TestJSImplInterface" , "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35595 | "TestJSImplInterface", "overload2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35597( cx, "TestJSImplInterface" , "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35596 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35597( cx, "TestJSImplInterface" , "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35597 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35597( cx, "TestJSImplInterface" , "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 35598 | |||||
| 35599 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35600 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 35601 | switch (argcount) { | ||||
| 35602 | case 0: { | ||||
| 35603 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35604 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35605 | if (objIsXray) { | ||||
| 35606 | unwrappedObj.emplace(cx, obj); | ||||
| 35607 | } | ||||
| 35608 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 35609 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 35610 | return false; | ||||
| 35611 | } | ||||
| 35612 | if (objIsXray) { | ||||
| 35613 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35614 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35615 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35616 | if (!unwrappedObj.ref()) { | ||||
| 35617 | return false; | ||||
| 35618 | } | ||||
| 35619 | } | ||||
| 35620 | FastErrorResult rv; | ||||
| 35621 | // NOTE: This assert does NOT call the function. | ||||
| 35622 | 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"); | ||||
| 35623 | MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35624 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35625 | return false; | ||||
| 35626 | } | ||||
| 35627 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35627); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35627; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35628 | args.rval().setUndefined(); | ||||
| 35629 | return true; | ||||
| 35630 | break; | ||||
| 35631 | } | ||||
| 35632 | case 1: { | ||||
| 35633 | if (args[0].isNullOrUndefined()) { | ||||
| 35634 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 35635 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 35636 | return false; | ||||
| 35637 | } | ||||
| 35638 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35639 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35640 | if (objIsXray) { | ||||
| 35641 | unwrappedObj.emplace(cx, obj); | ||||
| 35642 | } | ||||
| 35643 | if (objIsXray) { | ||||
| 35644 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35645 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35646 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35647 | if (!unwrappedObj.ref()) { | ||||
| 35648 | return false; | ||||
| 35649 | } | ||||
| 35650 | } | ||||
| 35651 | FastErrorResult rv; | ||||
| 35652 | // NOTE: This assert does NOT call the function. | ||||
| 35653 | 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"); | ||||
| 35654 | MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35655 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35656 | return false; | ||||
| 35657 | } | ||||
| 35658 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35658); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35658; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35659 | args.rval().setUndefined(); | ||||
| 35660 | return true; | ||||
| 35661 | } | ||||
| 35662 | if (args[0].isObject()) { | ||||
| 35663 | do { | ||||
| 35664 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35665 | { | ||||
| 35666 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35667 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35668 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35669 | break; | ||||
| 35670 | } | ||||
| 35671 | } | ||||
| 35672 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35673 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35674 | if (objIsXray) { | ||||
| 35675 | unwrappedObj.emplace(cx, obj); | ||||
| 35676 | } | ||||
| 35677 | if (objIsXray) { | ||||
| 35678 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35679 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35680 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35681 | if (!unwrappedObj.ref()) { | ||||
| 35682 | return false; | ||||
| 35683 | } | ||||
| 35684 | } | ||||
| 35685 | FastErrorResult rv; | ||||
| 35686 | // NOTE: This assert does NOT call the function. | ||||
| 35687 | 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"); | ||||
| 35688 | MOZ_KnownLive(self)(self)->Overload2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35689 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35690 | return false; | ||||
| 35691 | } | ||||
| 35692 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35692); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35692; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35693 | args.rval().setUndefined(); | ||||
| 35694 | return true; | ||||
| 35695 | } while (false); | ||||
| 35696 | do { | ||||
| 35697 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 35698 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 35699 | return false; | ||||
| 35700 | } | ||||
| 35701 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35702 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35703 | if (objIsXray) { | ||||
| 35704 | unwrappedObj.emplace(cx, obj); | ||||
| 35705 | } | ||||
| 35706 | if (objIsXray) { | ||||
| 35707 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35708 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35709 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35710 | if (!unwrappedObj.ref()) { | ||||
| 35711 | return false; | ||||
| 35712 | } | ||||
| 35713 | } | ||||
| 35714 | FastErrorResult rv; | ||||
| 35715 | // NOTE: This assert does NOT call the function. | ||||
| 35716 | 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"); | ||||
| 35717 | MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35718 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35719 | return false; | ||||
| 35720 | } | ||||
| 35721 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35721); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35721; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35722 | args.rval().setUndefined(); | ||||
| 35723 | return true; | ||||
| 35724 | } while (false); | ||||
| 35725 | } | ||||
| 35726 | if (args[0].isBoolean()) { | ||||
| 35727 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35728 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35729 | if (objIsXray) { | ||||
| 35730 | unwrappedObj.emplace(cx, obj); | ||||
| 35731 | } | ||||
| 35732 | bool arg0; | ||||
| 35733 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 35734 | return false; | ||||
| 35735 | } | ||||
| 35736 | if (objIsXray) { | ||||
| 35737 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35738 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35739 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35740 | if (!unwrappedObj.ref()) { | ||||
| 35741 | return false; | ||||
| 35742 | } | ||||
| 35743 | } | ||||
| 35744 | FastErrorResult rv; | ||||
| 35745 | // NOTE: This assert does NOT call the function. | ||||
| 35746 | 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"); | ||||
| 35747 | MOZ_KnownLive(self)(self)->Overload2(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35748 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35749 | return false; | ||||
| 35750 | } | ||||
| 35751 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35751; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35752 | args.rval().setUndefined(); | ||||
| 35753 | return true; | ||||
| 35754 | } | ||||
| 35755 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35756 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35757 | if (objIsXray) { | ||||
| 35758 | unwrappedObj.emplace(cx, obj); | ||||
| 35759 | } | ||||
| 35760 | binding_detail::FakeString<char16_t> arg0; | ||||
| 35761 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 35762 | return false; | ||||
| 35763 | } | ||||
| 35764 | if (objIsXray) { | ||||
| 35765 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35766 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35767 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35768 | if (!unwrappedObj.ref()) { | ||||
| 35769 | return false; | ||||
| 35770 | } | ||||
| 35771 | } | ||||
| 35772 | FastErrorResult rv; | ||||
| 35773 | // NOTE: This assert does NOT call the function. | ||||
| 35774 | 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"); | ||||
| 35775 | MOZ_KnownLive(self)(self)->Overload2(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35776 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2" )), 0))) { | ||||
| 35777 | return false; | ||||
| 35778 | } | ||||
| 35779 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35779); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35779; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35780 | args.rval().setUndefined(); | ||||
| 35781 | return true; | ||||
| 35782 | break; | ||||
| 35783 | } | ||||
| 35784 | default: { | ||||
| 35785 | // Using nsPrintfCString here would require including that | ||||
| 35786 | // header. Let's not worry about it. | ||||
| 35787 | nsAutoCString argCountStr; | ||||
| 35788 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 35789 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 35790 | } | ||||
| 35791 | } | ||||
| 35792 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 35792); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 35792; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 35793 | return false; | ||||
| 35794 | } | ||||
| 35795 | |||||
| 35796 | static const JSJitInfo overload2_methodinfo = { | ||||
| 35797 | { (JSJitGetterOp)overload2 }, | ||||
| 35798 | { prototypes::id::TestJSImplInterface }, | ||||
| 35799 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35800 | JSJitInfo::Method, | ||||
| 35801 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35802 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35803 | false, /* isInfallible. False in setters. */ | ||||
| 35804 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35805 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35806 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35807 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35808 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35809 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35810 | }; | ||||
| 35811 | |||||
| 35812 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35813 | overload3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35814 | { | ||||
| 35815 | BindingCallContext cx(cx_, "TestJSImplInterface.overload3"); | ||||
| 35816 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35819( cx, "TestJSImplInterface" , "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35817 | "TestJSImplInterface", "overload3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35819( cx, "TestJSImplInterface" , "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35818 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35819( cx, "TestJSImplInterface" , "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35819 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35819( cx, "TestJSImplInterface" , "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 35820 | |||||
| 35821 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35822 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 35823 | switch (argcount) { | ||||
| 35824 | case 1: { | ||||
| 35825 | if (args[0].isObject()) { | ||||
| 35826 | do { | ||||
| 35827 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35828 | { | ||||
| 35829 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35830 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35831 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35832 | break; | ||||
| 35833 | } | ||||
| 35834 | } | ||||
| 35835 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35836 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35837 | if (objIsXray) { | ||||
| 35838 | unwrappedObj.emplace(cx, obj); | ||||
| 35839 | } | ||||
| 35840 | if (objIsXray) { | ||||
| 35841 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35842 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35843 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35844 | if (!unwrappedObj.ref()) { | ||||
| 35845 | return false; | ||||
| 35846 | } | ||||
| 35847 | } | ||||
| 35848 | FastErrorResult rv; | ||||
| 35849 | // NOTE: This assert does NOT call the function. | ||||
| 35850 | 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"); | ||||
| 35851 | MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35852 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3" )), 0))) { | ||||
| 35853 | return false; | ||||
| 35854 | } | ||||
| 35855 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35855); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35855; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35856 | args.rval().setUndefined(); | ||||
| 35857 | return true; | ||||
| 35858 | } while (false); | ||||
| 35859 | do { | ||||
| 35860 | RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx); | ||||
| 35861 | if (JS::IsCallable(&args[0].toObject())) { | ||||
| 35862 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 35863 | arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 35864 | } | ||||
| 35865 | } else { | ||||
| 35866 | break; | ||||
| 35867 | } | ||||
| 35868 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35869 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35870 | if (objIsXray) { | ||||
| 35871 | unwrappedObj.emplace(cx, obj); | ||||
| 35872 | } | ||||
| 35873 | if (objIsXray) { | ||||
| 35874 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35875 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35876 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35877 | if (!unwrappedObj.ref()) { | ||||
| 35878 | return false; | ||||
| 35879 | } | ||||
| 35880 | } | ||||
| 35881 | FastErrorResult rv; | ||||
| 35882 | // NOTE: This assert does NOT call the function. | ||||
| 35883 | 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"); | ||||
| 35884 | MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35885 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3" )), 0))) { | ||||
| 35886 | return false; | ||||
| 35887 | } | ||||
| 35888 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35888); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35888; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35889 | args.rval().setUndefined(); | ||||
| 35890 | return true; | ||||
| 35891 | } while (false); | ||||
| 35892 | } | ||||
| 35893 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35894 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35895 | if (objIsXray) { | ||||
| 35896 | unwrappedObj.emplace(cx, obj); | ||||
| 35897 | } | ||||
| 35898 | bool arg0; | ||||
| 35899 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 35900 | return false; | ||||
| 35901 | } | ||||
| 35902 | if (objIsXray) { | ||||
| 35903 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35904 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35905 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35906 | if (!unwrappedObj.ref()) { | ||||
| 35907 | return false; | ||||
| 35908 | } | ||||
| 35909 | } | ||||
| 35910 | FastErrorResult rv; | ||||
| 35911 | // NOTE: This assert does NOT call the function. | ||||
| 35912 | 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"); | ||||
| 35913 | MOZ_KnownLive(self)(self)->Overload3(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35914 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3" )), 0))) { | ||||
| 35915 | return false; | ||||
| 35916 | } | ||||
| 35917 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35917); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35917; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35918 | args.rval().setUndefined(); | ||||
| 35919 | return true; | ||||
| 35920 | break; | ||||
| 35921 | } | ||||
| 35922 | default: { | ||||
| 35923 | // Using nsPrintfCString here would require including that | ||||
| 35924 | // header. Let's not worry about it. | ||||
| 35925 | nsAutoCString argCountStr; | ||||
| 35926 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 35927 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 35928 | } | ||||
| 35929 | } | ||||
| 35930 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 35930); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 35930; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 35931 | return false; | ||||
| 35932 | } | ||||
| 35933 | |||||
| 35934 | static const JSJitInfo overload3_methodinfo = { | ||||
| 35935 | { (JSJitGetterOp)overload3 }, | ||||
| 35936 | { prototypes::id::TestJSImplInterface }, | ||||
| 35937 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 35938 | JSJitInfo::Method, | ||||
| 35939 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 35940 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 35941 | false, /* isInfallible. False in setters. */ | ||||
| 35942 | false, /* isMovable. Not relevant for setters. */ | ||||
| 35943 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 35944 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 35945 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 35946 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 35947 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 35948 | }; | ||||
| 35949 | |||||
| 35950 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 35951 | overload4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 35952 | { | ||||
| 35953 | BindingCallContext cx(cx_, "TestJSImplInterface.overload4"); | ||||
| 35954 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35957( cx, "TestJSImplInterface" , "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35955 | "TestJSImplInterface", "overload4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35957( cx, "TestJSImplInterface" , "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35956 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35957( cx, "TestJSImplInterface" , "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 35957 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35957( cx, "TestJSImplInterface" , "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 35958 | |||||
| 35959 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 35960 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 35961 | switch (argcount) { | ||||
| 35962 | case 1: { | ||||
| 35963 | if (args[0].isObject()) { | ||||
| 35964 | do { | ||||
| 35965 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 35966 | { | ||||
| 35967 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 35968 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 35969 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 35970 | break; | ||||
| 35971 | } | ||||
| 35972 | } | ||||
| 35973 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 35974 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 35975 | if (objIsXray) { | ||||
| 35976 | unwrappedObj.emplace(cx, obj); | ||||
| 35977 | } | ||||
| 35978 | if (objIsXray) { | ||||
| 35979 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 35980 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 35981 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 35982 | if (!unwrappedObj.ref()) { | ||||
| 35983 | return false; | ||||
| 35984 | } | ||||
| 35985 | } | ||||
| 35986 | FastErrorResult rv; | ||||
| 35987 | // NOTE: This assert does NOT call the function. | ||||
| 35988 | 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"); | ||||
| 35989 | MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 35990 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4" )), 0))) { | ||||
| 35991 | return false; | ||||
| 35992 | } | ||||
| 35993 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 35993); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 35993; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 35994 | args.rval().setUndefined(); | ||||
| 35995 | return true; | ||||
| 35996 | } while (false); | ||||
| 35997 | do { | ||||
| 35998 | RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx); | ||||
| 35999 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 36000 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 36001 | } | ||||
| 36002 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36003 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36004 | if (objIsXray) { | ||||
| 36005 | unwrappedObj.emplace(cx, obj); | ||||
| 36006 | } | ||||
| 36007 | if (objIsXray) { | ||||
| 36008 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36009 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36010 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36011 | if (!unwrappedObj.ref()) { | ||||
| 36012 | return false; | ||||
| 36013 | } | ||||
| 36014 | } | ||||
| 36015 | FastErrorResult rv; | ||||
| 36016 | // NOTE: This assert does NOT call the function. | ||||
| 36017 | 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"); | ||||
| 36018 | MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36019 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4" )), 0))) { | ||||
| 36020 | return false; | ||||
| 36021 | } | ||||
| 36022 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36022); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36022; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36023 | args.rval().setUndefined(); | ||||
| 36024 | return true; | ||||
| 36025 | } while (false); | ||||
| 36026 | } | ||||
| 36027 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36028 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36029 | if (objIsXray) { | ||||
| 36030 | unwrappedObj.emplace(cx, obj); | ||||
| 36031 | } | ||||
| 36032 | binding_detail::FakeString<char16_t> arg0; | ||||
| 36033 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 36034 | return false; | ||||
| 36035 | } | ||||
| 36036 | if (objIsXray) { | ||||
| 36037 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36038 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36039 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36040 | if (!unwrappedObj.ref()) { | ||||
| 36041 | return false; | ||||
| 36042 | } | ||||
| 36043 | } | ||||
| 36044 | FastErrorResult rv; | ||||
| 36045 | // NOTE: This assert does NOT call the function. | ||||
| 36046 | 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"); | ||||
| 36047 | MOZ_KnownLive(self)(self)->Overload4(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36048 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4" )), 0))) { | ||||
| 36049 | return false; | ||||
| 36050 | } | ||||
| 36051 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36051); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36051; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36052 | args.rval().setUndefined(); | ||||
| 36053 | return true; | ||||
| 36054 | break; | ||||
| 36055 | } | ||||
| 36056 | default: { | ||||
| 36057 | // Using nsPrintfCString here would require including that | ||||
| 36058 | // header. Let's not worry about it. | ||||
| 36059 | nsAutoCString argCountStr; | ||||
| 36060 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36061 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36062 | } | ||||
| 36063 | } | ||||
| 36064 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36064); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36064; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36065 | return false; | ||||
| 36066 | } | ||||
| 36067 | |||||
| 36068 | static const JSJitInfo overload4_methodinfo = { | ||||
| 36069 | { (JSJitGetterOp)overload4 }, | ||||
| 36070 | { prototypes::id::TestJSImplInterface }, | ||||
| 36071 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36072 | JSJitInfo::Method, | ||||
| 36073 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36074 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36075 | false, /* isInfallible. False in setters. */ | ||||
| 36076 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36077 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36078 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36079 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36080 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36081 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36082 | }; | ||||
| 36083 | |||||
| 36084 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36085 | overload5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36086 | { | ||||
| 36087 | BindingCallContext cx(cx_, "TestJSImplInterface.overload5"); | ||||
| 36088 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36091( cx, "TestJSImplInterface" , "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36089 | "TestJSImplInterface", "overload5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36091( cx, "TestJSImplInterface" , "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36090 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36091( cx, "TestJSImplInterface" , "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36091 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36091( cx, "TestJSImplInterface" , "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 36092 | |||||
| 36093 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36094 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36095 | switch (argcount) { | ||||
| 36096 | case 1: { | ||||
| 36097 | if (args[0].isNumber()) { | ||||
| 36098 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36099 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36100 | if (objIsXray) { | ||||
| 36101 | unwrappedObj.emplace(cx, obj); | ||||
| 36102 | } | ||||
| 36103 | int32_t arg0; | ||||
| 36104 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36105 | return false; | ||||
| 36106 | } | ||||
| 36107 | if (objIsXray) { | ||||
| 36108 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36109 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36110 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36111 | if (!unwrappedObj.ref()) { | ||||
| 36112 | return false; | ||||
| 36113 | } | ||||
| 36114 | } | ||||
| 36115 | FastErrorResult rv; | ||||
| 36116 | // NOTE: This assert does NOT call the function. | ||||
| 36117 | 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"); | ||||
| 36118 | MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36119 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5" )), 0))) { | ||||
| 36120 | return false; | ||||
| 36121 | } | ||||
| 36122 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36122); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36122; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36123 | args.rval().setUndefined(); | ||||
| 36124 | return true; | ||||
| 36125 | } | ||||
| 36126 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36127 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36128 | if (objIsXray) { | ||||
| 36129 | unwrappedObj.emplace(cx, obj); | ||||
| 36130 | } | ||||
| 36131 | MyTestEnum arg0; | ||||
| 36132 | { | ||||
| 36133 | int index; | ||||
| 36134 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | ||||
| 36135 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 36136 | "MyTestEnum", "argument 1", | ||||
| 36137 | &index)) { | ||||
| 36138 | return false; | ||||
| 36139 | } | ||||
| 36140 | 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", 36140); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 36140; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 36141 | arg0 = static_cast<MyTestEnum>(index); | ||||
| 36142 | } | ||||
| 36143 | if (objIsXray) { | ||||
| 36144 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36145 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36146 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36147 | if (!unwrappedObj.ref()) { | ||||
| 36148 | return false; | ||||
| 36149 | } | ||||
| 36150 | } | ||||
| 36151 | FastErrorResult rv; | ||||
| 36152 | // NOTE: This assert does NOT call the function. | ||||
| 36153 | 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"); | ||||
| 36154 | MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36155 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5" )), 0))) { | ||||
| 36156 | return false; | ||||
| 36157 | } | ||||
| 36158 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36158); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36158; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36159 | args.rval().setUndefined(); | ||||
| 36160 | return true; | ||||
| 36161 | break; | ||||
| 36162 | } | ||||
| 36163 | default: { | ||||
| 36164 | // Using nsPrintfCString here would require including that | ||||
| 36165 | // header. Let's not worry about it. | ||||
| 36166 | nsAutoCString argCountStr; | ||||
| 36167 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36168 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36169 | } | ||||
| 36170 | } | ||||
| 36171 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36171); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36171; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36172 | return false; | ||||
| 36173 | } | ||||
| 36174 | |||||
| 36175 | static const JSJitInfo overload5_methodinfo = { | ||||
| 36176 | { (JSJitGetterOp)overload5 }, | ||||
| 36177 | { prototypes::id::TestJSImplInterface }, | ||||
| 36178 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36179 | JSJitInfo::Method, | ||||
| 36180 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36181 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36182 | false, /* isInfallible. False in setters. */ | ||||
| 36183 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36184 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36185 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36186 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36187 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36188 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36189 | }; | ||||
| 36190 | |||||
| 36191 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36192 | overload6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36193 | { | ||||
| 36194 | BindingCallContext cx(cx_, "TestJSImplInterface.overload6"); | ||||
| 36195 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36198( cx, "TestJSImplInterface" , "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36196 | "TestJSImplInterface", "overload6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36198( cx, "TestJSImplInterface" , "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36197 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36198( cx, "TestJSImplInterface" , "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36198 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36198( cx, "TestJSImplInterface" , "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 36199 | |||||
| 36200 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36201 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36202 | switch (argcount) { | ||||
| 36203 | case 1: { | ||||
| 36204 | if (args[0].isBoolean()) { | ||||
| 36205 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36206 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36207 | if (objIsXray) { | ||||
| 36208 | unwrappedObj.emplace(cx, obj); | ||||
| 36209 | } | ||||
| 36210 | bool arg0; | ||||
| 36211 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36212 | return false; | ||||
| 36213 | } | ||||
| 36214 | if (objIsXray) { | ||||
| 36215 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36216 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36217 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36218 | if (!unwrappedObj.ref()) { | ||||
| 36219 | return false; | ||||
| 36220 | } | ||||
| 36221 | } | ||||
| 36222 | FastErrorResult rv; | ||||
| 36223 | // NOTE: This assert does NOT call the function. | ||||
| 36224 | 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"); | ||||
| 36225 | MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36226 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6" )), 0))) { | ||||
| 36227 | return false; | ||||
| 36228 | } | ||||
| 36229 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36229); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36229; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36230 | args.rval().setUndefined(); | ||||
| 36231 | return true; | ||||
| 36232 | } | ||||
| 36233 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36234 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36235 | if (objIsXray) { | ||||
| 36236 | unwrappedObj.emplace(cx, obj); | ||||
| 36237 | } | ||||
| 36238 | int32_t arg0; | ||||
| 36239 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36240 | return false; | ||||
| 36241 | } | ||||
| 36242 | if (objIsXray) { | ||||
| 36243 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36244 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36245 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36246 | if (!unwrappedObj.ref()) { | ||||
| 36247 | return false; | ||||
| 36248 | } | ||||
| 36249 | } | ||||
| 36250 | FastErrorResult rv; | ||||
| 36251 | // NOTE: This assert does NOT call the function. | ||||
| 36252 | 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"); | ||||
| 36253 | MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36254 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6" )), 0))) { | ||||
| 36255 | return false; | ||||
| 36256 | } | ||||
| 36257 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36257); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36257; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36258 | args.rval().setUndefined(); | ||||
| 36259 | return true; | ||||
| 36260 | break; | ||||
| 36261 | } | ||||
| 36262 | default: { | ||||
| 36263 | // Using nsPrintfCString here would require including that | ||||
| 36264 | // header. Let's not worry about it. | ||||
| 36265 | nsAutoCString argCountStr; | ||||
| 36266 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36267 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36268 | } | ||||
| 36269 | } | ||||
| 36270 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36270); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36270; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36271 | return false; | ||||
| 36272 | } | ||||
| 36273 | |||||
| 36274 | static const JSJitInfo overload6_methodinfo = { | ||||
| 36275 | { (JSJitGetterOp)overload6 }, | ||||
| 36276 | { prototypes::id::TestJSImplInterface }, | ||||
| 36277 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36278 | JSJitInfo::Method, | ||||
| 36279 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36280 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36281 | false, /* isInfallible. False in setters. */ | ||||
| 36282 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36283 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36284 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36285 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36286 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36287 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36288 | }; | ||||
| 36289 | |||||
| 36290 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36291 | overload7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36292 | { | ||||
| 36293 | BindingCallContext cx(cx_, "TestJSImplInterface.overload7"); | ||||
| 36294 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36297( cx, "TestJSImplInterface" , "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36295 | "TestJSImplInterface", "overload7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36297( cx, "TestJSImplInterface" , "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36296 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36297( cx, "TestJSImplInterface" , "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36297 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36297( cx, "TestJSImplInterface" , "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 36298 | |||||
| 36299 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36300 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36301 | switch (argcount) { | ||||
| 36302 | case 1: { | ||||
| 36303 | if (args[0].isBoolean()) { | ||||
| 36304 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36305 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36306 | if (objIsXray) { | ||||
| 36307 | unwrappedObj.emplace(cx, obj); | ||||
| 36308 | } | ||||
| 36309 | bool arg0; | ||||
| 36310 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36311 | return false; | ||||
| 36312 | } | ||||
| 36313 | if (objIsXray) { | ||||
| 36314 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36315 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36316 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36317 | if (!unwrappedObj.ref()) { | ||||
| 36318 | return false; | ||||
| 36319 | } | ||||
| 36320 | } | ||||
| 36321 | FastErrorResult rv; | ||||
| 36322 | // NOTE: This assert does NOT call the function. | ||||
| 36323 | 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"); | ||||
| 36324 | MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36325 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7" )), 0))) { | ||||
| 36326 | return false; | ||||
| 36327 | } | ||||
| 36328 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36328); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36328; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36329 | args.rval().setUndefined(); | ||||
| 36330 | return true; | ||||
| 36331 | } | ||||
| 36332 | if (args[0].isNumber()) { | ||||
| 36333 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36334 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36335 | if (objIsXray) { | ||||
| 36336 | unwrappedObj.emplace(cx, obj); | ||||
| 36337 | } | ||||
| 36338 | int32_t arg0; | ||||
| 36339 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36340 | return false; | ||||
| 36341 | } | ||||
| 36342 | if (objIsXray) { | ||||
| 36343 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36344 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36345 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36346 | if (!unwrappedObj.ref()) { | ||||
| 36347 | return false; | ||||
| 36348 | } | ||||
| 36349 | } | ||||
| 36350 | FastErrorResult rv; | ||||
| 36351 | // NOTE: This assert does NOT call the function. | ||||
| 36352 | 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"); | ||||
| 36353 | MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36354 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7" )), 0))) { | ||||
| 36355 | return false; | ||||
| 36356 | } | ||||
| 36357 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36357); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36357; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36358 | args.rval().setUndefined(); | ||||
| 36359 | return true; | ||||
| 36360 | } | ||||
| 36361 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36362 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36363 | if (objIsXray) { | ||||
| 36364 | unwrappedObj.emplace(cx, obj); | ||||
| 36365 | } | ||||
| 36366 | nsCString arg0; | ||||
| 36367 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) { | ||||
| 36368 | return false; | ||||
| 36369 | } | ||||
| 36370 | if (objIsXray) { | ||||
| 36371 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36372 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36373 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36374 | if (!unwrappedObj.ref()) { | ||||
| 36375 | return false; | ||||
| 36376 | } | ||||
| 36377 | } | ||||
| 36378 | FastErrorResult rv; | ||||
| 36379 | // NOTE: This assert does NOT call the function. | ||||
| 36380 | 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"); | ||||
| 36381 | MOZ_KnownLive(self)(self)->Overload7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36382 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7" )), 0))) { | ||||
| 36383 | return false; | ||||
| 36384 | } | ||||
| 36385 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36385); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36385; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36386 | args.rval().setUndefined(); | ||||
| 36387 | return true; | ||||
| 36388 | break; | ||||
| 36389 | } | ||||
| 36390 | default: { | ||||
| 36391 | // Using nsPrintfCString here would require including that | ||||
| 36392 | // header. Let's not worry about it. | ||||
| 36393 | nsAutoCString argCountStr; | ||||
| 36394 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36395 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36396 | } | ||||
| 36397 | } | ||||
| 36398 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36398); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36398; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36399 | return false; | ||||
| 36400 | } | ||||
| 36401 | |||||
| 36402 | static const JSJitInfo overload7_methodinfo = { | ||||
| 36403 | { (JSJitGetterOp)overload7 }, | ||||
| 36404 | { prototypes::id::TestJSImplInterface }, | ||||
| 36405 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36406 | JSJitInfo::Method, | ||||
| 36407 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36408 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36409 | false, /* isInfallible. False in setters. */ | ||||
| 36410 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36411 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36412 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36413 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36414 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36415 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36416 | }; | ||||
| 36417 | |||||
| 36418 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36419 | overload8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36420 | { | ||||
| 36421 | BindingCallContext cx(cx_, "TestJSImplInterface.overload8"); | ||||
| 36422 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36425( cx, "TestJSImplInterface" , "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36423 | "TestJSImplInterface", "overload8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36425( cx, "TestJSImplInterface" , "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36424 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36425( cx, "TestJSImplInterface" , "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36425 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36425( cx, "TestJSImplInterface" , "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 36426 | |||||
| 36427 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36428 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36429 | switch (argcount) { | ||||
| 36430 | case 1: { | ||||
| 36431 | if (args[0].isObject()) { | ||||
| 36432 | do { | ||||
| 36433 | NonNull<mozilla::dom::TestJSImplInterface> arg0; | ||||
| 36434 | { | ||||
| 36435 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 36436 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx); | ||||
| 36437 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 36438 | break; | ||||
| 36439 | } | ||||
| 36440 | } | ||||
| 36441 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36442 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36443 | if (objIsXray) { | ||||
| 36444 | unwrappedObj.emplace(cx, obj); | ||||
| 36445 | } | ||||
| 36446 | if (objIsXray) { | ||||
| 36447 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36448 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36449 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36450 | if (!unwrappedObj.ref()) { | ||||
| 36451 | return false; | ||||
| 36452 | } | ||||
| 36453 | } | ||||
| 36454 | FastErrorResult rv; | ||||
| 36455 | // NOTE: This assert does NOT call the function. | ||||
| 36456 | 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"); | ||||
| 36457 | MOZ_KnownLive(self)(self)->Overload8(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36458 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8" )), 0))) { | ||||
| 36459 | return false; | ||||
| 36460 | } | ||||
| 36461 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36461); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36461; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36462 | args.rval().setUndefined(); | ||||
| 36463 | return true; | ||||
| 36464 | } while (false); | ||||
| 36465 | } | ||||
| 36466 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36467 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36468 | if (objIsXray) { | ||||
| 36469 | unwrappedObj.emplace(cx, obj); | ||||
| 36470 | } | ||||
| 36471 | int32_t arg0; | ||||
| 36472 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36473 | return false; | ||||
| 36474 | } | ||||
| 36475 | if (objIsXray) { | ||||
| 36476 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36477 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36478 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36479 | if (!unwrappedObj.ref()) { | ||||
| 36480 | return false; | ||||
| 36481 | } | ||||
| 36482 | } | ||||
| 36483 | FastErrorResult rv; | ||||
| 36484 | // NOTE: This assert does NOT call the function. | ||||
| 36485 | 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"); | ||||
| 36486 | MOZ_KnownLive(self)(self)->Overload8(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36487 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8" )), 0))) { | ||||
| 36488 | return false; | ||||
| 36489 | } | ||||
| 36490 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36490); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36490; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36491 | args.rval().setUndefined(); | ||||
| 36492 | return true; | ||||
| 36493 | break; | ||||
| 36494 | } | ||||
| 36495 | default: { | ||||
| 36496 | // Using nsPrintfCString here would require including that | ||||
| 36497 | // header. Let's not worry about it. | ||||
| 36498 | nsAutoCString argCountStr; | ||||
| 36499 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36500 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36501 | } | ||||
| 36502 | } | ||||
| 36503 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36503); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36503; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36504 | return false; | ||||
| 36505 | } | ||||
| 36506 | |||||
| 36507 | static const JSJitInfo overload8_methodinfo = { | ||||
| 36508 | { (JSJitGetterOp)overload8 }, | ||||
| 36509 | { prototypes::id::TestJSImplInterface }, | ||||
| 36510 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36511 | JSJitInfo::Method, | ||||
| 36512 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36513 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36514 | false, /* isInfallible. False in setters. */ | ||||
| 36515 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36516 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36517 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36518 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36519 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36520 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36521 | }; | ||||
| 36522 | |||||
| 36523 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36524 | overload9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36525 | { | ||||
| 36526 | BindingCallContext cx(cx_, "TestJSImplInterface.overload9"); | ||||
| 36527 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36530( cx, "TestJSImplInterface" , "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36528 | "TestJSImplInterface", "overload9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36530( cx, "TestJSImplInterface" , "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36529 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36530( cx, "TestJSImplInterface" , "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 36530 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36530( cx, "TestJSImplInterface" , "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 36531 | |||||
| 36532 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36533 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36534 | switch (argcount) { | ||||
| 36535 | case 1: { | ||||
| 36536 | if (args[0].isNullOrUndefined()) { | ||||
| 36537 | Nullable<int32_t> arg0; | ||||
| 36538 | if (args[0].isNullOrUndefined()) { | ||||
| 36539 | arg0.SetNull(); | ||||
| 36540 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 36541 | return false; | ||||
| 36542 | } | ||||
| 36543 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36544 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36545 | if (objIsXray) { | ||||
| 36546 | unwrappedObj.emplace(cx, obj); | ||||
| 36547 | } | ||||
| 36548 | if (objIsXray) { | ||||
| 36549 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36550 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36551 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36552 | if (!unwrappedObj.ref()) { | ||||
| 36553 | return false; | ||||
| 36554 | } | ||||
| 36555 | } | ||||
| 36556 | FastErrorResult rv; | ||||
| 36557 | // NOTE: This assert does NOT call the function. | ||||
| 36558 | 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"); | ||||
| 36559 | MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36560 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9" )), 0))) { | ||||
| 36561 | return false; | ||||
| 36562 | } | ||||
| 36563 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36563); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36563; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36564 | args.rval().setUndefined(); | ||||
| 36565 | return true; | ||||
| 36566 | } | ||||
| 36567 | if (args[0].isNumber()) { | ||||
| 36568 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36569 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36570 | if (objIsXray) { | ||||
| 36571 | unwrappedObj.emplace(cx, obj); | ||||
| 36572 | } | ||||
| 36573 | Nullable<int32_t> arg0; | ||||
| 36574 | if (args[0].isNullOrUndefined()) { | ||||
| 36575 | arg0.SetNull(); | ||||
| 36576 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 36577 | return false; | ||||
| 36578 | } | ||||
| 36579 | if (objIsXray) { | ||||
| 36580 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36581 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36582 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36583 | if (!unwrappedObj.ref()) { | ||||
| 36584 | return false; | ||||
| 36585 | } | ||||
| 36586 | } | ||||
| 36587 | FastErrorResult rv; | ||||
| 36588 | // NOTE: This assert does NOT call the function. | ||||
| 36589 | 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"); | ||||
| 36590 | MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36591 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9" )), 0))) { | ||||
| 36592 | return false; | ||||
| 36593 | } | ||||
| 36594 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36594); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36594; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36595 | args.rval().setUndefined(); | ||||
| 36596 | return true; | ||||
| 36597 | } | ||||
| 36598 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36599 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36600 | if (objIsXray) { | ||||
| 36601 | unwrappedObj.emplace(cx, obj); | ||||
| 36602 | } | ||||
| 36603 | binding_detail::FakeString<char16_t> arg0; | ||||
| 36604 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 36605 | return false; | ||||
| 36606 | } | ||||
| 36607 | if (objIsXray) { | ||||
| 36608 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36609 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36610 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36611 | if (!unwrappedObj.ref()) { | ||||
| 36612 | return false; | ||||
| 36613 | } | ||||
| 36614 | } | ||||
| 36615 | FastErrorResult rv; | ||||
| 36616 | // NOTE: This assert does NOT call the function. | ||||
| 36617 | 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"); | ||||
| 36618 | MOZ_KnownLive(self)(self)->Overload9(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36619 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9" )), 0))) { | ||||
| 36620 | return false; | ||||
| 36621 | } | ||||
| 36622 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36622); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36622; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36623 | args.rval().setUndefined(); | ||||
| 36624 | return true; | ||||
| 36625 | break; | ||||
| 36626 | } | ||||
| 36627 | default: { | ||||
| 36628 | // Using nsPrintfCString here would require including that | ||||
| 36629 | // header. Let's not worry about it. | ||||
| 36630 | nsAutoCString argCountStr; | ||||
| 36631 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36632 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36633 | } | ||||
| 36634 | } | ||||
| 36635 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36635); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36635; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36636 | return false; | ||||
| 36637 | } | ||||
| 36638 | |||||
| 36639 | static const JSJitInfo overload9_methodinfo = { | ||||
| 36640 | { (JSJitGetterOp)overload9 }, | ||||
| 36641 | { prototypes::id::TestJSImplInterface }, | ||||
| 36642 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36643 | JSJitInfo::Method, | ||||
| 36644 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36645 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36646 | false, /* isInfallible. False in setters. */ | ||||
| 36647 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36648 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36649 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36650 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36651 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36652 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36653 | }; | ||||
| 36654 | |||||
| 36655 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36656 | overload10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36657 | { | ||||
| 36658 | BindingCallContext cx(cx_, "TestJSImplInterface.overload10"); | ||||
| 36659 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36662( cx, "TestJSImplInterface" , "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36660 | "TestJSImplInterface", "overload10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36662( cx, "TestJSImplInterface" , "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36661 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36662( cx, "TestJSImplInterface" , "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36662 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36662( cx, "TestJSImplInterface" , "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 36663 | |||||
| 36664 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36665 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36666 | switch (argcount) { | ||||
| 36667 | case 1: { | ||||
| 36668 | if (args[0].isObject()) { | ||||
| 36669 | do { | ||||
| 36670 | JS::Rooted<JSObject*> arg0(cx); | ||||
| 36671 | #ifdef __clang__1 | ||||
| 36672 | #pragma clang diagnostic push | ||||
| 36673 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 36674 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 36675 | #endif // __clang__ | ||||
| 36676 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 36677 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1"); | ||||
| 36678 | return false; | ||||
| 36679 | } | ||||
| 36680 | #ifdef __clang__1 | ||||
| 36681 | #pragma clang diagnostic pop | ||||
| 36682 | #endif // __clang__ | ||||
| 36683 | arg0 = &args[0].toObject(); | ||||
| 36684 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36685 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36686 | if (objIsXray) { | ||||
| 36687 | unwrappedObj.emplace(cx, obj); | ||||
| 36688 | } | ||||
| 36689 | if (objIsXray) { | ||||
| 36690 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36691 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36692 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36693 | if (!unwrappedObj.ref()) { | ||||
| 36694 | return false; | ||||
| 36695 | } | ||||
| 36696 | } | ||||
| 36697 | FastErrorResult rv; | ||||
| 36698 | // NOTE: This assert does NOT call the function. | ||||
| 36699 | 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"); | ||||
| 36700 | MOZ_KnownLive(self)(self)->Overload10(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36701 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10" )), 0))) { | ||||
| 36702 | return false; | ||||
| 36703 | } | ||||
| 36704 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36704); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36704; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36705 | args.rval().setUndefined(); | ||||
| 36706 | return true; | ||||
| 36707 | } while (false); | ||||
| 36708 | } | ||||
| 36709 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36710 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36711 | if (objIsXray) { | ||||
| 36712 | unwrappedObj.emplace(cx, obj); | ||||
| 36713 | } | ||||
| 36714 | Nullable<int32_t> arg0; | ||||
| 36715 | if (args[0].isNullOrUndefined()) { | ||||
| 36716 | arg0.SetNull(); | ||||
| 36717 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 36718 | return false; | ||||
| 36719 | } | ||||
| 36720 | if (objIsXray) { | ||||
| 36721 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36722 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36723 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36724 | if (!unwrappedObj.ref()) { | ||||
| 36725 | return false; | ||||
| 36726 | } | ||||
| 36727 | } | ||||
| 36728 | FastErrorResult rv; | ||||
| 36729 | // NOTE: This assert does NOT call the function. | ||||
| 36730 | 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"); | ||||
| 36731 | MOZ_KnownLive(self)(self)->Overload10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36732 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10" )), 0))) { | ||||
| 36733 | return false; | ||||
| 36734 | } | ||||
| 36735 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36735); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36735; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36736 | args.rval().setUndefined(); | ||||
| 36737 | return true; | ||||
| 36738 | break; | ||||
| 36739 | } | ||||
| 36740 | default: { | ||||
| 36741 | // Using nsPrintfCString here would require including that | ||||
| 36742 | // header. Let's not worry about it. | ||||
| 36743 | nsAutoCString argCountStr; | ||||
| 36744 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36745 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36746 | } | ||||
| 36747 | } | ||||
| 36748 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36748); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36748; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36749 | return false; | ||||
| 36750 | } | ||||
| 36751 | |||||
| 36752 | static const JSJitInfo overload10_methodinfo = { | ||||
| 36753 | { (JSJitGetterOp)overload10 }, | ||||
| 36754 | { prototypes::id::TestJSImplInterface }, | ||||
| 36755 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36756 | JSJitInfo::Method, | ||||
| 36757 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36758 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36759 | false, /* isInfallible. False in setters. */ | ||||
| 36760 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36761 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36762 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36763 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36764 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36765 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36766 | }; | ||||
| 36767 | |||||
| 36768 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36769 | overload11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36770 | { | ||||
| 36771 | BindingCallContext cx(cx_, "TestJSImplInterface.overload11"); | ||||
| 36772 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36775( cx, "TestJSImplInterface" , "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36773 | "TestJSImplInterface", "overload11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36775( cx, "TestJSImplInterface" , "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36774 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36775( cx, "TestJSImplInterface" , "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36775 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36775( cx, "TestJSImplInterface" , "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 36776 | |||||
| 36777 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36778 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36779 | switch (argcount) { | ||||
| 36780 | case 1: { | ||||
| 36781 | if (args[0].isNumber()) { | ||||
| 36782 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36783 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36784 | if (objIsXray) { | ||||
| 36785 | unwrappedObj.emplace(cx, obj); | ||||
| 36786 | } | ||||
| 36787 | int32_t arg0; | ||||
| 36788 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36789 | return false; | ||||
| 36790 | } | ||||
| 36791 | if (objIsXray) { | ||||
| 36792 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36793 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36794 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36795 | if (!unwrappedObj.ref()) { | ||||
| 36796 | return false; | ||||
| 36797 | } | ||||
| 36798 | } | ||||
| 36799 | FastErrorResult rv; | ||||
| 36800 | // NOTE: This assert does NOT call the function. | ||||
| 36801 | 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"); | ||||
| 36802 | MOZ_KnownLive(self)(self)->Overload11(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36803 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11" )), 0))) { | ||||
| 36804 | return false; | ||||
| 36805 | } | ||||
| 36806 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36806); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36806; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36807 | args.rval().setUndefined(); | ||||
| 36808 | return true; | ||||
| 36809 | } | ||||
| 36810 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36811 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36812 | if (objIsXray) { | ||||
| 36813 | unwrappedObj.emplace(cx, obj); | ||||
| 36814 | } | ||||
| 36815 | binding_detail::FakeString<char16_t> arg0; | ||||
| 36816 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | ||||
| 36817 | return false; | ||||
| 36818 | } | ||||
| 36819 | if (objIsXray) { | ||||
| 36820 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36821 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36822 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36823 | if (!unwrappedObj.ref()) { | ||||
| 36824 | return false; | ||||
| 36825 | } | ||||
| 36826 | } | ||||
| 36827 | FastErrorResult rv; | ||||
| 36828 | // NOTE: This assert does NOT call the function. | ||||
| 36829 | 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"); | ||||
| 36830 | MOZ_KnownLive(self)(self)->Overload11(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36831 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11" )), 0))) { | ||||
| 36832 | return false; | ||||
| 36833 | } | ||||
| 36834 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36834); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36834; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36835 | args.rval().setUndefined(); | ||||
| 36836 | return true; | ||||
| 36837 | break; | ||||
| 36838 | } | ||||
| 36839 | default: { | ||||
| 36840 | // Using nsPrintfCString here would require including that | ||||
| 36841 | // header. Let's not worry about it. | ||||
| 36842 | nsAutoCString argCountStr; | ||||
| 36843 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36844 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36845 | } | ||||
| 36846 | } | ||||
| 36847 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36847); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36847; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36848 | return false; | ||||
| 36849 | } | ||||
| 36850 | |||||
| 36851 | static const JSJitInfo overload11_methodinfo = { | ||||
| 36852 | { (JSJitGetterOp)overload11 }, | ||||
| 36853 | { prototypes::id::TestJSImplInterface }, | ||||
| 36854 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36855 | JSJitInfo::Method, | ||||
| 36856 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36857 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36858 | false, /* isInfallible. False in setters. */ | ||||
| 36859 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36860 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36861 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36862 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36863 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36864 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36865 | }; | ||||
| 36866 | |||||
| 36867 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 36868 | overload12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 36869 | { | ||||
| 36870 | BindingCallContext cx(cx_, "TestJSImplInterface.overload12"); | ||||
| 36871 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36874( cx, "TestJSImplInterface" , "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36872 | "TestJSImplInterface", "overload12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36874( cx, "TestJSImplInterface" , "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36873 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36874( cx, "TestJSImplInterface" , "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 36874 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36874( cx, "TestJSImplInterface" , "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 36875 | |||||
| 36876 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 36877 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 36878 | switch (argcount) { | ||||
| 36879 | case 1: { | ||||
| 36880 | if (args[0].isNullOrUndefined()) { | ||||
| 36881 | Nullable<bool> arg0; | ||||
| 36882 | if (args[0].isNullOrUndefined()) { | ||||
| 36883 | arg0.SetNull(); | ||||
| 36884 | } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 36885 | return false; | ||||
| 36886 | } | ||||
| 36887 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36888 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36889 | if (objIsXray) { | ||||
| 36890 | unwrappedObj.emplace(cx, obj); | ||||
| 36891 | } | ||||
| 36892 | if (objIsXray) { | ||||
| 36893 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36894 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36895 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36896 | if (!unwrappedObj.ref()) { | ||||
| 36897 | return false; | ||||
| 36898 | } | ||||
| 36899 | } | ||||
| 36900 | FastErrorResult rv; | ||||
| 36901 | // NOTE: This assert does NOT call the function. | ||||
| 36902 | 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"); | ||||
| 36903 | MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36904 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12" )), 0))) { | ||||
| 36905 | return false; | ||||
| 36906 | } | ||||
| 36907 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36907); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36907; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36908 | args.rval().setUndefined(); | ||||
| 36909 | return true; | ||||
| 36910 | } | ||||
| 36911 | if (args[0].isBoolean()) { | ||||
| 36912 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36913 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36914 | if (objIsXray) { | ||||
| 36915 | unwrappedObj.emplace(cx, obj); | ||||
| 36916 | } | ||||
| 36917 | Nullable<bool> arg0; | ||||
| 36918 | if (args[0].isNullOrUndefined()) { | ||||
| 36919 | arg0.SetNull(); | ||||
| 36920 | } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 36921 | return false; | ||||
| 36922 | } | ||||
| 36923 | if (objIsXray) { | ||||
| 36924 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36925 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36926 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36927 | if (!unwrappedObj.ref()) { | ||||
| 36928 | return false; | ||||
| 36929 | } | ||||
| 36930 | } | ||||
| 36931 | FastErrorResult rv; | ||||
| 36932 | // NOTE: This assert does NOT call the function. | ||||
| 36933 | 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"); | ||||
| 36934 | MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36935 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12" )), 0))) { | ||||
| 36936 | return false; | ||||
| 36937 | } | ||||
| 36938 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36938); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36938; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36939 | args.rval().setUndefined(); | ||||
| 36940 | return true; | ||||
| 36941 | } | ||||
| 36942 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 36943 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 36944 | if (objIsXray) { | ||||
| 36945 | unwrappedObj.emplace(cx, obj); | ||||
| 36946 | } | ||||
| 36947 | int32_t arg0; | ||||
| 36948 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 36949 | return false; | ||||
| 36950 | } | ||||
| 36951 | if (objIsXray) { | ||||
| 36952 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 36953 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 36954 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 36955 | if (!unwrappedObj.ref()) { | ||||
| 36956 | return false; | ||||
| 36957 | } | ||||
| 36958 | } | ||||
| 36959 | FastErrorResult rv; | ||||
| 36960 | // NOTE: This assert does NOT call the function. | ||||
| 36961 | 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"); | ||||
| 36962 | MOZ_KnownLive(self)(self)->Overload12(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 36963 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12" )), 0))) { | ||||
| 36964 | return false; | ||||
| 36965 | } | ||||
| 36966 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 36966); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 36966; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 36967 | args.rval().setUndefined(); | ||||
| 36968 | return true; | ||||
| 36969 | break; | ||||
| 36970 | } | ||||
| 36971 | default: { | ||||
| 36972 | // Using nsPrintfCString here would require including that | ||||
| 36973 | // header. Let's not worry about it. | ||||
| 36974 | nsAutoCString argCountStr; | ||||
| 36975 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 36976 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 36977 | } | ||||
| 36978 | } | ||||
| 36979 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 36979); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 36979; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 36980 | return false; | ||||
| 36981 | } | ||||
| 36982 | |||||
| 36983 | static const JSJitInfo overload12_methodinfo = { | ||||
| 36984 | { (JSJitGetterOp)overload12 }, | ||||
| 36985 | { prototypes::id::TestJSImplInterface }, | ||||
| 36986 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 36987 | JSJitInfo::Method, | ||||
| 36988 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 36989 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 36990 | false, /* isInfallible. False in setters. */ | ||||
| 36991 | false, /* isMovable. Not relevant for setters. */ | ||||
| 36992 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 36993 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 36994 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 36995 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 36996 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 36997 | }; | ||||
| 36998 | |||||
| 36999 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37000 | overload13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37001 | { | ||||
| 37002 | BindingCallContext cx(cx_, "TestJSImplInterface.overload13"); | ||||
| 37003 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37006( cx, "TestJSImplInterface" , "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37004 | "TestJSImplInterface", "overload13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37006( cx, "TestJSImplInterface" , "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37005 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37006( cx, "TestJSImplInterface" , "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37006 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37006( cx, "TestJSImplInterface" , "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37007 | |||||
| 37008 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37009 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37010 | switch (argcount) { | ||||
| 37011 | case 1: { | ||||
| 37012 | if (args[0].isBoolean()) { | ||||
| 37013 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37014 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37015 | if (objIsXray) { | ||||
| 37016 | unwrappedObj.emplace(cx, obj); | ||||
| 37017 | } | ||||
| 37018 | bool arg0; | ||||
| 37019 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 37020 | return false; | ||||
| 37021 | } | ||||
| 37022 | if (objIsXray) { | ||||
| 37023 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37024 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37025 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37026 | if (!unwrappedObj.ref()) { | ||||
| 37027 | return false; | ||||
| 37028 | } | ||||
| 37029 | } | ||||
| 37030 | FastErrorResult rv; | ||||
| 37031 | // NOTE: This assert does NOT call the function. | ||||
| 37032 | 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"); | ||||
| 37033 | MOZ_KnownLive(self)(self)->Overload13(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37034 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13" )), 0))) { | ||||
| 37035 | return false; | ||||
| 37036 | } | ||||
| 37037 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37037; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37038 | args.rval().setUndefined(); | ||||
| 37039 | return true; | ||||
| 37040 | } | ||||
| 37041 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37042 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37043 | if (objIsXray) { | ||||
| 37044 | unwrappedObj.emplace(cx, obj); | ||||
| 37045 | } | ||||
| 37046 | Nullable<int32_t> arg0; | ||||
| 37047 | if (args[0].isNullOrUndefined()) { | ||||
| 37048 | arg0.SetNull(); | ||||
| 37049 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | ||||
| 37050 | return false; | ||||
| 37051 | } | ||||
| 37052 | if (objIsXray) { | ||||
| 37053 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37054 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37055 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37056 | if (!unwrappedObj.ref()) { | ||||
| 37057 | return false; | ||||
| 37058 | } | ||||
| 37059 | } | ||||
| 37060 | FastErrorResult rv; | ||||
| 37061 | // NOTE: This assert does NOT call the function. | ||||
| 37062 | 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"); | ||||
| 37063 | MOZ_KnownLive(self)(self)->Overload13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37064 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13" )), 0))) { | ||||
| 37065 | return false; | ||||
| 37066 | } | ||||
| 37067 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37067); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37067; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37068 | args.rval().setUndefined(); | ||||
| 37069 | return true; | ||||
| 37070 | break; | ||||
| 37071 | } | ||||
| 37072 | default: { | ||||
| 37073 | // Using nsPrintfCString here would require including that | ||||
| 37074 | // header. Let's not worry about it. | ||||
| 37075 | nsAutoCString argCountStr; | ||||
| 37076 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37077 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37078 | } | ||||
| 37079 | } | ||||
| 37080 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37080); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37080; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37081 | return false; | ||||
| 37082 | } | ||||
| 37083 | |||||
| 37084 | static const JSJitInfo overload13_methodinfo = { | ||||
| 37085 | { (JSJitGetterOp)overload13 }, | ||||
| 37086 | { prototypes::id::TestJSImplInterface }, | ||||
| 37087 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37088 | JSJitInfo::Method, | ||||
| 37089 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37090 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 37091 | false, /* isInfallible. False in setters. */ | ||||
| 37092 | false, /* isMovable. Not relevant for setters. */ | ||||
| 37093 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 37094 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 37095 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 37096 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 37097 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 37098 | }; | ||||
| 37099 | |||||
| 37100 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37101 | overload14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37102 | { | ||||
| 37103 | BindingCallContext cx(cx_, "TestJSImplInterface.overload14"); | ||||
| 37104 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37107( cx, "TestJSImplInterface" , "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37105 | "TestJSImplInterface", "overload14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37107( cx, "TestJSImplInterface" , "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37106 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37107( cx, "TestJSImplInterface" , "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37107 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37107( cx, "TestJSImplInterface" , "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37108 | |||||
| 37109 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37110 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37111 | switch (argcount) { | ||||
| 37112 | case 0: { | ||||
| 37113 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37114 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37115 | if (objIsXray) { | ||||
| 37116 | unwrappedObj.emplace(cx, obj); | ||||
| 37117 | } | ||||
| 37118 | Optional<int32_t> arg0; | ||||
| 37119 | if (args.hasDefined(0)) { | ||||
| 37120 | arg0.Construct(); | ||||
| 37121 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | ||||
| 37122 | return false; | ||||
| 37123 | } | ||||
| 37124 | } | ||||
| 37125 | if (objIsXray) { | ||||
| 37126 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37127 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37128 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37129 | if (!unwrappedObj.ref()) { | ||||
| 37130 | return false; | ||||
| 37131 | } | ||||
| 37132 | } | ||||
| 37133 | FastErrorResult rv; | ||||
| 37134 | // NOTE: This assert does NOT call the function. | ||||
| 37135 | 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"); | ||||
| 37136 | MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37137 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14" )), 0))) { | ||||
| 37138 | return false; | ||||
| 37139 | } | ||||
| 37140 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37140); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37140; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37141 | args.rval().setUndefined(); | ||||
| 37142 | return true; | ||||
| 37143 | break; | ||||
| 37144 | } | ||||
| 37145 | case 1: { | ||||
| 37146 | if (args[0].isObject()) { | ||||
| 37147 | do { | ||||
| 37148 | NonNull<mozilla::dom::TestInterface> arg0; | ||||
| 37149 | { | ||||
| 37150 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37151 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | ||||
| 37152 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37153 | break; | ||||
| 37154 | } | ||||
| 37155 | } | ||||
| 37156 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37157 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37158 | if (objIsXray) { | ||||
| 37159 | unwrappedObj.emplace(cx, obj); | ||||
| 37160 | } | ||||
| 37161 | if (objIsXray) { | ||||
| 37162 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37163 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37164 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37165 | if (!unwrappedObj.ref()) { | ||||
| 37166 | return false; | ||||
| 37167 | } | ||||
| 37168 | } | ||||
| 37169 | FastErrorResult rv; | ||||
| 37170 | // NOTE: This assert does NOT call the function. | ||||
| 37171 | 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"); | ||||
| 37172 | MOZ_KnownLive(self)(self)->Overload14(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37173 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14" )), 0))) { | ||||
| 37174 | return false; | ||||
| 37175 | } | ||||
| 37176 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37176); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37176; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37177 | args.rval().setUndefined(); | ||||
| 37178 | return true; | ||||
| 37179 | } while (false); | ||||
| 37180 | } | ||||
| 37181 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37182 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37183 | if (objIsXray) { | ||||
| 37184 | unwrappedObj.emplace(cx, obj); | ||||
| 37185 | } | ||||
| 37186 | Optional<int32_t> arg0; | ||||
| 37187 | if (args.hasDefined(0)) { | ||||
| 37188 | arg0.Construct(); | ||||
| 37189 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | ||||
| 37190 | return false; | ||||
| 37191 | } | ||||
| 37192 | } | ||||
| 37193 | if (objIsXray) { | ||||
| 37194 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37195 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37196 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37197 | if (!unwrappedObj.ref()) { | ||||
| 37198 | return false; | ||||
| 37199 | } | ||||
| 37200 | } | ||||
| 37201 | FastErrorResult rv; | ||||
| 37202 | // NOTE: This assert does NOT call the function. | ||||
| 37203 | 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"); | ||||
| 37204 | MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37205 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14" )), 0))) { | ||||
| 37206 | return false; | ||||
| 37207 | } | ||||
| 37208 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37208); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37208; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37209 | args.rval().setUndefined(); | ||||
| 37210 | return true; | ||||
| 37211 | break; | ||||
| 37212 | } | ||||
| 37213 | default: { | ||||
| 37214 | // Using nsPrintfCString here would require including that | ||||
| 37215 | // header. Let's not worry about it. | ||||
| 37216 | nsAutoCString argCountStr; | ||||
| 37217 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37218 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37219 | } | ||||
| 37220 | } | ||||
| 37221 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37221); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37221; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37222 | return false; | ||||
| 37223 | } | ||||
| 37224 | |||||
| 37225 | static const JSJitInfo overload14_methodinfo = { | ||||
| 37226 | { (JSJitGetterOp)overload14 }, | ||||
| 37227 | { prototypes::id::TestJSImplInterface }, | ||||
| 37228 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37229 | JSJitInfo::Method, | ||||
| 37230 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37231 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 37232 | false, /* isInfallible. False in setters. */ | ||||
| 37233 | false, /* isMovable. Not relevant for setters. */ | ||||
| 37234 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 37235 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 37236 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 37237 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 37238 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 37239 | }; | ||||
| 37240 | |||||
| 37241 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37242 | overload15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37243 | { | ||||
| 37244 | BindingCallContext cx(cx_, "TestJSImplInterface.overload15"); | ||||
| 37245 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37248( cx, "TestJSImplInterface" , "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37246 | "TestJSImplInterface", "overload15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37248( cx, "TestJSImplInterface" , "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37247 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37248( cx, "TestJSImplInterface" , "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37248 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37248( cx, "TestJSImplInterface" , "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37249 | |||||
| 37250 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37251 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37252 | switch (argcount) { | ||||
| 37253 | case 0: { | ||||
| 37254 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37255 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37256 | if (objIsXray) { | ||||
| 37257 | unwrappedObj.emplace(cx, obj); | ||||
| 37258 | } | ||||
| 37259 | Optional<NonNull<mozilla::dom::TestInterface>> arg0; | ||||
| 37260 | if (args.hasDefined(0)) { | ||||
| 37261 | arg0.Construct(); | ||||
| 37262 | if (args[0].isObject()) { | ||||
| 37263 | { | ||||
| 37264 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37265 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | ||||
| 37266 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37267 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | ||||
| 37268 | return false; | ||||
| 37269 | } | ||||
| 37270 | } | ||||
| 37271 | } else { | ||||
| 37272 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 37273 | return false; | ||||
| 37274 | } | ||||
| 37275 | } | ||||
| 37276 | if (objIsXray) { | ||||
| 37277 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37278 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37279 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37280 | if (!unwrappedObj.ref()) { | ||||
| 37281 | return false; | ||||
| 37282 | } | ||||
| 37283 | } | ||||
| 37284 | FastErrorResult rv; | ||||
| 37285 | // NOTE: This assert does NOT call the function. | ||||
| 37286 | 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"); | ||||
| 37287 | MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37288 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15" )), 0))) { | ||||
| 37289 | return false; | ||||
| 37290 | } | ||||
| 37291 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37291); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37291; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37292 | args.rval().setUndefined(); | ||||
| 37293 | return true; | ||||
| 37294 | break; | ||||
| 37295 | } | ||||
| 37296 | case 1: { | ||||
| 37297 | if (args[0].isUndefined()) { | ||||
| 37298 | Optional<NonNull<mozilla::dom::TestInterface>> arg0; | ||||
| 37299 | if (args.hasDefined(0)) { | ||||
| 37300 | arg0.Construct(); | ||||
| 37301 | if (args[0].isObject()) { | ||||
| 37302 | { | ||||
| 37303 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37304 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | ||||
| 37305 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37306 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | ||||
| 37307 | return false; | ||||
| 37308 | } | ||||
| 37309 | } | ||||
| 37310 | } else { | ||||
| 37311 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 37312 | return false; | ||||
| 37313 | } | ||||
| 37314 | } | ||||
| 37315 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37316 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37317 | if (objIsXray) { | ||||
| 37318 | unwrappedObj.emplace(cx, obj); | ||||
| 37319 | } | ||||
| 37320 | if (objIsXray) { | ||||
| 37321 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37322 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37323 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37324 | if (!unwrappedObj.ref()) { | ||||
| 37325 | return false; | ||||
| 37326 | } | ||||
| 37327 | } | ||||
| 37328 | FastErrorResult rv; | ||||
| 37329 | // NOTE: This assert does NOT call the function. | ||||
| 37330 | 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"); | ||||
| 37331 | MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37332 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15" )), 0))) { | ||||
| 37333 | return false; | ||||
| 37334 | } | ||||
| 37335 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37335); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37335; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37336 | args.rval().setUndefined(); | ||||
| 37337 | return true; | ||||
| 37338 | } | ||||
| 37339 | if (args[0].isObject()) { | ||||
| 37340 | do { | ||||
| 37341 | Optional<NonNull<mozilla::dom::TestInterface>> arg0; | ||||
| 37342 | if (args.hasDefined(0)) { | ||||
| 37343 | arg0.Construct(); | ||||
| 37344 | { | ||||
| 37345 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37346 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | ||||
| 37347 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37348 | break; | ||||
| 37349 | } | ||||
| 37350 | } | ||||
| 37351 | } | ||||
| 37352 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37353 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37354 | if (objIsXray) { | ||||
| 37355 | unwrappedObj.emplace(cx, obj); | ||||
| 37356 | } | ||||
| 37357 | if (objIsXray) { | ||||
| 37358 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37359 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37360 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37361 | if (!unwrappedObj.ref()) { | ||||
| 37362 | return false; | ||||
| 37363 | } | ||||
| 37364 | } | ||||
| 37365 | FastErrorResult rv; | ||||
| 37366 | // NOTE: This assert does NOT call the function. | ||||
| 37367 | 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"); | ||||
| 37368 | MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37369 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15" )), 0))) { | ||||
| 37370 | return false; | ||||
| 37371 | } | ||||
| 37372 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37372); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37372; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37373 | args.rval().setUndefined(); | ||||
| 37374 | return true; | ||||
| 37375 | } while (false); | ||||
| 37376 | } | ||||
| 37377 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37378 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37379 | if (objIsXray) { | ||||
| 37380 | unwrappedObj.emplace(cx, obj); | ||||
| 37381 | } | ||||
| 37382 | int32_t arg0; | ||||
| 37383 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 37384 | return false; | ||||
| 37385 | } | ||||
| 37386 | if (objIsXray) { | ||||
| 37387 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37388 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37389 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37390 | if (!unwrappedObj.ref()) { | ||||
| 37391 | return false; | ||||
| 37392 | } | ||||
| 37393 | } | ||||
| 37394 | FastErrorResult rv; | ||||
| 37395 | // NOTE: This assert does NOT call the function. | ||||
| 37396 | 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"); | ||||
| 37397 | MOZ_KnownLive(self)(self)->Overload15(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37398 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15" )), 0))) { | ||||
| 37399 | return false; | ||||
| 37400 | } | ||||
| 37401 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37401); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37401; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37402 | args.rval().setUndefined(); | ||||
| 37403 | return true; | ||||
| 37404 | break; | ||||
| 37405 | } | ||||
| 37406 | default: { | ||||
| 37407 | // Using nsPrintfCString here would require including that | ||||
| 37408 | // header. Let's not worry about it. | ||||
| 37409 | nsAutoCString argCountStr; | ||||
| 37410 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37411 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37412 | } | ||||
| 37413 | } | ||||
| 37414 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37414); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37414; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37415 | return false; | ||||
| 37416 | } | ||||
| 37417 | |||||
| 37418 | static const JSJitInfo overload15_methodinfo = { | ||||
| 37419 | { (JSJitGetterOp)overload15 }, | ||||
| 37420 | { prototypes::id::TestJSImplInterface }, | ||||
| 37421 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37422 | JSJitInfo::Method, | ||||
| 37423 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37424 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 37425 | false, /* isInfallible. False in setters. */ | ||||
| 37426 | false, /* isMovable. Not relevant for setters. */ | ||||
| 37427 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 37428 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 37429 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 37430 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 37431 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 37432 | }; | ||||
| 37433 | |||||
| 37434 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37435 | overload16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37436 | { | ||||
| 37437 | BindingCallContext cx(cx_, "TestJSImplInterface.overload16"); | ||||
| 37438 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37441( cx, "TestJSImplInterface" , "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37439 | "TestJSImplInterface", "overload16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37441( cx, "TestJSImplInterface" , "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37440 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37441( cx, "TestJSImplInterface" , "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37441 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37441( cx, "TestJSImplInterface" , "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37442 | |||||
| 37443 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37444 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37445 | switch (argcount) { | ||||
| 37446 | case 0: { | ||||
| 37447 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37448 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37449 | if (objIsXray) { | ||||
| 37450 | unwrappedObj.emplace(cx, obj); | ||||
| 37451 | } | ||||
| 37452 | Optional<mozilla::dom::TestInterface*> arg0; | ||||
| 37453 | if (args.hasDefined(0)) { | ||||
| 37454 | arg0.Construct(); | ||||
| 37455 | if (args[0].isObject()) { | ||||
| 37456 | { | ||||
| 37457 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37458 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | ||||
| 37459 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37460 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | ||||
| 37461 | return false; | ||||
| 37462 | } | ||||
| 37463 | } | ||||
| 37464 | } else if (args[0].isNullOrUndefined()) { | ||||
| 37465 | arg0.Value() = nullptr; | ||||
| 37466 | } else { | ||||
| 37467 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 37468 | return false; | ||||
| 37469 | } | ||||
| 37470 | } | ||||
| 37471 | if (objIsXray) { | ||||
| 37472 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37473 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37474 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37475 | if (!unwrappedObj.ref()) { | ||||
| 37476 | return false; | ||||
| 37477 | } | ||||
| 37478 | } | ||||
| 37479 | FastErrorResult rv; | ||||
| 37480 | // NOTE: This assert does NOT call the function. | ||||
| 37481 | 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"); | ||||
| 37482 | MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37483 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16" )), 0))) { | ||||
| 37484 | return false; | ||||
| 37485 | } | ||||
| 37486 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37486); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37486; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37487 | args.rval().setUndefined(); | ||||
| 37488 | return true; | ||||
| 37489 | break; | ||||
| 37490 | } | ||||
| 37491 | case 1: { | ||||
| 37492 | if (args[0].isNullOrUndefined()) { | ||||
| 37493 | Optional<mozilla::dom::TestInterface*> arg0; | ||||
| 37494 | if (args.hasDefined(0)) { | ||||
| 37495 | arg0.Construct(); | ||||
| 37496 | arg0.Value() = nullptr; | ||||
| 37497 | } | ||||
| 37498 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37499 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37500 | if (objIsXray) { | ||||
| 37501 | unwrappedObj.emplace(cx, obj); | ||||
| 37502 | } | ||||
| 37503 | if (objIsXray) { | ||||
| 37504 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37505 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37506 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37507 | if (!unwrappedObj.ref()) { | ||||
| 37508 | return false; | ||||
| 37509 | } | ||||
| 37510 | } | ||||
| 37511 | FastErrorResult rv; | ||||
| 37512 | // NOTE: This assert does NOT call the function. | ||||
| 37513 | 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"); | ||||
| 37514 | MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37515 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16" )), 0))) { | ||||
| 37516 | return false; | ||||
| 37517 | } | ||||
| 37518 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37518); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37518; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37519 | args.rval().setUndefined(); | ||||
| 37520 | return true; | ||||
| 37521 | } | ||||
| 37522 | if (args[0].isObject()) { | ||||
| 37523 | do { | ||||
| 37524 | Optional<mozilla::dom::TestInterface*> arg0; | ||||
| 37525 | if (args.hasDefined(0)) { | ||||
| 37526 | arg0.Construct(); | ||||
| 37527 | { | ||||
| 37528 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 37529 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | ||||
| 37530 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 37531 | break; | ||||
| 37532 | } | ||||
| 37533 | } | ||||
| 37534 | } | ||||
| 37535 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37536 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37537 | if (objIsXray) { | ||||
| 37538 | unwrappedObj.emplace(cx, obj); | ||||
| 37539 | } | ||||
| 37540 | if (objIsXray) { | ||||
| 37541 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37542 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37543 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37544 | if (!unwrappedObj.ref()) { | ||||
| 37545 | return false; | ||||
| 37546 | } | ||||
| 37547 | } | ||||
| 37548 | FastErrorResult rv; | ||||
| 37549 | // NOTE: This assert does NOT call the function. | ||||
| 37550 | 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"); | ||||
| 37551 | MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37552 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16" )), 0))) { | ||||
| 37553 | return false; | ||||
| 37554 | } | ||||
| 37555 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37555); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37555; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37556 | args.rval().setUndefined(); | ||||
| 37557 | return true; | ||||
| 37558 | } while (false); | ||||
| 37559 | } | ||||
| 37560 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37561 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37562 | if (objIsXray) { | ||||
| 37563 | unwrappedObj.emplace(cx, obj); | ||||
| 37564 | } | ||||
| 37565 | int32_t arg0; | ||||
| 37566 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | ||||
| 37567 | return false; | ||||
| 37568 | } | ||||
| 37569 | if (objIsXray) { | ||||
| 37570 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37571 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37572 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37573 | if (!unwrappedObj.ref()) { | ||||
| 37574 | return false; | ||||
| 37575 | } | ||||
| 37576 | } | ||||
| 37577 | FastErrorResult rv; | ||||
| 37578 | // NOTE: This assert does NOT call the function. | ||||
| 37579 | 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"); | ||||
| 37580 | MOZ_KnownLive(self)(self)->Overload16(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37581 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16" )), 0))) { | ||||
| 37582 | return false; | ||||
| 37583 | } | ||||
| 37584 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37584); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37584; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37585 | args.rval().setUndefined(); | ||||
| 37586 | return true; | ||||
| 37587 | break; | ||||
| 37588 | } | ||||
| 37589 | default: { | ||||
| 37590 | // Using nsPrintfCString here would require including that | ||||
| 37591 | // header. Let's not worry about it. | ||||
| 37592 | nsAutoCString argCountStr; | ||||
| 37593 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37594 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37595 | } | ||||
| 37596 | } | ||||
| 37597 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37597); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37597; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37598 | return false; | ||||
| 37599 | } | ||||
| 37600 | |||||
| 37601 | static const JSJitInfo overload16_methodinfo = { | ||||
| 37602 | { (JSJitGetterOp)overload16 }, | ||||
| 37603 | { prototypes::id::TestJSImplInterface }, | ||||
| 37604 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37605 | JSJitInfo::Method, | ||||
| 37606 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37607 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 37608 | false, /* isInfallible. False in setters. */ | ||||
| 37609 | false, /* isMovable. Not relevant for setters. */ | ||||
| 37610 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 37611 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 37612 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 37613 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 37614 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 37615 | }; | ||||
| 37616 | |||||
| 37617 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37618 | overload17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37619 | { | ||||
| 37620 | BindingCallContext cx(cx_, "TestJSImplInterface.overload17"); | ||||
| 37621 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37624( cx, "TestJSImplInterface" , "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37622 | "TestJSImplInterface", "overload17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37624( cx, "TestJSImplInterface" , "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37623 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37624( cx, "TestJSImplInterface" , "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37624 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37624( cx, "TestJSImplInterface" , "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37625 | |||||
| 37626 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37627 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37628 | switch (argcount) { | ||||
| 37629 | case 1: { | ||||
| 37630 | if (args[0].isObject()) { | ||||
| 37631 | do { | ||||
| 37632 | binding_detail::AutoSequence<int32_t> arg0; | ||||
| 37633 | JS::ForOfIterator iter(cx); | ||||
| 37634 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 37635 | return false; | ||||
| 37636 | } | ||||
| 37637 | if (!iter.valueIsIterable()) { | ||||
| 37638 | break; | ||||
| 37639 | } | ||||
| 37640 | binding_detail::AutoSequence<int32_t> &arr = arg0; | ||||
| 37641 | JS::Rooted<JS::Value> temp(cx); | ||||
| 37642 | while (true) { | ||||
| 37643 | bool done; | ||||
| 37644 | if (!iter.next(&temp, &done)) { | ||||
| 37645 | return false; | ||||
| 37646 | } | ||||
| 37647 | if (done) { | ||||
| 37648 | break; | ||||
| 37649 | } | ||||
| 37650 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 37651 | if (!slotPtr) { | ||||
| 37652 | JS_ReportOutOfMemory(cx); | ||||
| 37653 | return false; | ||||
| 37654 | } | ||||
| 37655 | int32_t& slot = *slotPtr; | ||||
| 37656 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | ||||
| 37657 | return false; | ||||
| 37658 | } | ||||
| 37659 | } | ||||
| 37660 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37661 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37662 | if (objIsXray) { | ||||
| 37663 | unwrappedObj.emplace(cx, obj); | ||||
| 37664 | } | ||||
| 37665 | if (objIsXray) { | ||||
| 37666 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37667 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37668 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37669 | if (!unwrappedObj.ref()) { | ||||
| 37670 | return false; | ||||
| 37671 | } | ||||
| 37672 | } | ||||
| 37673 | FastErrorResult rv; | ||||
| 37674 | // NOTE: This assert does NOT call the function. | ||||
| 37675 | 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"); | ||||
| 37676 | MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37677 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17" )), 0))) { | ||||
| 37678 | return false; | ||||
| 37679 | } | ||||
| 37680 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37680); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37680; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37681 | args.rval().setUndefined(); | ||||
| 37682 | return true; | ||||
| 37683 | } while (false); | ||||
| 37684 | do { | ||||
| 37685 | Record<nsString, int32_t> arg0; | ||||
| 37686 | auto& recordEntries = arg0.Entries(); | ||||
| 37687 | |||||
| 37688 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 37689 | JS::RootedVector<jsid> ids(cx); | ||||
| 37690 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 37691 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 37692 | return false; | ||||
| 37693 | } | ||||
| 37694 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 37695 | JS_ReportOutOfMemory(cx); | ||||
| 37696 | return false; | ||||
| 37697 | } | ||||
| 37698 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 37699 | JS::Rooted<JS::Value> temp(cx); | ||||
| 37700 | JS::Rooted<jsid> curId(cx); | ||||
| 37701 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 37702 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 37703 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 37704 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 37705 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 37706 | // around. | ||||
| 37707 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 37708 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 37709 | curId = ids[i]; | ||||
| 37710 | |||||
| 37711 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 37712 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 37713 | &desc)) { | ||||
| 37714 | return false; | ||||
| 37715 | } | ||||
| 37716 | |||||
| 37717 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 37718 | continue; | ||||
| 37719 | } | ||||
| 37720 | |||||
| 37721 | idVal = js::IdToValue(curId); | ||||
| 37722 | nsString propName; | ||||
| 37723 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 37724 | // to do. | ||||
| 37725 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 37726 | return false; | ||||
| 37727 | } | ||||
| 37728 | |||||
| 37729 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 37730 | return false; | ||||
| 37731 | } | ||||
| 37732 | |||||
| 37733 | Record<nsString, int32_t>::EntryType* entry; | ||||
| 37734 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 37735 | // Find the existing entry. | ||||
| 37736 | auto idx = recordEntries.IndexOf(propName); | ||||
| 37737 | 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", 37738); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 37738; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 37738 | "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", 37738); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 37738; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 37739 | // Now blow it away to make it look like it was just added | ||||
| 37740 | // to the array, because it's not obvious that it's | ||||
| 37741 | // safe to write to its already-initialized mValue via our | ||||
| 37742 | // normal codegen conversions. For example, the value | ||||
| 37743 | // could be a union and this would change its type, but | ||||
| 37744 | // codegen assumes we won't do that. | ||||
| 37745 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 37746 | } else { | ||||
| 37747 | // Safe to do an infallible append here, because we did a | ||||
| 37748 | // SetCapacity above to the right capacity. | ||||
| 37749 | entry = recordEntries.AppendElement(); | ||||
| 37750 | } | ||||
| 37751 | entry->mKey = propName; | ||||
| 37752 | int32_t& slot = entry->mValue; | ||||
| 37753 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | ||||
| 37754 | return false; | ||||
| 37755 | } | ||||
| 37756 | } | ||||
| 37757 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37758 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37759 | if (objIsXray) { | ||||
| 37760 | unwrappedObj.emplace(cx, obj); | ||||
| 37761 | } | ||||
| 37762 | if (objIsXray) { | ||||
| 37763 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37764 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37765 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37766 | if (!unwrappedObj.ref()) { | ||||
| 37767 | return false; | ||||
| 37768 | } | ||||
| 37769 | } | ||||
| 37770 | FastErrorResult rv; | ||||
| 37771 | // NOTE: This assert does NOT call the function. | ||||
| 37772 | 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"); | ||||
| 37773 | MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37774 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17" )), 0))) { | ||||
| 37775 | return false; | ||||
| 37776 | } | ||||
| 37777 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37777); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37777; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37778 | args.rval().setUndefined(); | ||||
| 37779 | return true; | ||||
| 37780 | } while (false); | ||||
| 37781 | } | ||||
| 37782 | return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1"); | ||||
| 37783 | break; | ||||
| 37784 | } | ||||
| 37785 | default: { | ||||
| 37786 | // Using nsPrintfCString here would require including that | ||||
| 37787 | // header. Let's not worry about it. | ||||
| 37788 | nsAutoCString argCountStr; | ||||
| 37789 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37790 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37791 | } | ||||
| 37792 | } | ||||
| 37793 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37793); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37793; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37794 | return false; | ||||
| 37795 | } | ||||
| 37796 | |||||
| 37797 | static const JSJitInfo overload17_methodinfo = { | ||||
| 37798 | { (JSJitGetterOp)overload17 }, | ||||
| 37799 | { prototypes::id::TestJSImplInterface }, | ||||
| 37800 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37801 | JSJitInfo::Method, | ||||
| 37802 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37803 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 37804 | false, /* isInfallible. False in setters. */ | ||||
| 37805 | false, /* isMovable. Not relevant for setters. */ | ||||
| 37806 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 37807 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 37808 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 37809 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 37810 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 37811 | }; | ||||
| 37812 | |||||
| 37813 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 37814 | overload18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 37815 | { | ||||
| 37816 | BindingCallContext cx(cx_, "TestJSImplInterface.overload18"); | ||||
| 37817 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37820( cx, "TestJSImplInterface" , "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37818 | "TestJSImplInterface", "overload18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37820( cx, "TestJSImplInterface" , "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37819 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37820( cx, "TestJSImplInterface" , "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 37820 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37820( cx, "TestJSImplInterface" , "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 37821 | |||||
| 37822 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 37823 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 37824 | switch (argcount) { | ||||
| 37825 | case 1: { | ||||
| 37826 | if (args[0].isObject()) { | ||||
| 37827 | do { | ||||
| 37828 | binding_detail::AutoSequence<nsString> arg0; | ||||
| 37829 | JS::ForOfIterator iter(cx); | ||||
| 37830 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 37831 | return false; | ||||
| 37832 | } | ||||
| 37833 | if (!iter.valueIsIterable()) { | ||||
| 37834 | break; | ||||
| 37835 | } | ||||
| 37836 | binding_detail::AutoSequence<nsString> &arr = arg0; | ||||
| 37837 | JS::Rooted<JS::Value> temp(cx); | ||||
| 37838 | while (true) { | ||||
| 37839 | bool done; | ||||
| 37840 | if (!iter.next(&temp, &done)) { | ||||
| 37841 | return false; | ||||
| 37842 | } | ||||
| 37843 | if (done) { | ||||
| 37844 | break; | ||||
| 37845 | } | ||||
| 37846 | nsString* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 37847 | if (!slotPtr) { | ||||
| 37848 | JS_ReportOutOfMemory(cx); | ||||
| 37849 | return false; | ||||
| 37850 | } | ||||
| 37851 | nsString& slot = *slotPtr; | ||||
| 37852 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | ||||
| 37853 | return false; | ||||
| 37854 | } | ||||
| 37855 | } | ||||
| 37856 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37857 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37858 | if (objIsXray) { | ||||
| 37859 | unwrappedObj.emplace(cx, obj); | ||||
| 37860 | } | ||||
| 37861 | if (objIsXray) { | ||||
| 37862 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37863 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37864 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37865 | if (!unwrappedObj.ref()) { | ||||
| 37866 | return false; | ||||
| 37867 | } | ||||
| 37868 | } | ||||
| 37869 | FastErrorResult rv; | ||||
| 37870 | // NOTE: This assert does NOT call the function. | ||||
| 37871 | 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"); | ||||
| 37872 | MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37873 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18" )), 0))) { | ||||
| 37874 | return false; | ||||
| 37875 | } | ||||
| 37876 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37876); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37876; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37877 | args.rval().setUndefined(); | ||||
| 37878 | return true; | ||||
| 37879 | } while (false); | ||||
| 37880 | do { | ||||
| 37881 | Record<nsString, nsString> arg0; | ||||
| 37882 | auto& recordEntries = arg0.Entries(); | ||||
| 37883 | |||||
| 37884 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | ||||
| 37885 | JS::RootedVector<jsid> ids(cx); | ||||
| 37886 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 37887 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 37888 | return false; | ||||
| 37889 | } | ||||
| 37890 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 37891 | JS_ReportOutOfMemory(cx); | ||||
| 37892 | return false; | ||||
| 37893 | } | ||||
| 37894 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 37895 | JS::Rooted<JS::Value> temp(cx); | ||||
| 37896 | JS::Rooted<jsid> curId(cx); | ||||
| 37897 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 37898 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 37899 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 37900 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 37901 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 37902 | // around. | ||||
| 37903 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 37904 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 37905 | curId = ids[i]; | ||||
| 37906 | |||||
| 37907 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 37908 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 37909 | &desc)) { | ||||
| 37910 | return false; | ||||
| 37911 | } | ||||
| 37912 | |||||
| 37913 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 37914 | continue; | ||||
| 37915 | } | ||||
| 37916 | |||||
| 37917 | idVal = js::IdToValue(curId); | ||||
| 37918 | nsString propName; | ||||
| 37919 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 37920 | // to do. | ||||
| 37921 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | ||||
| 37922 | return false; | ||||
| 37923 | } | ||||
| 37924 | |||||
| 37925 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 37926 | return false; | ||||
| 37927 | } | ||||
| 37928 | |||||
| 37929 | Record<nsString, nsString>::EntryType* entry; | ||||
| 37930 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 37931 | // Find the existing entry. | ||||
| 37932 | auto idx = recordEntries.IndexOf(propName); | ||||
| 37933 | 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", 37934); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 37934; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 37934 | "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", 37934); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 37934; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 37935 | // Now blow it away to make it look like it was just added | ||||
| 37936 | // to the array, because it's not obvious that it's | ||||
| 37937 | // safe to write to its already-initialized mValue via our | ||||
| 37938 | // normal codegen conversions. For example, the value | ||||
| 37939 | // could be a union and this would change its type, but | ||||
| 37940 | // codegen assumes we won't do that. | ||||
| 37941 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 37942 | } else { | ||||
| 37943 | // Safe to do an infallible append here, because we did a | ||||
| 37944 | // SetCapacity above to the right capacity. | ||||
| 37945 | entry = recordEntries.AppendElement(); | ||||
| 37946 | } | ||||
| 37947 | entry->mKey = propName; | ||||
| 37948 | nsString& slot = entry->mValue; | ||||
| 37949 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | ||||
| 37950 | return false; | ||||
| 37951 | } | ||||
| 37952 | } | ||||
| 37953 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 37954 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 37955 | if (objIsXray) { | ||||
| 37956 | unwrappedObj.emplace(cx, obj); | ||||
| 37957 | } | ||||
| 37958 | if (objIsXray) { | ||||
| 37959 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 37960 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 37961 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 37962 | if (!unwrappedObj.ref()) { | ||||
| 37963 | return false; | ||||
| 37964 | } | ||||
| 37965 | } | ||||
| 37966 | FastErrorResult rv; | ||||
| 37967 | // NOTE: This assert does NOT call the function. | ||||
| 37968 | 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"); | ||||
| 37969 | MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 37970 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18" )), 0))) { | ||||
| 37971 | return false; | ||||
| 37972 | } | ||||
| 37973 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 37973); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 37973; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 37974 | args.rval().setUndefined(); | ||||
| 37975 | return true; | ||||
| 37976 | } while (false); | ||||
| 37977 | } | ||||
| 37978 | return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1"); | ||||
| 37979 | break; | ||||
| 37980 | } | ||||
| 37981 | default: { | ||||
| 37982 | // Using nsPrintfCString here would require including that | ||||
| 37983 | // header. Let's not worry about it. | ||||
| 37984 | nsAutoCString argCountStr; | ||||
| 37985 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 37986 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 37987 | } | ||||
| 37988 | } | ||||
| 37989 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 37989); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 37989; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 37990 | return false; | ||||
| 37991 | } | ||||
| 37992 | |||||
| 37993 | static const JSJitInfo overload18_methodinfo = { | ||||
| 37994 | { (JSJitGetterOp)overload18 }, | ||||
| 37995 | { prototypes::id::TestJSImplInterface }, | ||||
| 37996 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 37997 | JSJitInfo::Method, | ||||
| 37998 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 37999 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38000 | false, /* isInfallible. False in setters. */ | ||||
| 38001 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38002 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38003 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38004 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38005 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38006 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38007 | }; | ||||
| 38008 | |||||
| 38009 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38010 | overload19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 38011 | { | ||||
| 38012 | BindingCallContext cx(cx_, "TestJSImplInterface.overload19"); | ||||
| 38013 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38016( cx, "TestJSImplInterface" , "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38014 | "TestJSImplInterface", "overload19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38016( cx, "TestJSImplInterface" , "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38015 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38016( cx, "TestJSImplInterface" , "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38016 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38016( cx, "TestJSImplInterface" , "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 38017 | |||||
| 38018 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38019 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 38020 | switch (argcount) { | ||||
| 38021 | case 0: { | ||||
| 38022 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38023 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38024 | if (objIsXray) { | ||||
| 38025 | unwrappedObj.emplace(cx, obj); | ||||
| 38026 | } | ||||
| 38027 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38028 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 38029 | return false; | ||||
| 38030 | } | ||||
| 38031 | if (objIsXray) { | ||||
| 38032 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38033 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38034 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38035 | if (!unwrappedObj.ref()) { | ||||
| 38036 | return false; | ||||
| 38037 | } | ||||
| 38038 | } | ||||
| 38039 | FastErrorResult rv; | ||||
| 38040 | // NOTE: This assert does NOT call the function. | ||||
| 38041 | 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"); | ||||
| 38042 | MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38043 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19" )), 0))) { | ||||
| 38044 | return false; | ||||
| 38045 | } | ||||
| 38046 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38046); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38046; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38047 | args.rval().setUndefined(); | ||||
| 38048 | return true; | ||||
| 38049 | break; | ||||
| 38050 | } | ||||
| 38051 | case 1: { | ||||
| 38052 | if (args[0].isNullOrUndefined()) { | ||||
| 38053 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38054 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 38055 | return false; | ||||
| 38056 | } | ||||
| 38057 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38058 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38059 | if (objIsXray) { | ||||
| 38060 | unwrappedObj.emplace(cx, obj); | ||||
| 38061 | } | ||||
| 38062 | if (objIsXray) { | ||||
| 38063 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38064 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38065 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38066 | if (!unwrappedObj.ref()) { | ||||
| 38067 | return false; | ||||
| 38068 | } | ||||
| 38069 | } | ||||
| 38070 | FastErrorResult rv; | ||||
| 38071 | // NOTE: This assert does NOT call the function. | ||||
| 38072 | 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"); | ||||
| 38073 | MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38074 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19" )), 0))) { | ||||
| 38075 | return false; | ||||
| 38076 | } | ||||
| 38077 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38077); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38077; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38078 | args.rval().setUndefined(); | ||||
| 38079 | return true; | ||||
| 38080 | } | ||||
| 38081 | if (args[0].isObject()) { | ||||
| 38082 | do { | ||||
| 38083 | binding_detail::AutoSequence<int32_t> arg0; | ||||
| 38084 | JS::ForOfIterator iter(cx); | ||||
| 38085 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 38086 | return false; | ||||
| 38087 | } | ||||
| 38088 | if (!iter.valueIsIterable()) { | ||||
| 38089 | break; | ||||
| 38090 | } | ||||
| 38091 | binding_detail::AutoSequence<int32_t> &arr = arg0; | ||||
| 38092 | JS::Rooted<JS::Value> temp(cx); | ||||
| 38093 | while (true) { | ||||
| 38094 | bool done; | ||||
| 38095 | if (!iter.next(&temp, &done)) { | ||||
| 38096 | return false; | ||||
| 38097 | } | ||||
| 38098 | if (done) { | ||||
| 38099 | break; | ||||
| 38100 | } | ||||
| 38101 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 38102 | if (!slotPtr) { | ||||
| 38103 | JS_ReportOutOfMemory(cx); | ||||
| 38104 | return false; | ||||
| 38105 | } | ||||
| 38106 | int32_t& slot = *slotPtr; | ||||
| 38107 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | ||||
| 38108 | return false; | ||||
| 38109 | } | ||||
| 38110 | } | ||||
| 38111 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38112 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38113 | if (objIsXray) { | ||||
| 38114 | unwrappedObj.emplace(cx, obj); | ||||
| 38115 | } | ||||
| 38116 | if (objIsXray) { | ||||
| 38117 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38118 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38119 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38120 | if (!unwrappedObj.ref()) { | ||||
| 38121 | return false; | ||||
| 38122 | } | ||||
| 38123 | } | ||||
| 38124 | FastErrorResult rv; | ||||
| 38125 | // NOTE: This assert does NOT call the function. | ||||
| 38126 | 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"); | ||||
| 38127 | MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38128 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19" )), 0))) { | ||||
| 38129 | return false; | ||||
| 38130 | } | ||||
| 38131 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38131); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38131; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38132 | args.rval().setUndefined(); | ||||
| 38133 | return true; | ||||
| 38134 | } while (false); | ||||
| 38135 | do { | ||||
| 38136 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38137 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 38138 | return false; | ||||
| 38139 | } | ||||
| 38140 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38141 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38142 | if (objIsXray) { | ||||
| 38143 | unwrappedObj.emplace(cx, obj); | ||||
| 38144 | } | ||||
| 38145 | if (objIsXray) { | ||||
| 38146 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38147 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38148 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38149 | if (!unwrappedObj.ref()) { | ||||
| 38150 | return false; | ||||
| 38151 | } | ||||
| 38152 | } | ||||
| 38153 | FastErrorResult rv; | ||||
| 38154 | // NOTE: This assert does NOT call the function. | ||||
| 38155 | 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"); | ||||
| 38156 | MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38157 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19" )), 0))) { | ||||
| 38158 | return false; | ||||
| 38159 | } | ||||
| 38160 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38160); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38160; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38161 | args.rval().setUndefined(); | ||||
| 38162 | return true; | ||||
| 38163 | } while (false); | ||||
| 38164 | } | ||||
| 38165 | return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1"); | ||||
| 38166 | break; | ||||
| 38167 | } | ||||
| 38168 | default: { | ||||
| 38169 | // Using nsPrintfCString here would require including that | ||||
| 38170 | // header. Let's not worry about it. | ||||
| 38171 | nsAutoCString argCountStr; | ||||
| 38172 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 38173 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 38174 | } | ||||
| 38175 | } | ||||
| 38176 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 38176); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 38176; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 38177 | return false; | ||||
| 38178 | } | ||||
| 38179 | |||||
| 38180 | static const JSJitInfo overload19_methodinfo = { | ||||
| 38181 | { (JSJitGetterOp)overload19 }, | ||||
| 38182 | { prototypes::id::TestJSImplInterface }, | ||||
| 38183 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38184 | JSJitInfo::Method, | ||||
| 38185 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38186 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38187 | false, /* isInfallible. False in setters. */ | ||||
| 38188 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38189 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38190 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38191 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38192 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38193 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38194 | }; | ||||
| 38195 | |||||
| 38196 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38197 | overload20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 38198 | { | ||||
| 38199 | BindingCallContext cx(cx_, "TestJSImplInterface.overload20"); | ||||
| 38200 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38203( cx, "TestJSImplInterface" , "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38201 | "TestJSImplInterface", "overload20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38203( cx, "TestJSImplInterface" , "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38202 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38203( cx, "TestJSImplInterface" , "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38203 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38203( cx, "TestJSImplInterface" , "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 38204 | |||||
| 38205 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38206 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 38207 | switch (argcount) { | ||||
| 38208 | case 0: { | ||||
| 38209 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38210 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38211 | if (objIsXray) { | ||||
| 38212 | unwrappedObj.emplace(cx, obj); | ||||
| 38213 | } | ||||
| 38214 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38215 | if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) { | ||||
| 38216 | return false; | ||||
| 38217 | } | ||||
| 38218 | if (objIsXray) { | ||||
| 38219 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38220 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38221 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38222 | if (!unwrappedObj.ref()) { | ||||
| 38223 | return false; | ||||
| 38224 | } | ||||
| 38225 | } | ||||
| 38226 | FastErrorResult rv; | ||||
| 38227 | // NOTE: This assert does NOT call the function. | ||||
| 38228 | 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"); | ||||
| 38229 | MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38230 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20" )), 0))) { | ||||
| 38231 | return false; | ||||
| 38232 | } | ||||
| 38233 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38233); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38233; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38234 | args.rval().setUndefined(); | ||||
| 38235 | return true; | ||||
| 38236 | break; | ||||
| 38237 | } | ||||
| 38238 | case 1: { | ||||
| 38239 | if (args[0].isNullOrUndefined()) { | ||||
| 38240 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38241 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 38242 | return false; | ||||
| 38243 | } | ||||
| 38244 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38245 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38246 | if (objIsXray) { | ||||
| 38247 | unwrappedObj.emplace(cx, obj); | ||||
| 38248 | } | ||||
| 38249 | if (objIsXray) { | ||||
| 38250 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38251 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38252 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38253 | if (!unwrappedObj.ref()) { | ||||
| 38254 | return false; | ||||
| 38255 | } | ||||
| 38256 | } | ||||
| 38257 | FastErrorResult rv; | ||||
| 38258 | // NOTE: This assert does NOT call the function. | ||||
| 38259 | 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"); | ||||
| 38260 | MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38261 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20" )), 0))) { | ||||
| 38262 | return false; | ||||
| 38263 | } | ||||
| 38264 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38264); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38264; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38265 | args.rval().setUndefined(); | ||||
| 38266 | return true; | ||||
| 38267 | } | ||||
| 38268 | if (args[0].isObject()) { | ||||
| 38269 | do { | ||||
| 38270 | binding_detail::AutoSequence<int32_t> arg0; | ||||
| 38271 | JS::ForOfIterator iter(cx); | ||||
| 38272 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 38273 | return false; | ||||
| 38274 | } | ||||
| 38275 | if (!iter.valueIsIterable()) { | ||||
| 38276 | break; | ||||
| 38277 | } | ||||
| 38278 | binding_detail::AutoSequence<int32_t> &arr = arg0; | ||||
| 38279 | JS::Rooted<JS::Value> temp(cx); | ||||
| 38280 | while (true) { | ||||
| 38281 | bool done; | ||||
| 38282 | if (!iter.next(&temp, &done)) { | ||||
| 38283 | return false; | ||||
| 38284 | } | ||||
| 38285 | if (done) { | ||||
| 38286 | break; | ||||
| 38287 | } | ||||
| 38288 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 38289 | if (!slotPtr) { | ||||
| 38290 | JS_ReportOutOfMemory(cx); | ||||
| 38291 | return false; | ||||
| 38292 | } | ||||
| 38293 | int32_t& slot = *slotPtr; | ||||
| 38294 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | ||||
| 38295 | return false; | ||||
| 38296 | } | ||||
| 38297 | } | ||||
| 38298 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38299 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38300 | if (objIsXray) { | ||||
| 38301 | unwrappedObj.emplace(cx, obj); | ||||
| 38302 | } | ||||
| 38303 | if (objIsXray) { | ||||
| 38304 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38305 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38306 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38307 | if (!unwrappedObj.ref()) { | ||||
| 38308 | return false; | ||||
| 38309 | } | ||||
| 38310 | } | ||||
| 38311 | FastErrorResult rv; | ||||
| 38312 | // NOTE: This assert does NOT call the function. | ||||
| 38313 | 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"); | ||||
| 38314 | MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38315 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20" )), 0))) { | ||||
| 38316 | return false; | ||||
| 38317 | } | ||||
| 38318 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38318); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38318; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38319 | args.rval().setUndefined(); | ||||
| 38320 | return true; | ||||
| 38321 | } while (false); | ||||
| 38322 | do { | ||||
| 38323 | RootedDictionary<binding_detail::FastDict> arg0(cx); | ||||
| 38324 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 38325 | return false; | ||||
| 38326 | } | ||||
| 38327 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38328 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38329 | if (objIsXray) { | ||||
| 38330 | unwrappedObj.emplace(cx, obj); | ||||
| 38331 | } | ||||
| 38332 | if (objIsXray) { | ||||
| 38333 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38334 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38335 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38336 | if (!unwrappedObj.ref()) { | ||||
| 38337 | return false; | ||||
| 38338 | } | ||||
| 38339 | } | ||||
| 38340 | FastErrorResult rv; | ||||
| 38341 | // NOTE: This assert does NOT call the function. | ||||
| 38342 | 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"); | ||||
| 38343 | MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38344 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20" )), 0))) { | ||||
| 38345 | return false; | ||||
| 38346 | } | ||||
| 38347 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38347); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38347; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38348 | args.rval().setUndefined(); | ||||
| 38349 | return true; | ||||
| 38350 | } while (false); | ||||
| 38351 | } | ||||
| 38352 | return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1"); | ||||
| 38353 | break; | ||||
| 38354 | } | ||||
| 38355 | default: { | ||||
| 38356 | // Using nsPrintfCString here would require including that | ||||
| 38357 | // header. Let's not worry about it. | ||||
| 38358 | nsAutoCString argCountStr; | ||||
| 38359 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 38360 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 38361 | } | ||||
| 38362 | } | ||||
| 38363 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 38363); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 38363; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 38364 | return false; | ||||
| 38365 | } | ||||
| 38366 | |||||
| 38367 | static const JSJitInfo overload20_methodinfo = { | ||||
| 38368 | { (JSJitGetterOp)overload20 }, | ||||
| 38369 | { prototypes::id::TestJSImplInterface }, | ||||
| 38370 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38371 | JSJitInfo::Method, | ||||
| 38372 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38373 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38374 | false, /* isInfallible. False in setters. */ | ||||
| 38375 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38376 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38377 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38378 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38379 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38380 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38381 | }; | ||||
| 38382 | |||||
| 38383 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38384 | passVariadicThirdArg(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 38385 | { | ||||
| 38386 | BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicThirdArg"); | ||||
| 38387 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38390( cx, "TestJSImplInterface" , "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38388 | "TestJSImplInterface", "passVariadicThirdArg", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38390( cx, "TestJSImplInterface" , "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38389 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38390( cx, "TestJSImplInterface" , "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38390 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38390( cx, "TestJSImplInterface" , "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 38391 | |||||
| 38392 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38393 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passVariadicThirdArg", 2)) { | ||||
| 38394 | return false; | ||||
| 38395 | } | ||||
| 38396 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38397 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38398 | if (objIsXray) { | ||||
| 38399 | unwrappedObj.emplace(cx, obj); | ||||
| 38400 | } | ||||
| 38401 | binding_detail::FakeString<char16_t> arg0; | ||||
| 38402 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 38403 | return false; | ||||
| 38404 | } | ||||
| 38405 | int32_t arg1; | ||||
| 38406 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) { | ||||
| 38407 | return false; | ||||
| 38408 | } | ||||
| 38409 | AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> arg2; | ||||
| 38410 | if (args.length() > 2) { | ||||
| 38411 | if (!arg2.SetCapacity(args.length() - 2, mozilla::fallible)) { | ||||
| 38412 | JS_ReportOutOfMemory(cx); | ||||
| 38413 | return false; | ||||
| 38414 | } | ||||
| 38415 | for (uint32_t variadicArg = 2; variadicArg < args.length(); ++variadicArg) { | ||||
| 38416 | // OK to do infallible append here, since we ensured capacity already. | ||||
| 38417 | OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *arg2.AppendElement(); | ||||
| 38418 | if (args[variadicArg].isObject()) { | ||||
| 38419 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 38420 | { | ||||
| 38421 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 38422 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[variadicArg], slot, cx); | ||||
| 38423 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 38424 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 3", "TestJSImplInterface"); | ||||
| 38425 | return false; | ||||
| 38426 | } | ||||
| 38427 | } | ||||
| 38428 | } else { | ||||
| 38429 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3"); | ||||
| 38430 | return false; | ||||
| 38431 | } | ||||
| 38432 | } | ||||
| 38433 | } | ||||
| 38434 | if (objIsXray) { | ||||
| 38435 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38436 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38437 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38438 | if (!unwrappedObj.ref()) { | ||||
| 38439 | return false; | ||||
| 38440 | } | ||||
| 38441 | } | ||||
| 38442 | FastErrorResult rv; | ||||
| 38443 | // NOTE: This assert does NOT call the function. | ||||
| 38444 | 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"); | ||||
| 38445 | 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))); | ||||
| 38446 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg" )), 0))) { | ||||
| 38447 | return false; | ||||
| 38448 | } | ||||
| 38449 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38449); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38449; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38450 | args.rval().setUndefined(); | ||||
| 38451 | return true; | ||||
| 38452 | } | ||||
| 38453 | |||||
| 38454 | static const JSJitInfo passVariadicThirdArg_methodinfo = { | ||||
| 38455 | { (JSJitGetterOp)passVariadicThirdArg }, | ||||
| 38456 | { prototypes::id::TestJSImplInterface }, | ||||
| 38457 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38458 | JSJitInfo::Method, | ||||
| 38459 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38460 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38461 | false, /* isInfallible. False in setters. */ | ||||
| 38462 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38463 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38464 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38465 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38466 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38467 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38468 | }; | ||||
| 38469 | |||||
| 38470 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38471 | get_prefable1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38472 | { | ||||
| 38473 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38476( cx, "TestJSImplInterface" , "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38474 | "TestJSImplInterface", "prefable1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38476( cx, "TestJSImplInterface" , "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38475 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38476( cx, "TestJSImplInterface" , "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38476 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38476( cx, "TestJSImplInterface" , "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38477 | |||||
| 38478 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38479 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38480 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38481 | if (objIsXray) { | ||||
| 38482 | unwrappedObj.emplace(cx, obj); | ||||
| 38483 | } | ||||
| 38484 | if (objIsXray) { | ||||
| 38485 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38486 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38487 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38488 | if (!unwrappedObj.ref()) { | ||||
| 38489 | return false; | ||||
| 38490 | } | ||||
| 38491 | } | ||||
| 38492 | FastErrorResult rv; | ||||
| 38493 | bool result(MOZ_KnownLive(self)(self)->GetPrefable1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38494 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter" )), 0))) { | ||||
| 38495 | return false; | ||||
| 38496 | } | ||||
| 38497 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38497); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38497; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38498 | args.rval().setBoolean(result); | ||||
| 38499 | return true; | ||||
| 38500 | } | ||||
| 38501 | |||||
| 38502 | static const JSJitInfo prefable1_getterinfo = { | ||||
| 38503 | { get_prefable1 }, | ||||
| 38504 | { prototypes::id::TestJSImplInterface }, | ||||
| 38505 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38506 | JSJitInfo::Getter, | ||||
| 38507 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38508 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38509 | false, /* isInfallible. False in setters. */ | ||||
| 38510 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38511 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38512 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38513 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38514 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38515 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38516 | }; | ||||
| 38517 | |||||
| 38518 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38519 | get_prefable2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38520 | { | ||||
| 38521 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38524( cx, "TestJSImplInterface" , "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38522 | "TestJSImplInterface", "prefable2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38524( cx, "TestJSImplInterface" , "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38523 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38524( cx, "TestJSImplInterface" , "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38524 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38524( cx, "TestJSImplInterface" , "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38525 | |||||
| 38526 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38527 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38528 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38529 | if (objIsXray) { | ||||
| 38530 | unwrappedObj.emplace(cx, obj); | ||||
| 38531 | } | ||||
| 38532 | if (objIsXray) { | ||||
| 38533 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38534 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38535 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38536 | if (!unwrappedObj.ref()) { | ||||
| 38537 | return false; | ||||
| 38538 | } | ||||
| 38539 | } | ||||
| 38540 | FastErrorResult rv; | ||||
| 38541 | bool result(MOZ_KnownLive(self)(self)->GetPrefable2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38542 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter" )), 0))) { | ||||
| 38543 | return false; | ||||
| 38544 | } | ||||
| 38545 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38545); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38545; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38546 | args.rval().setBoolean(result); | ||||
| 38547 | return true; | ||||
| 38548 | } | ||||
| 38549 | |||||
| 38550 | static const JSJitInfo prefable2_getterinfo = { | ||||
| 38551 | { get_prefable2 }, | ||||
| 38552 | { prototypes::id::TestJSImplInterface }, | ||||
| 38553 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38554 | JSJitInfo::Getter, | ||||
| 38555 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38556 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38557 | false, /* isInfallible. False in setters. */ | ||||
| 38558 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38559 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38560 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38561 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38562 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38563 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38564 | }; | ||||
| 38565 | |||||
| 38566 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38567 | get_prefable3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38568 | { | ||||
| 38569 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38572( cx, "TestJSImplInterface" , "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38570 | "TestJSImplInterface", "prefable3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38572( cx, "TestJSImplInterface" , "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38571 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38572( cx, "TestJSImplInterface" , "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38572 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38572( cx, "TestJSImplInterface" , "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38573 | |||||
| 38574 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38575 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38576 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38577 | if (objIsXray) { | ||||
| 38578 | unwrappedObj.emplace(cx, obj); | ||||
| 38579 | } | ||||
| 38580 | if (objIsXray) { | ||||
| 38581 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38582 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38583 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38584 | if (!unwrappedObj.ref()) { | ||||
| 38585 | return false; | ||||
| 38586 | } | ||||
| 38587 | } | ||||
| 38588 | FastErrorResult rv; | ||||
| 38589 | bool result(MOZ_KnownLive(self)(self)->GetPrefable3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38590 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter" )), 0))) { | ||||
| 38591 | return false; | ||||
| 38592 | } | ||||
| 38593 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38593); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38593; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38594 | args.rval().setBoolean(result); | ||||
| 38595 | return true; | ||||
| 38596 | } | ||||
| 38597 | |||||
| 38598 | static const JSJitInfo prefable3_getterinfo = { | ||||
| 38599 | { get_prefable3 }, | ||||
| 38600 | { prototypes::id::TestJSImplInterface }, | ||||
| 38601 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38602 | JSJitInfo::Getter, | ||||
| 38603 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38604 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38605 | false, /* isInfallible. False in setters. */ | ||||
| 38606 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38607 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38608 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38609 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38610 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38611 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38612 | }; | ||||
| 38613 | |||||
| 38614 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38615 | get_prefable4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38616 | { | ||||
| 38617 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38620( cx, "TestJSImplInterface" , "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38618 | "TestJSImplInterface", "prefable4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38620( cx, "TestJSImplInterface" , "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38619 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38620( cx, "TestJSImplInterface" , "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38620 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38620( cx, "TestJSImplInterface" , "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38621 | |||||
| 38622 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38623 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38624 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38625 | if (objIsXray) { | ||||
| 38626 | unwrappedObj.emplace(cx, obj); | ||||
| 38627 | } | ||||
| 38628 | if (objIsXray) { | ||||
| 38629 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38630 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38631 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38632 | if (!unwrappedObj.ref()) { | ||||
| 38633 | return false; | ||||
| 38634 | } | ||||
| 38635 | } | ||||
| 38636 | FastErrorResult rv; | ||||
| 38637 | bool result(MOZ_KnownLive(self)(self)->GetPrefable4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38638 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter" )), 0))) { | ||||
| 38639 | return false; | ||||
| 38640 | } | ||||
| 38641 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38641); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38641; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38642 | args.rval().setBoolean(result); | ||||
| 38643 | return true; | ||||
| 38644 | } | ||||
| 38645 | |||||
| 38646 | static const JSJitInfo prefable4_getterinfo = { | ||||
| 38647 | { get_prefable4 }, | ||||
| 38648 | { prototypes::id::TestJSImplInterface }, | ||||
| 38649 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38650 | JSJitInfo::Getter, | ||||
| 38651 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38652 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38653 | false, /* isInfallible. False in setters. */ | ||||
| 38654 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38655 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38656 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38657 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38658 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38659 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38660 | }; | ||||
| 38661 | |||||
| 38662 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38663 | get_prefable5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38664 | { | ||||
| 38665 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38668( cx, "TestJSImplInterface" , "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38666 | "TestJSImplInterface", "prefable5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38668( cx, "TestJSImplInterface" , "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38667 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38668( cx, "TestJSImplInterface" , "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38668 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38668( cx, "TestJSImplInterface" , "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38669 | |||||
| 38670 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38671 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38672 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38673 | if (objIsXray) { | ||||
| 38674 | unwrappedObj.emplace(cx, obj); | ||||
| 38675 | } | ||||
| 38676 | if (objIsXray) { | ||||
| 38677 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38678 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38679 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38680 | if (!unwrappedObj.ref()) { | ||||
| 38681 | return false; | ||||
| 38682 | } | ||||
| 38683 | } | ||||
| 38684 | FastErrorResult rv; | ||||
| 38685 | bool result(MOZ_KnownLive(self)(self)->GetPrefable5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38686 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter" )), 0))) { | ||||
| 38687 | return false; | ||||
| 38688 | } | ||||
| 38689 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38689); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38689; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38690 | args.rval().setBoolean(result); | ||||
| 38691 | return true; | ||||
| 38692 | } | ||||
| 38693 | |||||
| 38694 | static const JSJitInfo prefable5_getterinfo = { | ||||
| 38695 | { get_prefable5 }, | ||||
| 38696 | { prototypes::id::TestJSImplInterface }, | ||||
| 38697 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38698 | JSJitInfo::Getter, | ||||
| 38699 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38700 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38701 | false, /* isInfallible. False in setters. */ | ||||
| 38702 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38703 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38704 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38705 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38706 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38707 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38708 | }; | ||||
| 38709 | |||||
| 38710 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38711 | get_prefable6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38712 | { | ||||
| 38713 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38716( cx, "TestJSImplInterface" , "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38714 | "TestJSImplInterface", "prefable6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38716( cx, "TestJSImplInterface" , "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38715 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38716( cx, "TestJSImplInterface" , "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38716 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38716( cx, "TestJSImplInterface" , "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38717 | |||||
| 38718 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38719 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38720 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38721 | if (objIsXray) { | ||||
| 38722 | unwrappedObj.emplace(cx, obj); | ||||
| 38723 | } | ||||
| 38724 | if (objIsXray) { | ||||
| 38725 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38726 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38727 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38728 | if (!unwrappedObj.ref()) { | ||||
| 38729 | return false; | ||||
| 38730 | } | ||||
| 38731 | } | ||||
| 38732 | FastErrorResult rv; | ||||
| 38733 | bool result(MOZ_KnownLive(self)(self)->GetPrefable6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38734 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter" )), 0))) { | ||||
| 38735 | return false; | ||||
| 38736 | } | ||||
| 38737 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38737); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38737; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38738 | args.rval().setBoolean(result); | ||||
| 38739 | return true; | ||||
| 38740 | } | ||||
| 38741 | |||||
| 38742 | static const JSJitInfo prefable6_getterinfo = { | ||||
| 38743 | { get_prefable6 }, | ||||
| 38744 | { prototypes::id::TestJSImplInterface }, | ||||
| 38745 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38746 | JSJitInfo::Getter, | ||||
| 38747 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38748 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38749 | false, /* isInfallible. False in setters. */ | ||||
| 38750 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38751 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38752 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38753 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38754 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38755 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38756 | }; | ||||
| 38757 | |||||
| 38758 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38759 | get_prefable7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38760 | { | ||||
| 38761 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38764( cx, "TestJSImplInterface" , "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38762 | "TestJSImplInterface", "prefable7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38764( cx, "TestJSImplInterface" , "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38763 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38764( cx, "TestJSImplInterface" , "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38764 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38764( cx, "TestJSImplInterface" , "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38765 | |||||
| 38766 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38767 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38768 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38769 | if (objIsXray) { | ||||
| 38770 | unwrappedObj.emplace(cx, obj); | ||||
| 38771 | } | ||||
| 38772 | if (objIsXray) { | ||||
| 38773 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38774 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38775 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38776 | if (!unwrappedObj.ref()) { | ||||
| 38777 | return false; | ||||
| 38778 | } | ||||
| 38779 | } | ||||
| 38780 | FastErrorResult rv; | ||||
| 38781 | bool result(MOZ_KnownLive(self)(self)->GetPrefable7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38782 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter" )), 0))) { | ||||
| 38783 | return false; | ||||
| 38784 | } | ||||
| 38785 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38785); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38785; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38786 | args.rval().setBoolean(result); | ||||
| 38787 | return true; | ||||
| 38788 | } | ||||
| 38789 | |||||
| 38790 | static const JSJitInfo prefable7_getterinfo = { | ||||
| 38791 | { get_prefable7 }, | ||||
| 38792 | { prototypes::id::TestJSImplInterface }, | ||||
| 38793 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38794 | JSJitInfo::Getter, | ||||
| 38795 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38796 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38797 | false, /* isInfallible. False in setters. */ | ||||
| 38798 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38799 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38800 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38801 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38802 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38803 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38804 | }; | ||||
| 38805 | |||||
| 38806 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38807 | get_prefable8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38808 | { | ||||
| 38809 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38812( cx, "TestJSImplInterface" , "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38810 | "TestJSImplInterface", "prefable8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38812( cx, "TestJSImplInterface" , "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38811 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38812( cx, "TestJSImplInterface" , "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38812 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38812( cx, "TestJSImplInterface" , "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38813 | |||||
| 38814 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38815 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38816 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38817 | if (objIsXray) { | ||||
| 38818 | unwrappedObj.emplace(cx, obj); | ||||
| 38819 | } | ||||
| 38820 | if (objIsXray) { | ||||
| 38821 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38822 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38823 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38824 | if (!unwrappedObj.ref()) { | ||||
| 38825 | return false; | ||||
| 38826 | } | ||||
| 38827 | } | ||||
| 38828 | FastErrorResult rv; | ||||
| 38829 | bool result(MOZ_KnownLive(self)(self)->GetPrefable8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38830 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter" )), 0))) { | ||||
| 38831 | return false; | ||||
| 38832 | } | ||||
| 38833 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38833); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38833; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38834 | args.rval().setBoolean(result); | ||||
| 38835 | return true; | ||||
| 38836 | } | ||||
| 38837 | |||||
| 38838 | static const JSJitInfo prefable8_getterinfo = { | ||||
| 38839 | { get_prefable8 }, | ||||
| 38840 | { prototypes::id::TestJSImplInterface }, | ||||
| 38841 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38842 | JSJitInfo::Getter, | ||||
| 38843 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38844 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38845 | false, /* isInfallible. False in setters. */ | ||||
| 38846 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38847 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38848 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38849 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38850 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38851 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38852 | }; | ||||
| 38853 | |||||
| 38854 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38855 | get_prefable9(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 38856 | { | ||||
| 38857 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38860( cx, "TestJSImplInterface" , "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38858 | "TestJSImplInterface", "prefable9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38860( cx, "TestJSImplInterface" , "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38859 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38860( cx, "TestJSImplInterface" , "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 38860 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38860( cx, "TestJSImplInterface" , "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 38861 | |||||
| 38862 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38863 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38864 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38865 | if (objIsXray) { | ||||
| 38866 | unwrappedObj.emplace(cx, obj); | ||||
| 38867 | } | ||||
| 38868 | if (objIsXray) { | ||||
| 38869 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38870 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38871 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38872 | if (!unwrappedObj.ref()) { | ||||
| 38873 | return false; | ||||
| 38874 | } | ||||
| 38875 | } | ||||
| 38876 | FastErrorResult rv; | ||||
| 38877 | bool result(MOZ_KnownLive(self)(self)->GetPrefable9(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 38878 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter" )), 0))) { | ||||
| 38879 | return false; | ||||
| 38880 | } | ||||
| 38881 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38881); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38881; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38882 | args.rval().setBoolean(result); | ||||
| 38883 | return true; | ||||
| 38884 | } | ||||
| 38885 | |||||
| 38886 | static const JSJitInfo prefable9_getterinfo = { | ||||
| 38887 | { get_prefable9 }, | ||||
| 38888 | { prototypes::id::TestJSImplInterface }, | ||||
| 38889 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38890 | JSJitInfo::Getter, | ||||
| 38891 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38892 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 38893 | false, /* isInfallible. False in setters. */ | ||||
| 38894 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38895 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38896 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38897 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38898 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38899 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38900 | }; | ||||
| 38901 | |||||
| 38902 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38903 | prefable10(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 38904 | { | ||||
| 38905 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38908( cx, "TestJSImplInterface" , "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38906 | "TestJSImplInterface", "prefable10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38908( cx, "TestJSImplInterface" , "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38907 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38908( cx, "TestJSImplInterface" , "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38908 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38908( cx, "TestJSImplInterface" , "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 38909 | |||||
| 38910 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38911 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38912 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38913 | if (objIsXray) { | ||||
| 38914 | unwrappedObj.emplace(cx, obj); | ||||
| 38915 | } | ||||
| 38916 | if (objIsXray) { | ||||
| 38917 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38918 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38919 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38920 | if (!unwrappedObj.ref()) { | ||||
| 38921 | return false; | ||||
| 38922 | } | ||||
| 38923 | } | ||||
| 38924 | FastErrorResult rv; | ||||
| 38925 | // NOTE: This assert does NOT call the function. | ||||
| 38926 | 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"); | ||||
| 38927 | MOZ_KnownLive(self)(self)->Prefable10(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38928 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10" )), 0))) { | ||||
| 38929 | return false; | ||||
| 38930 | } | ||||
| 38931 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38931); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38931; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38932 | args.rval().setUndefined(); | ||||
| 38933 | return true; | ||||
| 38934 | } | ||||
| 38935 | |||||
| 38936 | static const JSJitInfo prefable10_methodinfo = { | ||||
| 38937 | { (JSJitGetterOp)prefable10 }, | ||||
| 38938 | { prototypes::id::TestJSImplInterface }, | ||||
| 38939 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38940 | JSJitInfo::Method, | ||||
| 38941 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38942 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38943 | false, /* isInfallible. False in setters. */ | ||||
| 38944 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38945 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38946 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38947 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38948 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38949 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 38950 | }; | ||||
| 38951 | |||||
| 38952 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 38953 | prefable11(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 38954 | { | ||||
| 38955 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38958( cx, "TestJSImplInterface" , "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38956 | "TestJSImplInterface", "prefable11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38958( cx, "TestJSImplInterface" , "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38957 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38958( cx, "TestJSImplInterface" , "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 38958 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38958( cx, "TestJSImplInterface" , "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 38959 | |||||
| 38960 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 38961 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 38962 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 38963 | if (objIsXray) { | ||||
| 38964 | unwrappedObj.emplace(cx, obj); | ||||
| 38965 | } | ||||
| 38966 | if (objIsXray) { | ||||
| 38967 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 38968 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 38969 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 38970 | if (!unwrappedObj.ref()) { | ||||
| 38971 | return false; | ||||
| 38972 | } | ||||
| 38973 | } | ||||
| 38974 | FastErrorResult rv; | ||||
| 38975 | // NOTE: This assert does NOT call the function. | ||||
| 38976 | 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"); | ||||
| 38977 | MOZ_KnownLive(self)(self)->Prefable11(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 38978 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11" )), 0))) { | ||||
| 38979 | return false; | ||||
| 38980 | } | ||||
| 38981 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 38981); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 38981; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 38982 | args.rval().setUndefined(); | ||||
| 38983 | return true; | ||||
| 38984 | } | ||||
| 38985 | |||||
| 38986 | static const JSJitInfo prefable11_methodinfo = { | ||||
| 38987 | { (JSJitGetterOp)prefable11 }, | ||||
| 38988 | { prototypes::id::TestJSImplInterface }, | ||||
| 38989 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 38990 | JSJitInfo::Method, | ||||
| 38991 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 38992 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 38993 | false, /* isInfallible. False in setters. */ | ||||
| 38994 | false, /* isMovable. Not relevant for setters. */ | ||||
| 38995 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 38996 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 38997 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 38998 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 38999 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39000 | }; | ||||
| 39001 | |||||
| 39002 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39003 | get_prefable12(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39004 | { | ||||
| 39005 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39008( cx, "TestJSImplInterface" , "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39006 | "TestJSImplInterface", "prefable12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39008( cx, "TestJSImplInterface" , "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39007 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39008( cx, "TestJSImplInterface" , "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39008 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39008( cx, "TestJSImplInterface" , "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39009 | |||||
| 39010 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39011 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39012 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39013 | if (objIsXray) { | ||||
| 39014 | unwrappedObj.emplace(cx, obj); | ||||
| 39015 | } | ||||
| 39016 | if (objIsXray) { | ||||
| 39017 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39018 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39019 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39020 | if (!unwrappedObj.ref()) { | ||||
| 39021 | return false; | ||||
| 39022 | } | ||||
| 39023 | } | ||||
| 39024 | FastErrorResult rv; | ||||
| 39025 | bool result(MOZ_KnownLive(self)(self)->GetPrefable12(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39026 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter" )), 0))) { | ||||
| 39027 | return false; | ||||
| 39028 | } | ||||
| 39029 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39029); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39029; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39030 | args.rval().setBoolean(result); | ||||
| 39031 | return true; | ||||
| 39032 | } | ||||
| 39033 | |||||
| 39034 | static const JSJitInfo prefable12_getterinfo = { | ||||
| 39035 | { get_prefable12 }, | ||||
| 39036 | { prototypes::id::TestJSImplInterface }, | ||||
| 39037 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39038 | JSJitInfo::Getter, | ||||
| 39039 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39040 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39041 | false, /* isInfallible. False in setters. */ | ||||
| 39042 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39043 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39044 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39045 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39046 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39047 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39048 | }; | ||||
| 39049 | |||||
| 39050 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39051 | prefable13(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39052 | { | ||||
| 39053 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39056( cx, "TestJSImplInterface" , "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39054 | "TestJSImplInterface", "prefable13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39056( cx, "TestJSImplInterface" , "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39055 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39056( cx, "TestJSImplInterface" , "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39056 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39056( cx, "TestJSImplInterface" , "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39057 | |||||
| 39058 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39059 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39060 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39061 | if (objIsXray) { | ||||
| 39062 | unwrappedObj.emplace(cx, obj); | ||||
| 39063 | } | ||||
| 39064 | if (objIsXray) { | ||||
| 39065 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39066 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39067 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39068 | if (!unwrappedObj.ref()) { | ||||
| 39069 | return false; | ||||
| 39070 | } | ||||
| 39071 | } | ||||
| 39072 | FastErrorResult rv; | ||||
| 39073 | // NOTE: This assert does NOT call the function. | ||||
| 39074 | 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"); | ||||
| 39075 | MOZ_KnownLive(self)(self)->Prefable13(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39076 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13" )), 0))) { | ||||
| 39077 | return false; | ||||
| 39078 | } | ||||
| 39079 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39079); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39079; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39080 | args.rval().setUndefined(); | ||||
| 39081 | return true; | ||||
| 39082 | } | ||||
| 39083 | |||||
| 39084 | static const JSJitInfo prefable13_methodinfo = { | ||||
| 39085 | { (JSJitGetterOp)prefable13 }, | ||||
| 39086 | { prototypes::id::TestJSImplInterface }, | ||||
| 39087 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39088 | JSJitInfo::Method, | ||||
| 39089 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39090 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39091 | false, /* isInfallible. False in setters. */ | ||||
| 39092 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39093 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39094 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39095 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39096 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39097 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39098 | }; | ||||
| 39099 | |||||
| 39100 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39101 | get_prefable14(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39102 | { | ||||
| 39103 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39106( cx, "TestJSImplInterface" , "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39104 | "TestJSImplInterface", "prefable14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39106( cx, "TestJSImplInterface" , "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39105 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39106( cx, "TestJSImplInterface" , "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39106 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39106( cx, "TestJSImplInterface" , "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39107 | |||||
| 39108 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39109 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39110 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39111 | if (objIsXray) { | ||||
| 39112 | unwrappedObj.emplace(cx, obj); | ||||
| 39113 | } | ||||
| 39114 | if (objIsXray) { | ||||
| 39115 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39116 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39117 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39118 | if (!unwrappedObj.ref()) { | ||||
| 39119 | return false; | ||||
| 39120 | } | ||||
| 39121 | } | ||||
| 39122 | FastErrorResult rv; | ||||
| 39123 | bool result(MOZ_KnownLive(self)(self)->GetPrefable14(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39124 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter" )), 0))) { | ||||
| 39125 | return false; | ||||
| 39126 | } | ||||
| 39127 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39127); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39127; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39128 | args.rval().setBoolean(result); | ||||
| 39129 | return true; | ||||
| 39130 | } | ||||
| 39131 | |||||
| 39132 | static const JSJitInfo prefable14_getterinfo = { | ||||
| 39133 | { get_prefable14 }, | ||||
| 39134 | { prototypes::id::TestJSImplInterface }, | ||||
| 39135 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39136 | JSJitInfo::Getter, | ||||
| 39137 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39138 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39139 | false, /* isInfallible. False in setters. */ | ||||
| 39140 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39141 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39142 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39143 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39144 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39145 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39146 | }; | ||||
| 39147 | |||||
| 39148 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39149 | get_prefable15(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39150 | { | ||||
| 39151 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39154( cx, "TestJSImplInterface" , "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39152 | "TestJSImplInterface", "prefable15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39154( cx, "TestJSImplInterface" , "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39153 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39154( cx, "TestJSImplInterface" , "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39154 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39154( cx, "TestJSImplInterface" , "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39155 | |||||
| 39156 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39157 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39158 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39159 | if (objIsXray) { | ||||
| 39160 | unwrappedObj.emplace(cx, obj); | ||||
| 39161 | } | ||||
| 39162 | if (objIsXray) { | ||||
| 39163 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39164 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39165 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39166 | if (!unwrappedObj.ref()) { | ||||
| 39167 | return false; | ||||
| 39168 | } | ||||
| 39169 | } | ||||
| 39170 | FastErrorResult rv; | ||||
| 39171 | bool result(MOZ_KnownLive(self)(self)->GetPrefable15(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39172 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter" )), 0))) { | ||||
| 39173 | return false; | ||||
| 39174 | } | ||||
| 39175 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39175; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39176 | args.rval().setBoolean(result); | ||||
| 39177 | return true; | ||||
| 39178 | } | ||||
| 39179 | |||||
| 39180 | static const JSJitInfo prefable15_getterinfo = { | ||||
| 39181 | { get_prefable15 }, | ||||
| 39182 | { prototypes::id::TestJSImplInterface }, | ||||
| 39183 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39184 | JSJitInfo::Getter, | ||||
| 39185 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39186 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39187 | false, /* isInfallible. False in setters. */ | ||||
| 39188 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39189 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39190 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39191 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39192 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39193 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39194 | }; | ||||
| 39195 | |||||
| 39196 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39197 | get_prefable16(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39198 | { | ||||
| 39199 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39202( cx, "TestJSImplInterface" , "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39200 | "TestJSImplInterface", "prefable16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39202( cx, "TestJSImplInterface" , "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39201 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39202( cx, "TestJSImplInterface" , "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39202 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39202( cx, "TestJSImplInterface" , "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39203 | |||||
| 39204 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39205 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39206 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39207 | if (objIsXray) { | ||||
| 39208 | unwrappedObj.emplace(cx, obj); | ||||
| 39209 | } | ||||
| 39210 | if (objIsXray) { | ||||
| 39211 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39212 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39213 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39214 | if (!unwrappedObj.ref()) { | ||||
| 39215 | return false; | ||||
| 39216 | } | ||||
| 39217 | } | ||||
| 39218 | FastErrorResult rv; | ||||
| 39219 | bool result(MOZ_KnownLive(self)(self)->GetPrefable16(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39220 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter" )), 0))) { | ||||
| 39221 | return false; | ||||
| 39222 | } | ||||
| 39223 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39223); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39223; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39224 | args.rval().setBoolean(result); | ||||
| 39225 | return true; | ||||
| 39226 | } | ||||
| 39227 | |||||
| 39228 | static const JSJitInfo prefable16_getterinfo = { | ||||
| 39229 | { get_prefable16 }, | ||||
| 39230 | { prototypes::id::TestJSImplInterface }, | ||||
| 39231 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39232 | JSJitInfo::Getter, | ||||
| 39233 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39234 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39235 | false, /* isInfallible. False in setters. */ | ||||
| 39236 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39237 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39238 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39239 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39240 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39241 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39242 | }; | ||||
| 39243 | |||||
| 39244 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39245 | prefable17(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39246 | { | ||||
| 39247 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39250( cx, "TestJSImplInterface" , "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39248 | "TestJSImplInterface", "prefable17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39250( cx, "TestJSImplInterface" , "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39249 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39250( cx, "TestJSImplInterface" , "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39250 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39250( cx, "TestJSImplInterface" , "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39251 | |||||
| 39252 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39253 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39254 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39255 | if (objIsXray) { | ||||
| 39256 | unwrappedObj.emplace(cx, obj); | ||||
| 39257 | } | ||||
| 39258 | if (objIsXray) { | ||||
| 39259 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39260 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39261 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39262 | if (!unwrappedObj.ref()) { | ||||
| 39263 | return false; | ||||
| 39264 | } | ||||
| 39265 | } | ||||
| 39266 | FastErrorResult rv; | ||||
| 39267 | // NOTE: This assert does NOT call the function. | ||||
| 39268 | 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"); | ||||
| 39269 | MOZ_KnownLive(self)(self)->Prefable17(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39270 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17" )), 0))) { | ||||
| 39271 | return false; | ||||
| 39272 | } | ||||
| 39273 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39273); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39273; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39274 | args.rval().setUndefined(); | ||||
| 39275 | return true; | ||||
| 39276 | } | ||||
| 39277 | |||||
| 39278 | static const JSJitInfo prefable17_methodinfo = { | ||||
| 39279 | { (JSJitGetterOp)prefable17 }, | ||||
| 39280 | { prototypes::id::TestJSImplInterface }, | ||||
| 39281 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39282 | JSJitInfo::Method, | ||||
| 39283 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39284 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39285 | false, /* isInfallible. False in setters. */ | ||||
| 39286 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39287 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39288 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39289 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39290 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39291 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39292 | }; | ||||
| 39293 | |||||
| 39294 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39295 | prefable18(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39296 | { | ||||
| 39297 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39300( cx, "TestJSImplInterface" , "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39298 | "TestJSImplInterface", "prefable18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39300( cx, "TestJSImplInterface" , "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39299 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39300( cx, "TestJSImplInterface" , "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39300 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39300( cx, "TestJSImplInterface" , "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39301 | |||||
| 39302 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39303 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39304 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39305 | if (objIsXray) { | ||||
| 39306 | unwrappedObj.emplace(cx, obj); | ||||
| 39307 | } | ||||
| 39308 | if (objIsXray) { | ||||
| 39309 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39310 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39311 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39312 | if (!unwrappedObj.ref()) { | ||||
| 39313 | return false; | ||||
| 39314 | } | ||||
| 39315 | } | ||||
| 39316 | FastErrorResult rv; | ||||
| 39317 | // NOTE: This assert does NOT call the function. | ||||
| 39318 | 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"); | ||||
| 39319 | MOZ_KnownLive(self)(self)->Prefable18(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39320 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18" )), 0))) { | ||||
| 39321 | return false; | ||||
| 39322 | } | ||||
| 39323 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39323); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39323; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39324 | args.rval().setUndefined(); | ||||
| 39325 | return true; | ||||
| 39326 | } | ||||
| 39327 | |||||
| 39328 | static const JSJitInfo prefable18_methodinfo = { | ||||
| 39329 | { (JSJitGetterOp)prefable18 }, | ||||
| 39330 | { prototypes::id::TestJSImplInterface }, | ||||
| 39331 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39332 | JSJitInfo::Method, | ||||
| 39333 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39334 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39335 | false, /* isInfallible. False in setters. */ | ||||
| 39336 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39337 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39338 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39339 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39340 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39341 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39342 | }; | ||||
| 39343 | |||||
| 39344 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39345 | prefable19(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39346 | { | ||||
| 39347 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39350( cx, "TestJSImplInterface" , "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39348 | "TestJSImplInterface", "prefable19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39350( cx, "TestJSImplInterface" , "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39349 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39350( cx, "TestJSImplInterface" , "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39350 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39350( cx, "TestJSImplInterface" , "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39351 | |||||
| 39352 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39353 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39354 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39355 | if (objIsXray) { | ||||
| 39356 | unwrappedObj.emplace(cx, obj); | ||||
| 39357 | } | ||||
| 39358 | if (objIsXray) { | ||||
| 39359 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39360 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39361 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39362 | if (!unwrappedObj.ref()) { | ||||
| 39363 | return false; | ||||
| 39364 | } | ||||
| 39365 | } | ||||
| 39366 | FastErrorResult rv; | ||||
| 39367 | // NOTE: This assert does NOT call the function. | ||||
| 39368 | 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"); | ||||
| 39369 | MOZ_KnownLive(self)(self)->Prefable19(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39370 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19" )), 0))) { | ||||
| 39371 | return false; | ||||
| 39372 | } | ||||
| 39373 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39373); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39373; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39374 | args.rval().setUndefined(); | ||||
| 39375 | return true; | ||||
| 39376 | } | ||||
| 39377 | |||||
| 39378 | static const JSJitInfo prefable19_methodinfo = { | ||||
| 39379 | { (JSJitGetterOp)prefable19 }, | ||||
| 39380 | { prototypes::id::TestJSImplInterface }, | ||||
| 39381 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39382 | JSJitInfo::Method, | ||||
| 39383 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39384 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39385 | false, /* isInfallible. False in setters. */ | ||||
| 39386 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39387 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39388 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39389 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39390 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39391 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39392 | }; | ||||
| 39393 | |||||
| 39394 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39395 | prefable20(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39396 | { | ||||
| 39397 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39400( cx, "TestJSImplInterface" , "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39398 | "TestJSImplInterface", "prefable20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39400( cx, "TestJSImplInterface" , "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39399 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39400( cx, "TestJSImplInterface" , "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39400 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39400( cx, "TestJSImplInterface" , "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39401 | |||||
| 39402 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39403 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39404 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39405 | if (objIsXray) { | ||||
| 39406 | unwrappedObj.emplace(cx, obj); | ||||
| 39407 | } | ||||
| 39408 | if (objIsXray) { | ||||
| 39409 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39410 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39411 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39412 | if (!unwrappedObj.ref()) { | ||||
| 39413 | return false; | ||||
| 39414 | } | ||||
| 39415 | } | ||||
| 39416 | FastErrorResult rv; | ||||
| 39417 | // NOTE: This assert does NOT call the function. | ||||
| 39418 | 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"); | ||||
| 39419 | MOZ_KnownLive(self)(self)->Prefable20(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39420 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20" )), 0))) { | ||||
| 39421 | return false; | ||||
| 39422 | } | ||||
| 39423 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39423); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39423; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39424 | args.rval().setUndefined(); | ||||
| 39425 | return true; | ||||
| 39426 | } | ||||
| 39427 | |||||
| 39428 | static const JSJitInfo prefable20_methodinfo = { | ||||
| 39429 | { (JSJitGetterOp)prefable20 }, | ||||
| 39430 | { prototypes::id::TestJSImplInterface }, | ||||
| 39431 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39432 | JSJitInfo::Method, | ||||
| 39433 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39434 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39435 | false, /* isInfallible. False in setters. */ | ||||
| 39436 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39437 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39438 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39439 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39440 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39441 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39442 | }; | ||||
| 39443 | |||||
| 39444 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39445 | get_conditionalOnSecureContext1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39446 | { | ||||
| 39447 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39450( cx, "TestJSImplInterface" , "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39448 | "TestJSImplInterface", "conditionalOnSecureContext1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39450( cx, "TestJSImplInterface" , "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39449 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39450( cx, "TestJSImplInterface" , "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39450 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39450( cx, "TestJSImplInterface" , "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39451 | |||||
| 39452 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39453 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39454 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39455 | if (objIsXray) { | ||||
| 39456 | unwrappedObj.emplace(cx, obj); | ||||
| 39457 | } | ||||
| 39458 | if (objIsXray) { | ||||
| 39459 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39460 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39461 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39462 | if (!unwrappedObj.ref()) { | ||||
| 39463 | return false; | ||||
| 39464 | } | ||||
| 39465 | } | ||||
| 39466 | FastErrorResult rv; | ||||
| 39467 | bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39468 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter" )), 0))) { | ||||
| 39469 | return false; | ||||
| 39470 | } | ||||
| 39471 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39471); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39471; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39472 | args.rval().setBoolean(result); | ||||
| 39473 | return true; | ||||
| 39474 | } | ||||
| 39475 | |||||
| 39476 | static const JSJitInfo conditionalOnSecureContext1_getterinfo = { | ||||
| 39477 | { get_conditionalOnSecureContext1 }, | ||||
| 39478 | { prototypes::id::TestJSImplInterface }, | ||||
| 39479 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39480 | JSJitInfo::Getter, | ||||
| 39481 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39482 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39483 | false, /* isInfallible. False in setters. */ | ||||
| 39484 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39485 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39486 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39487 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39488 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39489 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39490 | }; | ||||
| 39491 | |||||
| 39492 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39493 | get_conditionalOnSecureContext2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39494 | { | ||||
| 39495 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39498( cx, "TestJSImplInterface" , "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39496 | "TestJSImplInterface", "conditionalOnSecureContext2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39498( cx, "TestJSImplInterface" , "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39497 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39498( cx, "TestJSImplInterface" , "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39498 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39498( cx, "TestJSImplInterface" , "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39499 | |||||
| 39500 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39501 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39502 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39503 | if (objIsXray) { | ||||
| 39504 | unwrappedObj.emplace(cx, obj); | ||||
| 39505 | } | ||||
| 39506 | if (objIsXray) { | ||||
| 39507 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39508 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39509 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39510 | if (!unwrappedObj.ref()) { | ||||
| 39511 | return false; | ||||
| 39512 | } | ||||
| 39513 | } | ||||
| 39514 | FastErrorResult rv; | ||||
| 39515 | bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39516 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter" )), 0))) { | ||||
| 39517 | return false; | ||||
| 39518 | } | ||||
| 39519 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39519); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39519; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39520 | args.rval().setBoolean(result); | ||||
| 39521 | return true; | ||||
| 39522 | } | ||||
| 39523 | |||||
| 39524 | static const JSJitInfo conditionalOnSecureContext2_getterinfo = { | ||||
| 39525 | { get_conditionalOnSecureContext2 }, | ||||
| 39526 | { prototypes::id::TestJSImplInterface }, | ||||
| 39527 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39528 | JSJitInfo::Getter, | ||||
| 39529 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39530 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39531 | false, /* isInfallible. False in setters. */ | ||||
| 39532 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39533 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39534 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39535 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39536 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39537 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39538 | }; | ||||
| 39539 | |||||
| 39540 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39541 | get_conditionalOnSecureContext3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39542 | { | ||||
| 39543 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39546( cx, "TestJSImplInterface" , "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39544 | "TestJSImplInterface", "conditionalOnSecureContext3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39546( cx, "TestJSImplInterface" , "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39545 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39546( cx, "TestJSImplInterface" , "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39546 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39546( cx, "TestJSImplInterface" , "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39547 | |||||
| 39548 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39549 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39550 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39551 | if (objIsXray) { | ||||
| 39552 | unwrappedObj.emplace(cx, obj); | ||||
| 39553 | } | ||||
| 39554 | if (objIsXray) { | ||||
| 39555 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39556 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39557 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39558 | if (!unwrappedObj.ref()) { | ||||
| 39559 | return false; | ||||
| 39560 | } | ||||
| 39561 | } | ||||
| 39562 | FastErrorResult rv; | ||||
| 39563 | bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39564 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter" )), 0))) { | ||||
| 39565 | return false; | ||||
| 39566 | } | ||||
| 39567 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39567); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39567; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39568 | args.rval().setBoolean(result); | ||||
| 39569 | return true; | ||||
| 39570 | } | ||||
| 39571 | |||||
| 39572 | static const JSJitInfo conditionalOnSecureContext3_getterinfo = { | ||||
| 39573 | { get_conditionalOnSecureContext3 }, | ||||
| 39574 | { prototypes::id::TestJSImplInterface }, | ||||
| 39575 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39576 | JSJitInfo::Getter, | ||||
| 39577 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39578 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39579 | false, /* isInfallible. False in setters. */ | ||||
| 39580 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39581 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39582 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39583 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39584 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39585 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39586 | }; | ||||
| 39587 | |||||
| 39588 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39589 | get_conditionalOnSecureContext4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39590 | { | ||||
| 39591 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39594( cx, "TestJSImplInterface" , "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39592 | "TestJSImplInterface", "conditionalOnSecureContext4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39594( cx, "TestJSImplInterface" , "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39593 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39594( cx, "TestJSImplInterface" , "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39594 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39594( cx, "TestJSImplInterface" , "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39595 | |||||
| 39596 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39597 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39598 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39599 | if (objIsXray) { | ||||
| 39600 | unwrappedObj.emplace(cx, obj); | ||||
| 39601 | } | ||||
| 39602 | if (objIsXray) { | ||||
| 39603 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39604 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39605 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39606 | if (!unwrappedObj.ref()) { | ||||
| 39607 | return false; | ||||
| 39608 | } | ||||
| 39609 | } | ||||
| 39610 | FastErrorResult rv; | ||||
| 39611 | bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39612 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter" )), 0))) { | ||||
| 39613 | return false; | ||||
| 39614 | } | ||||
| 39615 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39615); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39615; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39616 | args.rval().setBoolean(result); | ||||
| 39617 | return true; | ||||
| 39618 | } | ||||
| 39619 | |||||
| 39620 | static const JSJitInfo conditionalOnSecureContext4_getterinfo = { | ||||
| 39621 | { get_conditionalOnSecureContext4 }, | ||||
| 39622 | { prototypes::id::TestJSImplInterface }, | ||||
| 39623 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39624 | JSJitInfo::Getter, | ||||
| 39625 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39626 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 39627 | false, /* isInfallible. False in setters. */ | ||||
| 39628 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39629 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39630 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39631 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39632 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39633 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39634 | }; | ||||
| 39635 | |||||
| 39636 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39637 | conditionalOnSecureContext5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39638 | { | ||||
| 39639 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39642( cx, "TestJSImplInterface" , "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39640 | "TestJSImplInterface", "conditionalOnSecureContext5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39642( cx, "TestJSImplInterface" , "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39641 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39642( cx, "TestJSImplInterface" , "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39642 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39642( cx, "TestJSImplInterface" , "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39643 | |||||
| 39644 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39645 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39646 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39647 | if (objIsXray) { | ||||
| 39648 | unwrappedObj.emplace(cx, obj); | ||||
| 39649 | } | ||||
| 39650 | if (objIsXray) { | ||||
| 39651 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39652 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39653 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39654 | if (!unwrappedObj.ref()) { | ||||
| 39655 | return false; | ||||
| 39656 | } | ||||
| 39657 | } | ||||
| 39658 | FastErrorResult rv; | ||||
| 39659 | // NOTE: This assert does NOT call the function. | ||||
| 39660 | 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"); | ||||
| 39661 | MOZ_KnownLive(self)(self)->ConditionalOnSecureContext5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39662 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5" )), 0))) { | ||||
| 39663 | return false; | ||||
| 39664 | } | ||||
| 39665 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39665); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39665; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39666 | args.rval().setUndefined(); | ||||
| 39667 | return true; | ||||
| 39668 | } | ||||
| 39669 | |||||
| 39670 | static const JSJitInfo conditionalOnSecureContext5_methodinfo = { | ||||
| 39671 | { (JSJitGetterOp)conditionalOnSecureContext5 }, | ||||
| 39672 | { prototypes::id::TestJSImplInterface }, | ||||
| 39673 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39674 | JSJitInfo::Method, | ||||
| 39675 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39676 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39677 | false, /* isInfallible. False in setters. */ | ||||
| 39678 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39679 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39680 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39681 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39682 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39683 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39684 | }; | ||||
| 39685 | |||||
| 39686 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39687 | conditionalOnSecureContext6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39688 | { | ||||
| 39689 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39692( cx, "TestJSImplInterface" , "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39690 | "TestJSImplInterface", "conditionalOnSecureContext6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39692( cx, "TestJSImplInterface" , "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39691 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39692( cx, "TestJSImplInterface" , "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39692 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39692( cx, "TestJSImplInterface" , "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39693 | |||||
| 39694 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39695 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39696 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39697 | if (objIsXray) { | ||||
| 39698 | unwrappedObj.emplace(cx, obj); | ||||
| 39699 | } | ||||
| 39700 | if (objIsXray) { | ||||
| 39701 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39702 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39703 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39704 | if (!unwrappedObj.ref()) { | ||||
| 39705 | return false; | ||||
| 39706 | } | ||||
| 39707 | } | ||||
| 39708 | FastErrorResult rv; | ||||
| 39709 | // NOTE: This assert does NOT call the function. | ||||
| 39710 | 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"); | ||||
| 39711 | MOZ_KnownLive(self)(self)->ConditionalOnSecureContext6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39712 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6" )), 0))) { | ||||
| 39713 | return false; | ||||
| 39714 | } | ||||
| 39715 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39715); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39715; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39716 | args.rval().setUndefined(); | ||||
| 39717 | return true; | ||||
| 39718 | } | ||||
| 39719 | |||||
| 39720 | static const JSJitInfo conditionalOnSecureContext6_methodinfo = { | ||||
| 39721 | { (JSJitGetterOp)conditionalOnSecureContext6 }, | ||||
| 39722 | { prototypes::id::TestJSImplInterface }, | ||||
| 39723 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39724 | JSJitInfo::Method, | ||||
| 39725 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39726 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39727 | false, /* isInfallible. False in setters. */ | ||||
| 39728 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39729 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39730 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39731 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39732 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39733 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39734 | }; | ||||
| 39735 | |||||
| 39736 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39737 | conditionalOnSecureContext7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39738 | { | ||||
| 39739 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39742( cx, "TestJSImplInterface" , "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39740 | "TestJSImplInterface", "conditionalOnSecureContext7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39742( cx, "TestJSImplInterface" , "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39741 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39742( cx, "TestJSImplInterface" , "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39742 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39742( cx, "TestJSImplInterface" , "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39743 | |||||
| 39744 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39745 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39746 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39747 | if (objIsXray) { | ||||
| 39748 | unwrappedObj.emplace(cx, obj); | ||||
| 39749 | } | ||||
| 39750 | if (objIsXray) { | ||||
| 39751 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39752 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39753 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39754 | if (!unwrappedObj.ref()) { | ||||
| 39755 | return false; | ||||
| 39756 | } | ||||
| 39757 | } | ||||
| 39758 | FastErrorResult rv; | ||||
| 39759 | // NOTE: This assert does NOT call the function. | ||||
| 39760 | 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"); | ||||
| 39761 | MOZ_KnownLive(self)(self)->ConditionalOnSecureContext7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39762 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7" )), 0))) { | ||||
| 39763 | return false; | ||||
| 39764 | } | ||||
| 39765 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39765); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39765; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39766 | args.rval().setUndefined(); | ||||
| 39767 | return true; | ||||
| 39768 | } | ||||
| 39769 | |||||
| 39770 | static const JSJitInfo conditionalOnSecureContext7_methodinfo = { | ||||
| 39771 | { (JSJitGetterOp)conditionalOnSecureContext7 }, | ||||
| 39772 | { prototypes::id::TestJSImplInterface }, | ||||
| 39773 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39774 | JSJitInfo::Method, | ||||
| 39775 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39776 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39777 | false, /* isInfallible. False in setters. */ | ||||
| 39778 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39779 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39780 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39781 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39782 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39783 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39784 | }; | ||||
| 39785 | |||||
| 39786 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39787 | conditionalOnSecureContext8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39788 | { | ||||
| 39789 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39792( cx, "TestJSImplInterface" , "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39790 | "TestJSImplInterface", "conditionalOnSecureContext8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39792( cx, "TestJSImplInterface" , "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39791 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39792( cx, "TestJSImplInterface" , "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 39792 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39792( cx, "TestJSImplInterface" , "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 39793 | |||||
| 39794 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39795 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39796 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39797 | if (objIsXray) { | ||||
| 39798 | unwrappedObj.emplace(cx, obj); | ||||
| 39799 | } | ||||
| 39800 | if (objIsXray) { | ||||
| 39801 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39802 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39803 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39804 | if (!unwrappedObj.ref()) { | ||||
| 39805 | return false; | ||||
| 39806 | } | ||||
| 39807 | } | ||||
| 39808 | FastErrorResult rv; | ||||
| 39809 | // NOTE: This assert does NOT call the function. | ||||
| 39810 | 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"); | ||||
| 39811 | MOZ_KnownLive(self)(self)->ConditionalOnSecureContext8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39812 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8" )), 0))) { | ||||
| 39813 | return false; | ||||
| 39814 | } | ||||
| 39815 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39815); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39815; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39816 | args.rval().setUndefined(); | ||||
| 39817 | return true; | ||||
| 39818 | } | ||||
| 39819 | |||||
| 39820 | static const JSJitInfo conditionalOnSecureContext8_methodinfo = { | ||||
| 39821 | { (JSJitGetterOp)conditionalOnSecureContext8 }, | ||||
| 39822 | { prototypes::id::TestJSImplInterface }, | ||||
| 39823 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39824 | JSJitInfo::Method, | ||||
| 39825 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39826 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39827 | false, /* isInfallible. False in setters. */ | ||||
| 39828 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39829 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39830 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39831 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39832 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39833 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39834 | }; | ||||
| 39835 | |||||
| 39836 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39837 | get_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 39838 | { | ||||
| 39839 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39842( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39840 | "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39842( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39841 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39842( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39842 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39842( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39843 | |||||
| 39844 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39845 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39846 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39847 | if (objIsXray) { | ||||
| 39848 | unwrappedObj.emplace(cx, obj); | ||||
| 39849 | } | ||||
| 39850 | if (objIsXray) { | ||||
| 39851 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39852 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39853 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39854 | if (!unwrappedObj.ref()) { | ||||
| 39855 | return false; | ||||
| 39856 | } | ||||
| 39857 | } | ||||
| 39858 | FastErrorResult rv; | ||||
| 39859 | int32_t result(MOZ_KnownLive(self)(self)->GetAttrWithLenientThis(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 39860 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter" )), 0))) { | ||||
| 39861 | return false; | ||||
| 39862 | } | ||||
| 39863 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39863); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39863; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39864 | args.rval().setInt32(int32_t(result)); | ||||
| 39865 | return true; | ||||
| 39866 | } | ||||
| 39867 | |||||
| 39868 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39869 | set_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 39870 | { | ||||
| 39871 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39874( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39872 | "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39874( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39873 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject39874( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39874 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39874( cx, "TestJSImplInterface" , "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39875 | |||||
| 39876 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39877 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39878 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39879 | if (objIsXray) { | ||||
| 39880 | unwrappedObj.emplace(cx, obj); | ||||
| 39881 | } | ||||
| 39882 | int32_t arg0; | ||||
| 39883 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 39884 | return false; | ||||
| 39885 | } | ||||
| 39886 | if (objIsXray) { | ||||
| 39887 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39888 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39889 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39890 | if (!unwrappedObj.ref()) { | ||||
| 39891 | return false; | ||||
| 39892 | } | ||||
| 39893 | } | ||||
| 39894 | FastErrorResult rv; | ||||
| 39895 | // NOTE: This assert does NOT call the function. | ||||
| 39896 | 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"); | ||||
| 39897 | MOZ_KnownLive(self)(self)->SetAttrWithLenientThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39898 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter" )), 0))) { | ||||
| 39899 | return false; | ||||
| 39900 | } | ||||
| 39901 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39901); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39901; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39902 | |||||
| 39903 | return true; | ||||
| 39904 | } | ||||
| 39905 | |||||
| 39906 | static const JSJitInfo attrWithLenientThis_getterinfo = { | ||||
| 39907 | { get_attrWithLenientThis }, | ||||
| 39908 | { prototypes::id::TestJSImplInterface }, | ||||
| 39909 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39910 | JSJitInfo::Getter, | ||||
| 39911 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39912 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 39913 | false, /* isInfallible. False in setters. */ | ||||
| 39914 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39915 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39916 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39917 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39918 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39919 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39920 | }; | ||||
| 39921 | static const JSJitInfo attrWithLenientThis_setterinfo = { | ||||
| 39922 | { (JSJitGetterOp)set_attrWithLenientThis }, | ||||
| 39923 | { prototypes::id::TestJSImplInterface }, | ||||
| 39924 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39925 | JSJitInfo::Setter, | ||||
| 39926 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39927 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39928 | false, /* isInfallible. False in setters. */ | ||||
| 39929 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39930 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39931 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 39932 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 39933 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 39934 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 39935 | }; | ||||
| 39936 | |||||
| 39937 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 39938 | passRenamedInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 39939 | { | ||||
| 39940 | BindingCallContext cx(cx_, "TestJSImplInterface.passRenamedInterface"); | ||||
| 39941 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39944( cx, "TestJSImplInterface" , "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39942 | "TestJSImplInterface", "passRenamedInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39944( cx, "TestJSImplInterface" , "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39943 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39944( cx, "TestJSImplInterface" , "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 39944 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39944( cx, "TestJSImplInterface" , "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 39945 | |||||
| 39946 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 39947 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passRenamedInterface", 1)) { | ||||
| 39948 | return false; | ||||
| 39949 | } | ||||
| 39950 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 39951 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 39952 | if (objIsXray) { | ||||
| 39953 | unwrappedObj.emplace(cx, obj); | ||||
| 39954 | } | ||||
| 39955 | NonNull<nsRenamedInterface> arg0; | ||||
| 39956 | if (args[0].isObject()) { | ||||
| 39957 | { | ||||
| 39958 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 39959 | nsresult rv = UnwrapObject<prototypes::id::TestRenamedInterface, nsRenamedInterface>(args[0], arg0, cx); | ||||
| 39960 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 39961 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestRenamedInterface"); | ||||
| 39962 | return false; | ||||
| 39963 | } | ||||
| 39964 | } | ||||
| 39965 | } else { | ||||
| 39966 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 39967 | return false; | ||||
| 39968 | } | ||||
| 39969 | if (objIsXray) { | ||||
| 39970 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 39971 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 39972 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 39973 | if (!unwrappedObj.ref()) { | ||||
| 39974 | return false; | ||||
| 39975 | } | ||||
| 39976 | } | ||||
| 39977 | FastErrorResult rv; | ||||
| 39978 | // NOTE: This assert does NOT call the function. | ||||
| 39979 | 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"); | ||||
| 39980 | MOZ_KnownLive(self)(self)->PassRenamedInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 39981 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface" )), 0))) { | ||||
| 39982 | return false; | ||||
| 39983 | } | ||||
| 39984 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 39984); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 39984; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 39985 | args.rval().setUndefined(); | ||||
| 39986 | return true; | ||||
| 39987 | } | ||||
| 39988 | |||||
| 39989 | static const JSJitInfo passRenamedInterface_methodinfo = { | ||||
| 39990 | { (JSJitGetterOp)passRenamedInterface }, | ||||
| 39991 | { prototypes::id::TestJSImplInterface }, | ||||
| 39992 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 39993 | JSJitInfo::Method, | ||||
| 39994 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 39995 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 39996 | false, /* isInfallible. False in setters. */ | ||||
| 39997 | false, /* isMovable. Not relevant for setters. */ | ||||
| 39998 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 39999 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40000 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40001 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40002 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40003 | }; | ||||
| 40004 | |||||
| 40005 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40006 | get_putForwardsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40007 | { | ||||
| 40008 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40011( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40009 | "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40011( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40010 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40011( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40011 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40011( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40012 | |||||
| 40013 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40014 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40015 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40016 | if (objIsXray) { | ||||
| 40017 | unwrappedObj.emplace(cx, obj); | ||||
| 40018 | } | ||||
| 40019 | if (objIsXray) { | ||||
| 40020 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40021 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40022 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40023 | if (!unwrappedObj.ref()) { | ||||
| 40024 | return false; | ||||
| 40025 | } | ||||
| 40026 | } | ||||
| 40027 | FastErrorResult rv; | ||||
| 40028 | auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 40029 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter" )), 0))) { | ||||
| 40030 | return false; | ||||
| 40031 | } | ||||
| 40032 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40032); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40032; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40033 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | ||||
| 40034 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40034); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 40034; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 40035 | return false; | ||||
| 40036 | } | ||||
| 40037 | return true; | ||||
| 40038 | } | ||||
| 40039 | |||||
| 40040 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40041 | set_putForwardsAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40042 | { | ||||
| 40043 | BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr setter"); | ||||
| 40044 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40047( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40045 | "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40047( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40046 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40047( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40047 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40047( cx, "TestJSImplInterface" , "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40048 | |||||
| 40049 | JS::Rooted<JS::Value> v(cx); | ||||
| 40050 | if (!JS_GetProperty(cx, obj, "putForwardsAttr", &v)) { | ||||
| 40051 | return false; | ||||
| 40052 | } | ||||
| 40053 | |||||
| 40054 | if (!v.isObject()) { | ||||
| 40055 | return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr"); | ||||
| 40056 | } | ||||
| 40057 | |||||
| 40058 | JS::Rooted<JSObject*> targetObj(cx, &v.toObject()); | ||||
| 40059 | return JS_SetProperty(cx, targetObj, "writableByte", args[0]); | ||||
| 40060 | } | ||||
| 40061 | |||||
| 40062 | static const JSJitInfo putForwardsAttr_getterinfo = { | ||||
| 40063 | { get_putForwardsAttr }, | ||||
| 40064 | { prototypes::id::TestJSImplInterface }, | ||||
| 40065 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40066 | JSJitInfo::Getter, | ||||
| 40067 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40068 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 40069 | false, /* isInfallible. False in setters. */ | ||||
| 40070 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40071 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40072 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40073 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40074 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40075 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40076 | }; | ||||
| 40077 | static const JSJitInfo putForwardsAttr_setterinfo = { | ||||
| 40078 | { (JSJitGetterOp)set_putForwardsAttr }, | ||||
| 40079 | { prototypes::id::TestJSImplInterface }, | ||||
| 40080 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40081 | JSJitInfo::Setter, | ||||
| 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 | |||||
| 40093 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40094 | get_putForwardsAttr2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40095 | { | ||||
| 40096 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface" , "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40097 | "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface" , "putForwardsAttr2", 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" , "putForwardsAttr2", 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" , "putForwardsAttr2", 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)->GetPutForwardsAttr2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 40117 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 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 { *(( volatile int*)__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 { *((volatile int*)__null) = 40122; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 40123 | return false; | ||||
| 40124 | } | ||||
| 40125 | return true; | ||||
| 40126 | } | ||||
| 40127 | |||||
| 40128 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40129 | set_putForwardsAttr2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40130 | { | ||||
| 40131 | BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr2 setter"); | ||||
| 40132 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface" , "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40133 | "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface" , "putForwardsAttr2", 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" , "putForwardsAttr2", 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" , "putForwardsAttr2", 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, "putForwardsAttr2", &v)) { | ||||
| 40139 | return false; | ||||
| 40140 | } | ||||
| 40141 | |||||
| 40142 | if (!v.isObject()) { | ||||
| 40143 | return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr2"); | ||||
| 40144 | } | ||||
| 40145 | |||||
| 40146 | JS::Rooted<JSObject*> targetObj(cx, &v.toObject()); | ||||
| 40147 | return JS_SetProperty(cx, targetObj, "writableByte", args[0]); | ||||
| 40148 | } | ||||
| 40149 | |||||
| 40150 | static const JSJitInfo putForwardsAttr2_getterinfo = { | ||||
| 40151 | { get_putForwardsAttr2 }, | ||||
| 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 | }; | ||||
| 40165 | static const JSJitInfo putForwardsAttr2_setterinfo = { | ||||
| 40166 | { (JSJitGetterOp)set_putForwardsAttr2 }, | ||||
| 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 | |||||
| 40181 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40182 | get_putForwardsAttr3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40183 | { | ||||
| 40184 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface" , "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40185 | "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface" , "putForwardsAttr3", 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" , "putForwardsAttr3", 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" , "putForwardsAttr3", 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)->GetPutForwardsAttr3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 40205 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 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 { *(( volatile int*)__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 { *((volatile int*)__null) = 40210; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 40211 | return false; | ||||
| 40212 | } | ||||
| 40213 | return true; | ||||
| 40214 | } | ||||
| 40215 | |||||
| 40216 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40217 | set_putForwardsAttr3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40218 | { | ||||
| 40219 | BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr3 setter"); | ||||
| 40220 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface" , "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40221 | "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface" , "putForwardsAttr3", 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" , "putForwardsAttr3", 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" , "putForwardsAttr3", 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, "putForwardsAttr3", &v)) { | ||||
| 40227 | return false; | ||||
| 40228 | } | ||||
| 40229 | |||||
| 40230 | if (!v.isObject()) { | ||||
| 40231 | return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr3"); | ||||
| 40232 | } | ||||
| 40233 | |||||
| 40234 | JS::Rooted<JSObject*> targetObj(cx, &v.toObject()); | ||||
| 40235 | return JS_SetProperty(cx, targetObj, "writableByte", args[0]); | ||||
| 40236 | } | ||||
| 40237 | |||||
| 40238 | static const JSJitInfo putForwardsAttr3_getterinfo = { | ||||
| 40239 | { get_putForwardsAttr3 }, | ||||
| 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 | }; | ||||
| 40253 | static const JSJitInfo putForwardsAttr3_setterinfo = { | ||||
| 40254 | { (JSJitGetterOp)set_putForwardsAttr3 }, | ||||
| 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 | |||||
| 40269 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40270 | throwingMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 40271 | { | ||||
| 40272 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface" , "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40273 | "TestJSImplInterface", "throwingMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface" , "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40274 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface" , "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40275 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface" , "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | 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 | // NOTE: This assert does NOT call the function. | ||||
| 40293 | 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"); | ||||
| 40294 | MOZ_KnownLive(self)(self)->ThrowingMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40295 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod" )), 0))) { | ||||
| 40296 | return false; | ||||
| 40297 | } | ||||
| 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 { *(( volatile int*)__null) = 40298; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40299 | args.rval().setUndefined(); | ||||
| 40300 | return true; | ||||
| 40301 | } | ||||
| 40302 | |||||
| 40303 | static const JSJitInfo throwingMethod_methodinfo = { | ||||
| 40304 | { (JSJitGetterOp)throwingMethod }, | ||||
| 40305 | { prototypes::id::TestJSImplInterface }, | ||||
| 40306 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40307 | JSJitInfo::Method, | ||||
| 40308 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40309 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40310 | false, /* isInfallible. False in setters. */ | ||||
| 40311 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40312 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40313 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40314 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40315 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40316 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40317 | }; | ||||
| 40318 | |||||
| 40319 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40320 | get_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40321 | { | ||||
| 40322 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40325( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40323 | "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40325( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40324 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40325( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40325 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40325( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40326 | |||||
| 40327 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40328 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40329 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40330 | if (objIsXray) { | ||||
| 40331 | unwrappedObj.emplace(cx, obj); | ||||
| 40332 | } | ||||
| 40333 | if (objIsXray) { | ||||
| 40334 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40335 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40336 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40337 | if (!unwrappedObj.ref()) { | ||||
| 40338 | return false; | ||||
| 40339 | } | ||||
| 40340 | } | ||||
| 40341 | FastErrorResult rv; | ||||
| 40342 | bool result(MOZ_KnownLive(self)(self)->GetThrowingAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40343 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter" )), 0))) { | ||||
| 40344 | return false; | ||||
| 40345 | } | ||||
| 40346 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40346); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40346; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40347 | args.rval().setBoolean(result); | ||||
| 40348 | return true; | ||||
| 40349 | } | ||||
| 40350 | |||||
| 40351 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40352 | set_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40353 | { | ||||
| 40354 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40357( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40355 | "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40357( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40356 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40357( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40357 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40357( cx, "TestJSImplInterface" , "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40358 | |||||
| 40359 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40360 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40361 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40362 | if (objIsXray) { | ||||
| 40363 | unwrappedObj.emplace(cx, obj); | ||||
| 40364 | } | ||||
| 40365 | bool arg0; | ||||
| 40366 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40367 | return false; | ||||
| 40368 | } | ||||
| 40369 | if (objIsXray) { | ||||
| 40370 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40371 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40372 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40373 | if (!unwrappedObj.ref()) { | ||||
| 40374 | return false; | ||||
| 40375 | } | ||||
| 40376 | } | ||||
| 40377 | FastErrorResult rv; | ||||
| 40378 | // NOTE: This assert does NOT call the function. | ||||
| 40379 | 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"); | ||||
| 40380 | MOZ_KnownLive(self)(self)->SetThrowingAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40381 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter" )), 0))) { | ||||
| 40382 | return false; | ||||
| 40383 | } | ||||
| 40384 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40384); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40384; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40385 | |||||
| 40386 | return true; | ||||
| 40387 | } | ||||
| 40388 | |||||
| 40389 | static const JSJitInfo throwingAttr_getterinfo = { | ||||
| 40390 | { get_throwingAttr }, | ||||
| 40391 | { prototypes::id::TestJSImplInterface }, | ||||
| 40392 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40393 | JSJitInfo::Getter, | ||||
| 40394 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40395 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40396 | false, /* isInfallible. False in setters. */ | ||||
| 40397 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40398 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40399 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40400 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40401 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40402 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40403 | }; | ||||
| 40404 | static const JSJitInfo throwingAttr_setterinfo = { | ||||
| 40405 | { (JSJitGetterOp)set_throwingAttr }, | ||||
| 40406 | { prototypes::id::TestJSImplInterface }, | ||||
| 40407 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40408 | JSJitInfo::Setter, | ||||
| 40409 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40410 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40411 | false, /* isInfallible. False in setters. */ | ||||
| 40412 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40413 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40414 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40415 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40416 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40417 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40418 | }; | ||||
| 40419 | |||||
| 40420 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40421 | get_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40422 | { | ||||
| 40423 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40426( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40424 | "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40426( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40425 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40426( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40426 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40426( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40427 | |||||
| 40428 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40429 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40430 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40431 | if (objIsXray) { | ||||
| 40432 | unwrappedObj.emplace(cx, obj); | ||||
| 40433 | } | ||||
| 40434 | if (objIsXray) { | ||||
| 40435 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40436 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40437 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40438 | if (!unwrappedObj.ref()) { | ||||
| 40439 | return false; | ||||
| 40440 | } | ||||
| 40441 | } | ||||
| 40442 | FastErrorResult rv; | ||||
| 40443 | bool result(MOZ_KnownLive(self)(self)->GetThrowingGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40444 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter" )), 0))) { | ||||
| 40445 | return false; | ||||
| 40446 | } | ||||
| 40447 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40447); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40447; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40448 | args.rval().setBoolean(result); | ||||
| 40449 | return true; | ||||
| 40450 | } | ||||
| 40451 | |||||
| 40452 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40453 | set_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40454 | { | ||||
| 40455 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40458( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40456 | "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40458( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40457 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40458( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40458 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40458( cx, "TestJSImplInterface" , "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40459 | |||||
| 40460 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40461 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40462 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40463 | if (objIsXray) { | ||||
| 40464 | unwrappedObj.emplace(cx, obj); | ||||
| 40465 | } | ||||
| 40466 | bool arg0; | ||||
| 40467 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40468 | return false; | ||||
| 40469 | } | ||||
| 40470 | if (objIsXray) { | ||||
| 40471 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40472 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40473 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40474 | if (!unwrappedObj.ref()) { | ||||
| 40475 | return false; | ||||
| 40476 | } | ||||
| 40477 | } | ||||
| 40478 | FastErrorResult rv; | ||||
| 40479 | // NOTE: This assert does NOT call the function. | ||||
| 40480 | 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"); | ||||
| 40481 | MOZ_KnownLive(self)(self)->SetThrowingGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40482 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter" )), 0))) { | ||||
| 40483 | return false; | ||||
| 40484 | } | ||||
| 40485 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40485); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40485; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40486 | |||||
| 40487 | return true; | ||||
| 40488 | } | ||||
| 40489 | |||||
| 40490 | static const JSJitInfo throwingGetterAttr_getterinfo = { | ||||
| 40491 | { get_throwingGetterAttr }, | ||||
| 40492 | { prototypes::id::TestJSImplInterface }, | ||||
| 40493 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40494 | JSJitInfo::Getter, | ||||
| 40495 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40496 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40497 | false, /* isInfallible. False in setters. */ | ||||
| 40498 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40499 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40500 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40501 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40502 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40503 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40504 | }; | ||||
| 40505 | static const JSJitInfo throwingGetterAttr_setterinfo = { | ||||
| 40506 | { (JSJitGetterOp)set_throwingGetterAttr }, | ||||
| 40507 | { prototypes::id::TestJSImplInterface }, | ||||
| 40508 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40509 | JSJitInfo::Setter, | ||||
| 40510 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40511 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40512 | false, /* isInfallible. False in setters. */ | ||||
| 40513 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40514 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40515 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40516 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40517 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40518 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40519 | }; | ||||
| 40520 | |||||
| 40521 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40522 | get_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40523 | { | ||||
| 40524 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40527( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40525 | "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40527( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40526 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40527( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40527 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40527( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40528 | |||||
| 40529 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40530 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40531 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40532 | if (objIsXray) { | ||||
| 40533 | unwrappedObj.emplace(cx, obj); | ||||
| 40534 | } | ||||
| 40535 | if (objIsXray) { | ||||
| 40536 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40537 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40538 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40539 | if (!unwrappedObj.ref()) { | ||||
| 40540 | return false; | ||||
| 40541 | } | ||||
| 40542 | } | ||||
| 40543 | FastErrorResult rv; | ||||
| 40544 | bool result(MOZ_KnownLive(self)(self)->GetThrowingSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40545 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter" )), 0))) { | ||||
| 40546 | return false; | ||||
| 40547 | } | ||||
| 40548 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40548); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40548; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40549 | args.rval().setBoolean(result); | ||||
| 40550 | return true; | ||||
| 40551 | } | ||||
| 40552 | |||||
| 40553 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40554 | set_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40555 | { | ||||
| 40556 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40559( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40557 | "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40559( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40558 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40559( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40559 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40559( cx, "TestJSImplInterface" , "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40560 | |||||
| 40561 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40562 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40563 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40564 | if (objIsXray) { | ||||
| 40565 | unwrappedObj.emplace(cx, obj); | ||||
| 40566 | } | ||||
| 40567 | bool arg0; | ||||
| 40568 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40569 | return false; | ||||
| 40570 | } | ||||
| 40571 | if (objIsXray) { | ||||
| 40572 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40573 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40574 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40575 | if (!unwrappedObj.ref()) { | ||||
| 40576 | return false; | ||||
| 40577 | } | ||||
| 40578 | } | ||||
| 40579 | FastErrorResult rv; | ||||
| 40580 | // NOTE: This assert does NOT call the function. | ||||
| 40581 | 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"); | ||||
| 40582 | MOZ_KnownLive(self)(self)->SetThrowingSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40583 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter" )), 0))) { | ||||
| 40584 | return false; | ||||
| 40585 | } | ||||
| 40586 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40586); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40586; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40587 | |||||
| 40588 | return true; | ||||
| 40589 | } | ||||
| 40590 | |||||
| 40591 | static const JSJitInfo throwingSetterAttr_getterinfo = { | ||||
| 40592 | { get_throwingSetterAttr }, | ||||
| 40593 | { prototypes::id::TestJSImplInterface }, | ||||
| 40594 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40595 | JSJitInfo::Getter, | ||||
| 40596 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40597 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40598 | false, /* isInfallible. False in setters. */ | ||||
| 40599 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40600 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40601 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40602 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40603 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40604 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40605 | }; | ||||
| 40606 | static const JSJitInfo throwingSetterAttr_setterinfo = { | ||||
| 40607 | { (JSJitGetterOp)set_throwingSetterAttr }, | ||||
| 40608 | { prototypes::id::TestJSImplInterface }, | ||||
| 40609 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40610 | JSJitInfo::Setter, | ||||
| 40611 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40612 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40613 | false, /* isInfallible. False in setters. */ | ||||
| 40614 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40615 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40616 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40617 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40618 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40619 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40620 | }; | ||||
| 40621 | |||||
| 40622 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40623 | canOOMMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 40624 | { | ||||
| 40625 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40628( cx, "TestJSImplInterface" , "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40626 | "TestJSImplInterface", "canOOMMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40628( cx, "TestJSImplInterface" , "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40627 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40628( cx, "TestJSImplInterface" , "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40628 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40628( cx, "TestJSImplInterface" , "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40629 | |||||
| 40630 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40631 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40632 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40633 | if (objIsXray) { | ||||
| 40634 | unwrappedObj.emplace(cx, obj); | ||||
| 40635 | } | ||||
| 40636 | if (objIsXray) { | ||||
| 40637 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40638 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40639 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40640 | if (!unwrappedObj.ref()) { | ||||
| 40641 | return false; | ||||
| 40642 | } | ||||
| 40643 | } | ||||
| 40644 | FastErrorResult rv; | ||||
| 40645 | // NOTE: This assert does NOT call the function. | ||||
| 40646 | 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"); | ||||
| 40647 | MOZ_KnownLive(self)(self)->CanOOMMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40648 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod" )), 0))) { | ||||
| 40649 | return false; | ||||
| 40650 | } | ||||
| 40651 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40651); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40651; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40652 | args.rval().setUndefined(); | ||||
| 40653 | return true; | ||||
| 40654 | } | ||||
| 40655 | |||||
| 40656 | static const JSJitInfo canOOMMethod_methodinfo = { | ||||
| 40657 | { (JSJitGetterOp)canOOMMethod }, | ||||
| 40658 | { prototypes::id::TestJSImplInterface }, | ||||
| 40659 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40660 | JSJitInfo::Method, | ||||
| 40661 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40662 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40663 | false, /* isInfallible. False in setters. */ | ||||
| 40664 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40665 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40666 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40667 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40668 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40669 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40670 | }; | ||||
| 40671 | |||||
| 40672 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40673 | get_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40674 | { | ||||
| 40675 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40678( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40676 | "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40678( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40677 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40678( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40678 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40678( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40679 | |||||
| 40680 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40681 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40682 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40683 | if (objIsXray) { | ||||
| 40684 | unwrappedObj.emplace(cx, obj); | ||||
| 40685 | } | ||||
| 40686 | if (objIsXray) { | ||||
| 40687 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40688 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40689 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40690 | if (!unwrappedObj.ref()) { | ||||
| 40691 | return false; | ||||
| 40692 | } | ||||
| 40693 | } | ||||
| 40694 | FastErrorResult rv; | ||||
| 40695 | bool result(MOZ_KnownLive(self)(self)->GetCanOOMAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40696 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter" )), 0))) { | ||||
| 40697 | return false; | ||||
| 40698 | } | ||||
| 40699 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40699); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40699; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40700 | args.rval().setBoolean(result); | ||||
| 40701 | return true; | ||||
| 40702 | } | ||||
| 40703 | |||||
| 40704 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40705 | set_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40706 | { | ||||
| 40707 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40710( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40708 | "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40710( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40709 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40710( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40710 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40710( cx, "TestJSImplInterface" , "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40711 | |||||
| 40712 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40713 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40714 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40715 | if (objIsXray) { | ||||
| 40716 | unwrappedObj.emplace(cx, obj); | ||||
| 40717 | } | ||||
| 40718 | bool arg0; | ||||
| 40719 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40720 | return false; | ||||
| 40721 | } | ||||
| 40722 | if (objIsXray) { | ||||
| 40723 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40724 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40725 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40726 | if (!unwrappedObj.ref()) { | ||||
| 40727 | return false; | ||||
| 40728 | } | ||||
| 40729 | } | ||||
| 40730 | FastErrorResult rv; | ||||
| 40731 | // NOTE: This assert does NOT call the function. | ||||
| 40732 | 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"); | ||||
| 40733 | MOZ_KnownLive(self)(self)->SetCanOOMAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40734 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter" )), 0))) { | ||||
| 40735 | return false; | ||||
| 40736 | } | ||||
| 40737 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40737); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40737; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40738 | |||||
| 40739 | return true; | ||||
| 40740 | } | ||||
| 40741 | |||||
| 40742 | static const JSJitInfo canOOMAttr_getterinfo = { | ||||
| 40743 | { get_canOOMAttr }, | ||||
| 40744 | { prototypes::id::TestJSImplInterface }, | ||||
| 40745 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40746 | JSJitInfo::Getter, | ||||
| 40747 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40748 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40749 | false, /* isInfallible. False in setters. */ | ||||
| 40750 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40751 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40752 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40753 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40754 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40755 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40756 | }; | ||||
| 40757 | static const JSJitInfo canOOMAttr_setterinfo = { | ||||
| 40758 | { (JSJitGetterOp)set_canOOMAttr }, | ||||
| 40759 | { prototypes::id::TestJSImplInterface }, | ||||
| 40760 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40761 | JSJitInfo::Setter, | ||||
| 40762 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40763 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40764 | false, /* isInfallible. False in setters. */ | ||||
| 40765 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40766 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40767 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40768 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40769 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40770 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40771 | }; | ||||
| 40772 | |||||
| 40773 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40774 | get_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40775 | { | ||||
| 40776 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40779( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40777 | "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40779( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40778 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40779( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40779 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40779( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40780 | |||||
| 40781 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40782 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40783 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40784 | if (objIsXray) { | ||||
| 40785 | unwrappedObj.emplace(cx, obj); | ||||
| 40786 | } | ||||
| 40787 | if (objIsXray) { | ||||
| 40788 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40789 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40790 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40791 | if (!unwrappedObj.ref()) { | ||||
| 40792 | return false; | ||||
| 40793 | } | ||||
| 40794 | } | ||||
| 40795 | FastErrorResult rv; | ||||
| 40796 | bool result(MOZ_KnownLive(self)(self)->GetCanOOMGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40797 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter" )), 0))) { | ||||
| 40798 | return false; | ||||
| 40799 | } | ||||
| 40800 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40800); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40800; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40801 | args.rval().setBoolean(result); | ||||
| 40802 | return true; | ||||
| 40803 | } | ||||
| 40804 | |||||
| 40805 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40806 | set_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40807 | { | ||||
| 40808 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40811( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40809 | "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40811( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40810 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40811( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40811 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40811( cx, "TestJSImplInterface" , "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40812 | |||||
| 40813 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40814 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40815 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40816 | if (objIsXray) { | ||||
| 40817 | unwrappedObj.emplace(cx, obj); | ||||
| 40818 | } | ||||
| 40819 | bool arg0; | ||||
| 40820 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40821 | return false; | ||||
| 40822 | } | ||||
| 40823 | if (objIsXray) { | ||||
| 40824 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40825 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40826 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40827 | if (!unwrappedObj.ref()) { | ||||
| 40828 | return false; | ||||
| 40829 | } | ||||
| 40830 | } | ||||
| 40831 | FastErrorResult rv; | ||||
| 40832 | // NOTE: This assert does NOT call the function. | ||||
| 40833 | 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"); | ||||
| 40834 | MOZ_KnownLive(self)(self)->SetCanOOMGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40835 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter" )), 0))) { | ||||
| 40836 | return false; | ||||
| 40837 | } | ||||
| 40838 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40838); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40838; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40839 | |||||
| 40840 | return true; | ||||
| 40841 | } | ||||
| 40842 | |||||
| 40843 | static const JSJitInfo canOOMGetterAttr_getterinfo = { | ||||
| 40844 | { get_canOOMGetterAttr }, | ||||
| 40845 | { prototypes::id::TestJSImplInterface }, | ||||
| 40846 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40847 | JSJitInfo::Getter, | ||||
| 40848 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40849 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40850 | false, /* isInfallible. False in setters. */ | ||||
| 40851 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40852 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40853 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40854 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40855 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40856 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40857 | }; | ||||
| 40858 | static const JSJitInfo canOOMGetterAttr_setterinfo = { | ||||
| 40859 | { (JSJitGetterOp)set_canOOMGetterAttr }, | ||||
| 40860 | { prototypes::id::TestJSImplInterface }, | ||||
| 40861 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40862 | JSJitInfo::Setter, | ||||
| 40863 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40864 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40865 | false, /* isInfallible. False in setters. */ | ||||
| 40866 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40867 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40868 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40869 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40870 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40871 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40872 | }; | ||||
| 40873 | |||||
| 40874 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40875 | get_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 40876 | { | ||||
| 40877 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40880( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40878 | "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40880( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40879 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40880( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40880 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40880( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40881 | |||||
| 40882 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40883 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40884 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40885 | if (objIsXray) { | ||||
| 40886 | unwrappedObj.emplace(cx, obj); | ||||
| 40887 | } | ||||
| 40888 | if (objIsXray) { | ||||
| 40889 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40890 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40891 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40892 | if (!unwrappedObj.ref()) { | ||||
| 40893 | return false; | ||||
| 40894 | } | ||||
| 40895 | } | ||||
| 40896 | FastErrorResult rv; | ||||
| 40897 | bool result(MOZ_KnownLive(self)(self)->GetCanOOMSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 40898 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter" )), 0))) { | ||||
| 40899 | return false; | ||||
| 40900 | } | ||||
| 40901 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40901); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40901; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40902 | args.rval().setBoolean(result); | ||||
| 40903 | return true; | ||||
| 40904 | } | ||||
| 40905 | |||||
| 40906 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40907 | set_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 40908 | { | ||||
| 40909 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40912( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40910 | "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40912( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40911 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40912( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40912 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40912( cx, "TestJSImplInterface" , "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40913 | |||||
| 40914 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40915 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40916 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40917 | if (objIsXray) { | ||||
| 40918 | unwrappedObj.emplace(cx, obj); | ||||
| 40919 | } | ||||
| 40920 | bool arg0; | ||||
| 40921 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 40922 | return false; | ||||
| 40923 | } | ||||
| 40924 | if (objIsXray) { | ||||
| 40925 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40926 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40927 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40928 | if (!unwrappedObj.ref()) { | ||||
| 40929 | return false; | ||||
| 40930 | } | ||||
| 40931 | } | ||||
| 40932 | FastErrorResult rv; | ||||
| 40933 | // NOTE: This assert does NOT call the function. | ||||
| 40934 | 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"); | ||||
| 40935 | MOZ_KnownLive(self)(self)->SetCanOOMSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 40936 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter" )), 0))) { | ||||
| 40937 | return false; | ||||
| 40938 | } | ||||
| 40939 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 40939); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 40939; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 40940 | |||||
| 40941 | return true; | ||||
| 40942 | } | ||||
| 40943 | |||||
| 40944 | static const JSJitInfo canOOMSetterAttr_getterinfo = { | ||||
| 40945 | { get_canOOMSetterAttr }, | ||||
| 40946 | { prototypes::id::TestJSImplInterface }, | ||||
| 40947 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40948 | JSJitInfo::Getter, | ||||
| 40949 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40950 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 40951 | false, /* isInfallible. False in setters. */ | ||||
| 40952 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40953 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40954 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40955 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40956 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40957 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40958 | }; | ||||
| 40959 | static const JSJitInfo canOOMSetterAttr_setterinfo = { | ||||
| 40960 | { (JSJitGetterOp)set_canOOMSetterAttr }, | ||||
| 40961 | { prototypes::id::TestJSImplInterface }, | ||||
| 40962 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 40963 | JSJitInfo::Setter, | ||||
| 40964 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 40965 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 40966 | false, /* isInfallible. False in setters. */ | ||||
| 40967 | false, /* isMovable. Not relevant for setters. */ | ||||
| 40968 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 40969 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 40970 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 40971 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 40972 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 40973 | }; | ||||
| 40974 | |||||
| 40975 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 40976 | ceReactionsMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 40977 | { | ||||
| 40978 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40981( cx, "TestJSImplInterface" , "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40979 | "TestJSImplInterface", "ceReactionsMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40981( cx, "TestJSImplInterface" , "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40980 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40981( cx, "TestJSImplInterface" , "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 40981 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40981( cx, "TestJSImplInterface" , "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 40982 | |||||
| 40983 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 40984 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 40985 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 40986 | if (objIsXray) { | ||||
| 40987 | unwrappedObj.emplace(cx, obj); | ||||
| 40988 | } | ||||
| 40989 | if (objIsXray) { | ||||
| 40990 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 40991 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 40992 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 40993 | if (!unwrappedObj.ref()) { | ||||
| 40994 | return false; | ||||
| 40995 | } | ||||
| 40996 | } | ||||
| 40997 | Maybe<AutoCEReaction> ceReaction; | ||||
| 40998 | DocGroup* docGroup = self->GetDocGroup(); | ||||
| 40999 | if (docGroup) { | ||||
| 41000 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); | ||||
| 41001 | } | ||||
| 41002 | FastErrorResult rv; | ||||
| 41003 | // NOTE: This assert does NOT call the function. | ||||
| 41004 | 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"); | ||||
| 41005 | MOZ_KnownLive(self)(self)->CeReactionsMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41006 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod" )), 0))) { | ||||
| 41007 | return false; | ||||
| 41008 | } | ||||
| 41009 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41009); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41009; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41010 | args.rval().setUndefined(); | ||||
| 41011 | return true; | ||||
| 41012 | } | ||||
| 41013 | |||||
| 41014 | static const JSJitInfo ceReactionsMethod_methodinfo = { | ||||
| 41015 | { (JSJitGetterOp)ceReactionsMethod }, | ||||
| 41016 | { prototypes::id::TestJSImplInterface }, | ||||
| 41017 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41018 | JSJitInfo::Method, | ||||
| 41019 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41020 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41021 | false, /* isInfallible. False in setters. */ | ||||
| 41022 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41023 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41024 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41025 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41026 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41027 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41028 | }; | ||||
| 41029 | |||||
| 41030 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41031 | ceReactionsMethodOverload(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 41032 | { | ||||
| 41033 | BindingCallContext cx(cx_, "TestJSImplInterface.ceReactionsMethodOverload"); | ||||
| 41034 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41037( cx, "TestJSImplInterface" , "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41035 | "TestJSImplInterface", "ceReactionsMethodOverload", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41037( cx, "TestJSImplInterface" , "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41036 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41037( cx, "TestJSImplInterface" , "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41037 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41037( cx, "TestJSImplInterface" , "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 41038 | |||||
| 41039 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41040 | unsigned argcount = std::min(args.length(), 1u); | ||||
| 41041 | switch (argcount) { | ||||
| 41042 | case 0: { | ||||
| 41043 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41044 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41045 | if (objIsXray) { | ||||
| 41046 | unwrappedObj.emplace(cx, obj); | ||||
| 41047 | } | ||||
| 41048 | if (objIsXray) { | ||||
| 41049 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41050 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41051 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41052 | if (!unwrappedObj.ref()) { | ||||
| 41053 | return false; | ||||
| 41054 | } | ||||
| 41055 | } | ||||
| 41056 | Maybe<AutoCEReaction> ceReaction; | ||||
| 41057 | DocGroup* docGroup = self->GetDocGroup(); | ||||
| 41058 | if (docGroup) { | ||||
| 41059 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); | ||||
| 41060 | } | ||||
| 41061 | FastErrorResult rv; | ||||
| 41062 | // NOTE: This assert does NOT call the function. | ||||
| 41063 | 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"); | ||||
| 41064 | MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41065 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload" )), 0))) { | ||||
| 41066 | return false; | ||||
| 41067 | } | ||||
| 41068 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41068); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41068; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41069 | args.rval().setUndefined(); | ||||
| 41070 | return true; | ||||
| 41071 | break; | ||||
| 41072 | } | ||||
| 41073 | case 1: { | ||||
| 41074 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41075 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41076 | if (objIsXray) { | ||||
| 41077 | unwrappedObj.emplace(cx, obj); | ||||
| 41078 | } | ||||
| 41079 | binding_detail::FakeString<char16_t> arg0; | ||||
| 41080 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 41081 | return false; | ||||
| 41082 | } | ||||
| 41083 | if (objIsXray) { | ||||
| 41084 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41085 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41086 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41087 | if (!unwrappedObj.ref()) { | ||||
| 41088 | return false; | ||||
| 41089 | } | ||||
| 41090 | } | ||||
| 41091 | Maybe<AutoCEReaction> ceReaction; | ||||
| 41092 | DocGroup* docGroup = self->GetDocGroup(); | ||||
| 41093 | if (docGroup) { | ||||
| 41094 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); | ||||
| 41095 | } | ||||
| 41096 | FastErrorResult rv; | ||||
| 41097 | // NOTE: This assert does NOT call the function. | ||||
| 41098 | 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"); | ||||
| 41099 | MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41100 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload" )), 0))) { | ||||
| 41101 | return false; | ||||
| 41102 | } | ||||
| 41103 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41103); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41103; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41104 | args.rval().setUndefined(); | ||||
| 41105 | return true; | ||||
| 41106 | break; | ||||
| 41107 | } | ||||
| 41108 | default: { | ||||
| 41109 | // Using nsPrintfCString here would require including that | ||||
| 41110 | // header. Let's not worry about it. | ||||
| 41111 | nsAutoCString argCountStr; | ||||
| 41112 | argCountStr.AppendPrintf("%u", args.length()); | ||||
| 41113 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | ||||
| 41114 | } | ||||
| 41115 | } | ||||
| 41116 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestJSImplGenBinding.cpp", 41116); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 41116; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | ||||
| 41117 | return false; | ||||
| 41118 | } | ||||
| 41119 | |||||
| 41120 | static const JSJitInfo ceReactionsMethodOverload_methodinfo = { | ||||
| 41121 | { (JSJitGetterOp)ceReactionsMethodOverload }, | ||||
| 41122 | { prototypes::id::TestJSImplInterface }, | ||||
| 41123 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41124 | JSJitInfo::Method, | ||||
| 41125 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41126 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41127 | false, /* isInfallible. False in setters. */ | ||||
| 41128 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41129 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41130 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41131 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41132 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41133 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41134 | }; | ||||
| 41135 | |||||
| 41136 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41137 | get_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41138 | { | ||||
| 41139 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41142( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41140 | "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41142( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41141 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41142( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41142 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41142( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41143 | |||||
| 41144 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41145 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41146 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41147 | if (objIsXray) { | ||||
| 41148 | unwrappedObj.emplace(cx, obj); | ||||
| 41149 | } | ||||
| 41150 | if (objIsXray) { | ||||
| 41151 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41152 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41153 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41154 | if (!unwrappedObj.ref()) { | ||||
| 41155 | return false; | ||||
| 41156 | } | ||||
| 41157 | } | ||||
| 41158 | FastErrorResult rv; | ||||
| 41159 | bool result(MOZ_KnownLive(self)(self)->GetCeReactionsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 41160 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter" )), 0))) { | ||||
| 41161 | return false; | ||||
| 41162 | } | ||||
| 41163 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41163); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41163; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41164 | args.rval().setBoolean(result); | ||||
| 41165 | return true; | ||||
| 41166 | } | ||||
| 41167 | |||||
| 41168 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41169 | set_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41170 | { | ||||
| 41171 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41174( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41172 | "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41174( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41173 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41174( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41174 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41174( cx, "TestJSImplInterface" , "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41175 | |||||
| 41176 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41177 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41178 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41179 | if (objIsXray) { | ||||
| 41180 | unwrappedObj.emplace(cx, obj); | ||||
| 41181 | } | ||||
| 41182 | bool arg0; | ||||
| 41183 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 41184 | return false; | ||||
| 41185 | } | ||||
| 41186 | if (objIsXray) { | ||||
| 41187 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41188 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41189 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41190 | if (!unwrappedObj.ref()) { | ||||
| 41191 | return false; | ||||
| 41192 | } | ||||
| 41193 | } | ||||
| 41194 | Maybe<AutoCEReaction> ceReaction; | ||||
| 41195 | DocGroup* docGroup = self->GetDocGroup(); | ||||
| 41196 | if (docGroup) { | ||||
| 41197 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); | ||||
| 41198 | } | ||||
| 41199 | FastErrorResult rv; | ||||
| 41200 | // NOTE: This assert does NOT call the function. | ||||
| 41201 | 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"); | ||||
| 41202 | MOZ_KnownLive(self)(self)->SetCeReactionsAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41203 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter" )), 0))) { | ||||
| 41204 | return false; | ||||
| 41205 | } | ||||
| 41206 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41206); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41206; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41207 | |||||
| 41208 | return true; | ||||
| 41209 | } | ||||
| 41210 | |||||
| 41211 | static const JSJitInfo ceReactionsAttr_getterinfo = { | ||||
| 41212 | { get_ceReactionsAttr }, | ||||
| 41213 | { prototypes::id::TestJSImplInterface }, | ||||
| 41214 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41215 | JSJitInfo::Getter, | ||||
| 41216 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41217 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 41218 | false, /* isInfallible. False in setters. */ | ||||
| 41219 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41220 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41221 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41222 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41223 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41224 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41225 | }; | ||||
| 41226 | static const JSJitInfo ceReactionsAttr_setterinfo = { | ||||
| 41227 | { (JSJitGetterOp)set_ceReactionsAttr }, | ||||
| 41228 | { prototypes::id::TestJSImplInterface }, | ||||
| 41229 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41230 | JSJitInfo::Setter, | ||||
| 41231 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41232 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41233 | false, /* isInfallible. False in setters. */ | ||||
| 41234 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41235 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41236 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41237 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41238 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41239 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41240 | }; | ||||
| 41241 | |||||
| 41242 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41243 | passArgsWithDefaults(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 41244 | { | ||||
| 41245 | BindingCallContext cx(cx_, "TestJSImplInterface.passArgsWithDefaults"); | ||||
| 41246 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41249( cx, "TestJSImplInterface" , "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41247 | "TestJSImplInterface", "passArgsWithDefaults", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41249( cx, "TestJSImplInterface" , "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41248 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41249( cx, "TestJSImplInterface" , "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41249 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41249( cx, "TestJSImplInterface" , "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41250 | |||||
| 41251 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41252 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41253 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41254 | if (objIsXray) { | ||||
| 41255 | unwrappedObj.emplace(cx, obj); | ||||
| 41256 | } | ||||
| 41257 | Optional<int32_t> arg0; | ||||
| 41258 | if (args.hasDefined(0)) { | ||||
| 41259 | arg0.Construct(); | ||||
| 41260 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | ||||
| 41261 | return false; | ||||
| 41262 | } | ||||
| 41263 | } | ||||
| 41264 | mozilla::dom::TestInterface* arg1; | ||||
| 41265 | if (args.hasDefined(1)) { | ||||
| 41266 | if (args[1].isObject()) { | ||||
| 41267 | { | ||||
| 41268 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 41269 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[1], arg1, cx); | ||||
| 41270 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 41271 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestInterface"); | ||||
| 41272 | return false; | ||||
| 41273 | } | ||||
| 41274 | } | ||||
| 41275 | } else if (args[1].isNullOrUndefined()) { | ||||
| 41276 | arg1 = nullptr; | ||||
| 41277 | } else { | ||||
| 41278 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2"); | ||||
| 41279 | return false; | ||||
| 41280 | } | ||||
| 41281 | } else { | ||||
| 41282 | arg1 = nullptr; | ||||
| 41283 | } | ||||
| 41284 | RootedDictionary<binding_detail::FastDict> arg2(cx); | ||||
| 41285 | if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", true)) { | ||||
| 41286 | return false; | ||||
| 41287 | } | ||||
| 41288 | double arg3; | ||||
| 41289 | if (args.hasDefined(3)) { | ||||
| 41290 | if (!ValueToPrimitive<double, eDefault>(cx, args[3], "Argument 4", &arg3)) { | ||||
| 41291 | return false; | ||||
| 41292 | } else if (!std::isfinite(arg3)) { | ||||
| 41293 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 4"); | ||||
| 41294 | return false; | ||||
| 41295 | } | ||||
| 41296 | } else { | ||||
| 41297 | arg3 = 5.0; | ||||
| 41298 | } | ||||
| 41299 | Optional<float> arg4; | ||||
| 41300 | if (args.hasDefined(4)) { | ||||
| 41301 | arg4.Construct(); | ||||
| 41302 | if (!ValueToPrimitive<float, eDefault>(cx, args[4], "Argument 5", &arg4.Value())) { | ||||
| 41303 | return false; | ||||
| 41304 | } else if (!std::isfinite(arg4.Value())) { | ||||
| 41305 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5"); | ||||
| 41306 | return false; | ||||
| 41307 | } | ||||
| 41308 | } | ||||
| 41309 | if (objIsXray) { | ||||
| 41310 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41311 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41312 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41313 | if (!unwrappedObj.ref()) { | ||||
| 41314 | return false; | ||||
| 41315 | } | ||||
| 41316 | } | ||||
| 41317 | FastErrorResult rv; | ||||
| 41318 | // NOTE: This assert does NOT call the function. | ||||
| 41319 | 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"); | ||||
| 41320 | 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))); | ||||
| 41321 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults" )), 0))) { | ||||
| 41322 | return false; | ||||
| 41323 | } | ||||
| 41324 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41324); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41324; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41325 | args.rval().setUndefined(); | ||||
| 41326 | return true; | ||||
| 41327 | } | ||||
| 41328 | |||||
| 41329 | static const JSJitInfo passArgsWithDefaults_methodinfo = { | ||||
| 41330 | { (JSJitGetterOp)passArgsWithDefaults }, | ||||
| 41331 | { prototypes::id::TestJSImplInterface }, | ||||
| 41332 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41333 | JSJitInfo::Method, | ||||
| 41334 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41335 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41336 | false, /* isInfallible. False in setters. */ | ||||
| 41337 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41338 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41339 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41340 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41341 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41342 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41343 | }; | ||||
| 41344 | |||||
| 41345 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41346 | get_toJSONShouldSkipThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41347 | { | ||||
| 41348 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41351( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41349 | "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41351( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41350 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41351( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41351 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41351( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41352 | |||||
| 41353 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41354 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41355 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41356 | if (objIsXray) { | ||||
| 41357 | unwrappedObj.emplace(cx, obj); | ||||
| 41358 | } | ||||
| 41359 | if (objIsXray) { | ||||
| 41360 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41361 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41362 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41363 | if (!unwrappedObj.ref()) { | ||||
| 41364 | return false; | ||||
| 41365 | } | ||||
| 41366 | } | ||||
| 41367 | FastErrorResult rv; | ||||
| 41368 | JS::Rooted<JS::Value> result(cx); | ||||
| 41369 | // NOTE: This assert does NOT call the function. | ||||
| 41370 | 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"); | ||||
| 41371 | MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41372 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter" )), 0))) { | ||||
| 41373 | return false; | ||||
| 41374 | } | ||||
| 41375 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41375); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41375; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41376 | JS::ExposeValueToActiveJS(result); | ||||
| 41377 | args.rval().set(result); | ||||
| 41378 | if (!MaybeWrapValue(cx, args.rval())) { | ||||
| 41379 | return false; | ||||
| 41380 | } | ||||
| 41381 | return true; | ||||
| 41382 | } | ||||
| 41383 | |||||
| 41384 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41385 | set_toJSONShouldSkipThis(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41386 | { | ||||
| 41387 | BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis setter"); | ||||
| 41388 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41391( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41389 | "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41391( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41390 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41391( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41391 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41391( cx, "TestJSImplInterface" , "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41392 | |||||
| 41393 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41394 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41395 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41396 | if (objIsXray) { | ||||
| 41397 | unwrappedObj.emplace(cx, obj); | ||||
| 41398 | } | ||||
| 41399 | JS::Rooted<JS::Value> arg0(cx); | ||||
| 41400 | #ifdef __clang__1 | ||||
| 41401 | #pragma clang diagnostic push | ||||
| 41402 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 41403 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 41404 | #endif // __clang__ | ||||
| 41405 | if ((true) && !CallerSubsumes(args[0])) { | ||||
| 41406 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value being assigned"); | ||||
| 41407 | return false; | ||||
| 41408 | } | ||||
| 41409 | #ifdef __clang__1 | ||||
| 41410 | #pragma clang diagnostic pop | ||||
| 41411 | #endif // __clang__ | ||||
| 41412 | arg0 = args[0]; | ||||
| 41413 | if (objIsXray) { | ||||
| 41414 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41415 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41416 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41417 | if (!unwrappedObj.ref()) { | ||||
| 41418 | return false; | ||||
| 41419 | } | ||||
| 41420 | } | ||||
| 41421 | FastErrorResult rv; | ||||
| 41422 | // NOTE: This assert does NOT call the function. | ||||
| 41423 | 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"); | ||||
| 41424 | MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41425 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter" )), 0))) { | ||||
| 41426 | return false; | ||||
| 41427 | } | ||||
| 41428 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41428); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41428; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41429 | |||||
| 41430 | return true; | ||||
| 41431 | } | ||||
| 41432 | |||||
| 41433 | static const JSJitInfo toJSONShouldSkipThis_getterinfo = { | ||||
| 41434 | { get_toJSONShouldSkipThis }, | ||||
| 41435 | { prototypes::id::TestJSImplInterface }, | ||||
| 41436 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41437 | JSJitInfo::Getter, | ||||
| 41438 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41439 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 41440 | false, /* isInfallible. False in setters. */ | ||||
| 41441 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41442 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41443 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41444 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41445 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41446 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41447 | }; | ||||
| 41448 | static const JSJitInfo toJSONShouldSkipThis_setterinfo = { | ||||
| 41449 | { (JSJitGetterOp)set_toJSONShouldSkipThis }, | ||||
| 41450 | { prototypes::id::TestJSImplInterface }, | ||||
| 41451 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41452 | JSJitInfo::Setter, | ||||
| 41453 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41454 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41455 | false, /* isInfallible. False in setters. */ | ||||
| 41456 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41457 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41458 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41459 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41460 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41461 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41462 | }; | ||||
| 41463 | |||||
| 41464 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41465 | get_toJSONShouldSkipThis2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41466 | { | ||||
| 41467 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41470( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41468 | "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41470( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41469 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41470( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41470 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41470( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41471 | |||||
| 41472 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41473 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41474 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41475 | if (objIsXray) { | ||||
| 41476 | unwrappedObj.emplace(cx, obj); | ||||
| 41477 | } | ||||
| 41478 | if (objIsXray) { | ||||
| 41479 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41480 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41481 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41482 | if (!unwrappedObj.ref()) { | ||||
| 41483 | return false; | ||||
| 41484 | } | ||||
| 41485 | } | ||||
| 41486 | FastErrorResult rv; | ||||
| 41487 | auto result(StrongOrRawPtr<mozilla::dom::TestParentInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 41488 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter" )), 0))) { | ||||
| 41489 | return false; | ||||
| 41490 | } | ||||
| 41491 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41491); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41491; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41492 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | ||||
| 41493 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41493); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 41493; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 41494 | return false; | ||||
| 41495 | } | ||||
| 41496 | return true; | ||||
| 41497 | } | ||||
| 41498 | |||||
| 41499 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41500 | set_toJSONShouldSkipThis2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41501 | { | ||||
| 41502 | BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis2 setter"); | ||||
| 41503 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41506( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41504 | "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41506( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41505 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41506( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41506 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41506( cx, "TestJSImplInterface" , "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41507 | |||||
| 41508 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41509 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41510 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41511 | if (objIsXray) { | ||||
| 41512 | unwrappedObj.emplace(cx, obj); | ||||
| 41513 | } | ||||
| 41514 | NonNull<mozilla::dom::TestParentInterface> arg0; | ||||
| 41515 | if (args[0].isObject()) { | ||||
| 41516 | { | ||||
| 41517 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 41518 | nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(args[0], arg0, cx); | ||||
| 41519 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 41520 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestParentInterface"); | ||||
| 41521 | return false; | ||||
| 41522 | } | ||||
| 41523 | } | ||||
| 41524 | } else { | ||||
| 41525 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 41526 | return false; | ||||
| 41527 | } | ||||
| 41528 | if (objIsXray) { | ||||
| 41529 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41530 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41531 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41532 | if (!unwrappedObj.ref()) { | ||||
| 41533 | return false; | ||||
| 41534 | } | ||||
| 41535 | } | ||||
| 41536 | FastErrorResult rv; | ||||
| 41537 | // NOTE: This assert does NOT call the function. | ||||
| 41538 | 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"); | ||||
| 41539 | MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41540 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter" )), 0))) { | ||||
| 41541 | return false; | ||||
| 41542 | } | ||||
| 41543 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41543); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41543; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41544 | |||||
| 41545 | return true; | ||||
| 41546 | } | ||||
| 41547 | |||||
| 41548 | static const JSJitInfo toJSONShouldSkipThis2_getterinfo = { | ||||
| 41549 | { get_toJSONShouldSkipThis2 }, | ||||
| 41550 | { prototypes::id::TestJSImplInterface }, | ||||
| 41551 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41552 | JSJitInfo::Getter, | ||||
| 41553 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41554 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 41555 | false, /* isInfallible. False in setters. */ | ||||
| 41556 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41557 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41558 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41559 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41560 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41561 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41562 | }; | ||||
| 41563 | static const JSJitInfo toJSONShouldSkipThis2_setterinfo = { | ||||
| 41564 | { (JSJitGetterOp)set_toJSONShouldSkipThis2 }, | ||||
| 41565 | { prototypes::id::TestJSImplInterface }, | ||||
| 41566 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41567 | JSJitInfo::Setter, | ||||
| 41568 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41569 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41570 | false, /* isInfallible. False in setters. */ | ||||
| 41571 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41572 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41573 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41574 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41575 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41576 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41577 | }; | ||||
| 41578 | |||||
| 41579 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41580 | get_toJSONShouldSkipThis3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41581 | { | ||||
| 41582 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41585( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41583 | "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41585( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41584 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41585( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41585 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41585( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41586 | |||||
| 41587 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41588 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41589 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41590 | if (objIsXray) { | ||||
| 41591 | unwrappedObj.emplace(cx, obj); | ||||
| 41592 | } | ||||
| 41593 | if (objIsXray) { | ||||
| 41594 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41595 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41596 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41597 | if (!unwrappedObj.ref()) { | ||||
| 41598 | return false; | ||||
| 41599 | } | ||||
| 41600 | } | ||||
| 41601 | FastErrorResult rv; | ||||
| 41602 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))); | ||||
| 41603 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter" )), 0))) { | ||||
| 41604 | return false; | ||||
| 41605 | } | ||||
| 41606 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41606); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41606; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41607 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | ||||
| 41608 | if (!MaybeWrapObjectValue(cx, args.rval())) { | ||||
| 41609 | return false; | ||||
| 41610 | } | ||||
| 41611 | return true; | ||||
| 41612 | } | ||||
| 41613 | |||||
| 41614 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41615 | set_toJSONShouldSkipThis3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41616 | { | ||||
| 41617 | BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis3 setter"); | ||||
| 41618 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41621( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41619 | "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41621( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41620 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41621( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41621 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41621( cx, "TestJSImplInterface" , "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41622 | |||||
| 41623 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41624 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41625 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41626 | if (objIsXray) { | ||||
| 41627 | unwrappedObj.emplace(cx, obj); | ||||
| 41628 | } | ||||
| 41629 | RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx); | ||||
| 41630 | if (args[0].isObject()) { | ||||
| 41631 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 41632 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | ||||
| 41633 | } | ||||
| 41634 | } else { | ||||
| 41635 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 41636 | return false; | ||||
| 41637 | } | ||||
| 41638 | if (objIsXray) { | ||||
| 41639 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41640 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41641 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41642 | if (!unwrappedObj.ref()) { | ||||
| 41643 | return false; | ||||
| 41644 | } | ||||
| 41645 | } | ||||
| 41646 | FastErrorResult rv; | ||||
| 41647 | // NOTE: This assert does NOT call the function. | ||||
| 41648 | 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"); | ||||
| 41649 | MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41650 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter" )), 0))) { | ||||
| 41651 | return false; | ||||
| 41652 | } | ||||
| 41653 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41653); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41653; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41654 | |||||
| 41655 | return true; | ||||
| 41656 | } | ||||
| 41657 | |||||
| 41658 | static const JSJitInfo toJSONShouldSkipThis3_getterinfo = { | ||||
| 41659 | { get_toJSONShouldSkipThis3 }, | ||||
| 41660 | { prototypes::id::TestJSImplInterface }, | ||||
| 41661 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41662 | JSJitInfo::Getter, | ||||
| 41663 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41664 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 41665 | false, /* isInfallible. False in setters. */ | ||||
| 41666 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41667 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41668 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41669 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41670 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41671 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41672 | }; | ||||
| 41673 | static const JSJitInfo toJSONShouldSkipThis3_setterinfo = { | ||||
| 41674 | { (JSJitGetterOp)set_toJSONShouldSkipThis3 }, | ||||
| 41675 | { prototypes::id::TestJSImplInterface }, | ||||
| 41676 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41677 | JSJitInfo::Setter, | ||||
| 41678 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41679 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41680 | false, /* isInfallible. False in setters. */ | ||||
| 41681 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41682 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41683 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41684 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41685 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41686 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41687 | }; | ||||
| 41688 | |||||
| 41689 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41690 | get_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41691 | { | ||||
| 41692 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41695( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41693 | "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41695( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41694 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41695( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41695 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41695( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41696 | |||||
| 41697 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41698 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41699 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41700 | if (objIsXray) { | ||||
| 41701 | unwrappedObj.emplace(cx, obj); | ||||
| 41702 | } | ||||
| 41703 | if (objIsXray) { | ||||
| 41704 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41705 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41706 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41707 | if (!unwrappedObj.ref()) { | ||||
| 41708 | return false; | ||||
| 41709 | } | ||||
| 41710 | } | ||||
| 41711 | FastErrorResult rv; | ||||
| 41712 | int8_t result(MOZ_KnownLive(self)(self)->GetDashed_attribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 41713 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter" )), 0))) { | ||||
| 41714 | return false; | ||||
| 41715 | } | ||||
| 41716 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41716); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41716; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41717 | args.rval().setInt32(int32_t(result)); | ||||
| 41718 | return true; | ||||
| 41719 | } | ||||
| 41720 | |||||
| 41721 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41722 | set_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41723 | { | ||||
| 41724 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41727( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41725 | "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41727( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41726 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41727( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41727 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41727( cx, "TestJSImplInterface" , "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41728 | |||||
| 41729 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41730 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41731 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41732 | if (objIsXray) { | ||||
| 41733 | unwrappedObj.emplace(cx, obj); | ||||
| 41734 | } | ||||
| 41735 | int8_t arg0; | ||||
| 41736 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 41737 | return false; | ||||
| 41738 | } | ||||
| 41739 | if (objIsXray) { | ||||
| 41740 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41741 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41742 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41743 | if (!unwrappedObj.ref()) { | ||||
| 41744 | return false; | ||||
| 41745 | } | ||||
| 41746 | } | ||||
| 41747 | FastErrorResult rv; | ||||
| 41748 | // NOTE: This assert does NOT call the function. | ||||
| 41749 | 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"); | ||||
| 41750 | MOZ_KnownLive(self)(self)->SetDashed_attribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41751 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter" )), 0))) { | ||||
| 41752 | return false; | ||||
| 41753 | } | ||||
| 41754 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41754); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41754; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41755 | |||||
| 41756 | return true; | ||||
| 41757 | } | ||||
| 41758 | |||||
| 41759 | static const JSJitInfo dashed_attribute_getterinfo = { | ||||
| 41760 | { get_dashed_attribute }, | ||||
| 41761 | { prototypes::id::TestJSImplInterface }, | ||||
| 41762 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41763 | JSJitInfo::Getter, | ||||
| 41764 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41765 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | ||||
| 41766 | false, /* isInfallible. False in setters. */ | ||||
| 41767 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41768 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41769 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41770 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41771 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41772 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41773 | }; | ||||
| 41774 | static const JSJitInfo dashed_attribute_setterinfo = { | ||||
| 41775 | { (JSJitGetterOp)set_dashed_attribute }, | ||||
| 41776 | { prototypes::id::TestJSImplInterface }, | ||||
| 41777 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41778 | JSJitInfo::Setter, | ||||
| 41779 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41780 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41781 | false, /* isInfallible. False in setters. */ | ||||
| 41782 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41783 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41784 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41785 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41786 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41787 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41788 | }; | ||||
| 41789 | |||||
| 41790 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41791 | dashed_method(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 41792 | { | ||||
| 41793 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41796( cx, "TestJSImplInterface" , "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41794 | "TestJSImplInterface", "dashed-method", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41796( cx, "TestJSImplInterface" , "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41795 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41796( cx, "TestJSImplInterface" , "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41796 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41796( cx, "TestJSImplInterface" , "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41797 | |||||
| 41798 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41799 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41800 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41801 | if (objIsXray) { | ||||
| 41802 | unwrappedObj.emplace(cx, obj); | ||||
| 41803 | } | ||||
| 41804 | if (objIsXray) { | ||||
| 41805 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41806 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41807 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41808 | if (!unwrappedObj.ref()) { | ||||
| 41809 | return false; | ||||
| 41810 | } | ||||
| 41811 | } | ||||
| 41812 | FastErrorResult rv; | ||||
| 41813 | // NOTE: This assert does NOT call the function. | ||||
| 41814 | 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"); | ||||
| 41815 | MOZ_KnownLive(self)(self)->Dashed_method(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41816 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method" )), 0))) { | ||||
| 41817 | return false; | ||||
| 41818 | } | ||||
| 41819 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41819); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41819; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41820 | args.rval().setUndefined(); | ||||
| 41821 | return true; | ||||
| 41822 | } | ||||
| 41823 | |||||
| 41824 | static const JSJitInfo dashed_method_methodinfo = { | ||||
| 41825 | { (JSJitGetterOp)dashed_method }, | ||||
| 41826 | { prototypes::id::TestJSImplInterface }, | ||||
| 41827 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41828 | JSJitInfo::Method, | ||||
| 41829 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41830 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41831 | false, /* isInfallible. False in setters. */ | ||||
| 41832 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41833 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41834 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41835 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41836 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41837 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41838 | }; | ||||
| 41839 | |||||
| 41840 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41841 | get_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41842 | { | ||||
| 41843 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41846( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41844 | "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41846( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41845 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41846( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41846 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41846( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41847 | |||||
| 41848 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41849 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41850 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41851 | if (objIsXray) { | ||||
| 41852 | unwrappedObj.emplace(cx, obj); | ||||
| 41853 | } | ||||
| 41854 | if (objIsXray) { | ||||
| 41855 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41856 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41857 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41858 | if (!unwrappedObj.ref()) { | ||||
| 41859 | return false; | ||||
| 41860 | } | ||||
| 41861 | } | ||||
| 41862 | FastErrorResult rv; | ||||
| 41863 | bool result(MOZ_KnownLive(self)(self)->GetNonEnumerableAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))); | ||||
| 41864 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter" )), 0))) { | ||||
| 41865 | return false; | ||||
| 41866 | } | ||||
| 41867 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41867); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41867; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41868 | args.rval().setBoolean(result); | ||||
| 41869 | return true; | ||||
| 41870 | } | ||||
| 41871 | |||||
| 41872 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41873 | set_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 41874 | { | ||||
| 41875 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41878( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41876 | "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41878( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41877 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41878( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41878 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41878( cx, "TestJSImplInterface" , "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41879 | |||||
| 41880 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41881 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41882 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41883 | if (objIsXray) { | ||||
| 41884 | unwrappedObj.emplace(cx, obj); | ||||
| 41885 | } | ||||
| 41886 | bool arg0; | ||||
| 41887 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | ||||
| 41888 | return false; | ||||
| 41889 | } | ||||
| 41890 | if (objIsXray) { | ||||
| 41891 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41892 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41893 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41894 | if (!unwrappedObj.ref()) { | ||||
| 41895 | return false; | ||||
| 41896 | } | ||||
| 41897 | } | ||||
| 41898 | FastErrorResult rv; | ||||
| 41899 | // NOTE: This assert does NOT call the function. | ||||
| 41900 | 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"); | ||||
| 41901 | MOZ_KnownLive(self)(self)->SetNonEnumerableAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41902 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter" )), 0))) { | ||||
| 41903 | return false; | ||||
| 41904 | } | ||||
| 41905 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41905); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41905; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41906 | |||||
| 41907 | return true; | ||||
| 41908 | } | ||||
| 41909 | |||||
| 41910 | static const JSJitInfo nonEnumerableAttr_getterinfo = { | ||||
| 41911 | { get_nonEnumerableAttr }, | ||||
| 41912 | { prototypes::id::TestJSImplInterface }, | ||||
| 41913 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41914 | JSJitInfo::Getter, | ||||
| 41915 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41916 | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ | ||||
| 41917 | false, /* isInfallible. False in setters. */ | ||||
| 41918 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41919 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41920 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41921 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41922 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41923 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41924 | }; | ||||
| 41925 | static const JSJitInfo nonEnumerableAttr_setterinfo = { | ||||
| 41926 | { (JSJitGetterOp)set_nonEnumerableAttr }, | ||||
| 41927 | { prototypes::id::TestJSImplInterface }, | ||||
| 41928 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41929 | JSJitInfo::Setter, | ||||
| 41930 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41931 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41932 | false, /* isInfallible. False in setters. */ | ||||
| 41933 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41934 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41935 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41936 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41937 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41938 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41939 | }; | ||||
| 41940 | |||||
| 41941 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41942 | nonEnumerableMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 41943 | { | ||||
| 41944 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41947( cx, "TestJSImplInterface" , "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41945 | "TestJSImplInterface", "nonEnumerableMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41947( cx, "TestJSImplInterface" , "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41946 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41947( cx, "TestJSImplInterface" , "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 41947 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41947( cx, "TestJSImplInterface" , "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 41948 | |||||
| 41949 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 41950 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 41951 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 41952 | if (objIsXray) { | ||||
| 41953 | unwrappedObj.emplace(cx, obj); | ||||
| 41954 | } | ||||
| 41955 | if (objIsXray) { | ||||
| 41956 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 41957 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 41958 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 41959 | if (!unwrappedObj.ref()) { | ||||
| 41960 | return false; | ||||
| 41961 | } | ||||
| 41962 | } | ||||
| 41963 | FastErrorResult rv; | ||||
| 41964 | // NOTE: This assert does NOT call the function. | ||||
| 41965 | 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"); | ||||
| 41966 | MOZ_KnownLive(self)(self)->NonEnumerableMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 41967 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod" )), 0))) { | ||||
| 41968 | return false; | ||||
| 41969 | } | ||||
| 41970 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 41970); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 41970; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 41971 | args.rval().setUndefined(); | ||||
| 41972 | return true; | ||||
| 41973 | } | ||||
| 41974 | |||||
| 41975 | static const JSJitInfo nonEnumerableMethod_methodinfo = { | ||||
| 41976 | { (JSJitGetterOp)nonEnumerableMethod }, | ||||
| 41977 | { prototypes::id::TestJSImplInterface }, | ||||
| 41978 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 41979 | JSJitInfo::Method, | ||||
| 41980 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 41981 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 41982 | false, /* isInfallible. False in setters. */ | ||||
| 41983 | false, /* isMovable. Not relevant for setters. */ | ||||
| 41984 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 41985 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 41986 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 41987 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 41988 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 41989 | }; | ||||
| 41990 | |||||
| 41991 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 41992 | get_allowSharedArrayBufferViewTypedef(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 41993 | { | ||||
| 41994 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41997( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41995 | "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41997( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41996 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41997( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 41997 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41997( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 41998 | |||||
| 41999 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42000 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42001 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42002 | if (objIsXray) { | ||||
| 42003 | unwrappedObj.emplace(cx, obj); | ||||
| 42004 | } | ||||
| 42005 | if (objIsXray) { | ||||
| 42006 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42007 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42008 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42009 | if (!unwrappedObj.ref()) { | ||||
| 42010 | return false; | ||||
| 42011 | } | ||||
| 42012 | } | ||||
| 42013 | FastErrorResult rv; | ||||
| 42014 | JS::Rooted<JSObject*> result(cx); | ||||
| 42015 | // NOTE: This assert does NOT call the function. | ||||
| 42016 | 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"); | ||||
| 42017 | MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferViewTypedef(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42018 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter" )), 0))) { | ||||
| 42019 | return false; | ||||
| 42020 | } | ||||
| 42021 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42021); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42021; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42022 | JS::ExposeObjectToActiveJS(result); | ||||
| 42023 | args.rval().setObject(*result); | ||||
| 42024 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | ||||
| 42025 | return false; | ||||
| 42026 | } | ||||
| 42027 | return true; | ||||
| 42028 | } | ||||
| 42029 | |||||
| 42030 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42031 | set_allowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 42032 | { | ||||
| 42033 | BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"); | ||||
| 42034 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42037( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42035 | "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42037( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42036 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42037( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42037 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42037( cx, "TestJSImplInterface" , "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42038 | |||||
| 42039 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42040 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42041 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42042 | if (objIsXray) { | ||||
| 42043 | unwrappedObj.emplace(cx, obj); | ||||
| 42044 | } | ||||
| 42045 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | ||||
| 42046 | if (args[0].isObject()) { | ||||
| 42047 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42048 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView"); | ||||
| 42049 | return false; | ||||
| 42050 | } | ||||
| 42051 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 42052 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 42053 | return false; | ||||
| 42054 | } | ||||
| 42055 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 42056 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 42057 | return false; | ||||
| 42058 | } | ||||
| 42059 | } else { | ||||
| 42060 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 42061 | return false; | ||||
| 42062 | } | ||||
| 42063 | if (objIsXray) { | ||||
| 42064 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42065 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42066 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42067 | if (!unwrappedObj.ref()) { | ||||
| 42068 | return false; | ||||
| 42069 | } | ||||
| 42070 | } | ||||
| 42071 | FastErrorResult rv; | ||||
| 42072 | // NOTE: This assert does NOT call the function. | ||||
| 42073 | 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"); | ||||
| 42074 | MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42075 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter" )), 0))) { | ||||
| 42076 | return false; | ||||
| 42077 | } | ||||
| 42078 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42078); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42078; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42079 | |||||
| 42080 | return true; | ||||
| 42081 | } | ||||
| 42082 | |||||
| 42083 | static const JSJitInfo allowSharedArrayBufferViewTypedef_getterinfo = { | ||||
| 42084 | { get_allowSharedArrayBufferViewTypedef }, | ||||
| 42085 | { prototypes::id::TestJSImplInterface }, | ||||
| 42086 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42087 | JSJitInfo::Getter, | ||||
| 42088 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42089 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 42090 | false, /* isInfallible. False in setters. */ | ||||
| 42091 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42092 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42093 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42094 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42095 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42096 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42097 | }; | ||||
| 42098 | static const JSJitInfo allowSharedArrayBufferViewTypedef_setterinfo = { | ||||
| 42099 | { (JSJitGetterOp)set_allowSharedArrayBufferViewTypedef }, | ||||
| 42100 | { prototypes::id::TestJSImplInterface }, | ||||
| 42101 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42102 | JSJitInfo::Setter, | ||||
| 42103 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42104 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42105 | false, /* isInfallible. False in setters. */ | ||||
| 42106 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42107 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42108 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42109 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42110 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42111 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42112 | }; | ||||
| 42113 | |||||
| 42114 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42115 | get_allowSharedArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 42116 | { | ||||
| 42117 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42120( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42118 | "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42120( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42119 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42120( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42120 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42120( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42121 | |||||
| 42122 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42123 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42124 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42125 | if (objIsXray) { | ||||
| 42126 | unwrappedObj.emplace(cx, obj); | ||||
| 42127 | } | ||||
| 42128 | if (objIsXray) { | ||||
| 42129 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42130 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42131 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42132 | if (!unwrappedObj.ref()) { | ||||
| 42133 | return false; | ||||
| 42134 | } | ||||
| 42135 | } | ||||
| 42136 | FastErrorResult rv; | ||||
| 42137 | JS::Rooted<JSObject*> result(cx); | ||||
| 42138 | // NOTE: This assert does NOT call the function. | ||||
| 42139 | 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"); | ||||
| 42140 | MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42141 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter" )), 0))) { | ||||
| 42142 | return false; | ||||
| 42143 | } | ||||
| 42144 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42144); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42144; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42145 | JS::ExposeObjectToActiveJS(result); | ||||
| 42146 | args.rval().setObject(*result); | ||||
| 42147 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | ||||
| 42148 | return false; | ||||
| 42149 | } | ||||
| 42150 | return true; | ||||
| 42151 | } | ||||
| 42152 | |||||
| 42153 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42154 | set_allowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 42155 | { | ||||
| 42156 | BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferView setter"); | ||||
| 42157 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42160( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42158 | "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42160( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42159 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42160( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42160 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42160( cx, "TestJSImplInterface" , "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42161 | |||||
| 42162 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42163 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42164 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42165 | if (objIsXray) { | ||||
| 42166 | unwrappedObj.emplace(cx, obj); | ||||
| 42167 | } | ||||
| 42168 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | ||||
| 42169 | if (args[0].isObject()) { | ||||
| 42170 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42171 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView"); | ||||
| 42172 | return false; | ||||
| 42173 | } | ||||
| 42174 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 42175 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 42176 | return false; | ||||
| 42177 | } | ||||
| 42178 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 42179 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 42180 | return false; | ||||
| 42181 | } | ||||
| 42182 | } else { | ||||
| 42183 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 42184 | return false; | ||||
| 42185 | } | ||||
| 42186 | if (objIsXray) { | ||||
| 42187 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42188 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42189 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42190 | if (!unwrappedObj.ref()) { | ||||
| 42191 | return false; | ||||
| 42192 | } | ||||
| 42193 | } | ||||
| 42194 | FastErrorResult rv; | ||||
| 42195 | // NOTE: This assert does NOT call the function. | ||||
| 42196 | 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"); | ||||
| 42197 | MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42198 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter" )), 0))) { | ||||
| 42199 | return false; | ||||
| 42200 | } | ||||
| 42201 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42201; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42202 | |||||
| 42203 | return true; | ||||
| 42204 | } | ||||
| 42205 | |||||
| 42206 | static const JSJitInfo allowSharedArrayBufferView_getterinfo = { | ||||
| 42207 | { get_allowSharedArrayBufferView }, | ||||
| 42208 | { prototypes::id::TestJSImplInterface }, | ||||
| 42209 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42210 | JSJitInfo::Getter, | ||||
| 42211 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42212 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 42213 | false, /* isInfallible. False in setters. */ | ||||
| 42214 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42215 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42216 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42217 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42218 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42219 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42220 | }; | ||||
| 42221 | static const JSJitInfo allowSharedArrayBufferView_setterinfo = { | ||||
| 42222 | { (JSJitGetterOp)set_allowSharedArrayBufferView }, | ||||
| 42223 | { prototypes::id::TestJSImplInterface }, | ||||
| 42224 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42225 | JSJitInfo::Setter, | ||||
| 42226 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42227 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42228 | false, /* isInfallible. False in setters. */ | ||||
| 42229 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42230 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42231 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42232 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42233 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42234 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42235 | }; | ||||
| 42236 | |||||
| 42237 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42238 | get_allowSharedNullableArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 42239 | { | ||||
| 42240 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42243( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42241 | "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42243( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42242 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42243( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42243 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42243( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42244 | |||||
| 42245 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42246 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42247 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42248 | if (objIsXray) { | ||||
| 42249 | unwrappedObj.emplace(cx, obj); | ||||
| 42250 | } | ||||
| 42251 | if (objIsXray) { | ||||
| 42252 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42253 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42254 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42255 | if (!unwrappedObj.ref()) { | ||||
| 42256 | return false; | ||||
| 42257 | } | ||||
| 42258 | } | ||||
| 42259 | FastErrorResult rv; | ||||
| 42260 | JS::Rooted<JSObject*> result(cx); | ||||
| 42261 | // NOTE: This assert does NOT call the function. | ||||
| 42262 | 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"); | ||||
| 42263 | MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42264 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter" )), 0))) { | ||||
| 42265 | return false; | ||||
| 42266 | } | ||||
| 42267 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42267); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42267; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42268 | if (result) { | ||||
| 42269 | JS::ExposeObjectToActiveJS(result); | ||||
| 42270 | } | ||||
| 42271 | args.rval().setObjectOrNull(result); | ||||
| 42272 | if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) { | ||||
| 42273 | return false; | ||||
| 42274 | } | ||||
| 42275 | return true; | ||||
| 42276 | } | ||||
| 42277 | |||||
| 42278 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42279 | set_allowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 42280 | { | ||||
| 42281 | BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"); | ||||
| 42282 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42285( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42283 | "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42285( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42284 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42285( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42285 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42285( cx, "TestJSImplInterface" , "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42286 | |||||
| 42287 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42288 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42289 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42290 | if (objIsXray) { | ||||
| 42291 | unwrappedObj.emplace(cx, obj); | ||||
| 42292 | } | ||||
| 42293 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx); | ||||
| 42294 | if (args[0].isObject()) { | ||||
| 42295 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 42296 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferViewOrNull"); | ||||
| 42297 | return false; | ||||
| 42298 | } | ||||
| 42299 | if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) { | ||||
| 42300 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 42301 | return false; | ||||
| 42302 | } | ||||
| 42303 | if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) { | ||||
| 42304 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 42305 | return false; | ||||
| 42306 | } | ||||
| 42307 | } else if (args[0].isNullOrUndefined()) { | ||||
| 42308 | arg0.SetNull(); | ||||
| 42309 | } else { | ||||
| 42310 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 42311 | return false; | ||||
| 42312 | } | ||||
| 42313 | if (objIsXray) { | ||||
| 42314 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42315 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42316 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42317 | if (!unwrappedObj.ref()) { | ||||
| 42318 | return false; | ||||
| 42319 | } | ||||
| 42320 | } | ||||
| 42321 | FastErrorResult rv; | ||||
| 42322 | // NOTE: This assert does NOT call the function. | ||||
| 42323 | 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"); | ||||
| 42324 | MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42325 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter" )), 0))) { | ||||
| 42326 | return false; | ||||
| 42327 | } | ||||
| 42328 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42328); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42328; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42329 | |||||
| 42330 | return true; | ||||
| 42331 | } | ||||
| 42332 | |||||
| 42333 | static const JSJitInfo allowSharedNullableArrayBufferView_getterinfo = { | ||||
| 42334 | { get_allowSharedNullableArrayBufferView }, | ||||
| 42335 | { prototypes::id::TestJSImplInterface }, | ||||
| 42336 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42337 | JSJitInfo::Getter, | ||||
| 42338 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42339 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 42340 | false, /* isInfallible. False in setters. */ | ||||
| 42341 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42342 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42343 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42344 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42345 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42346 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42347 | }; | ||||
| 42348 | static const JSJitInfo allowSharedNullableArrayBufferView_setterinfo = { | ||||
| 42349 | { (JSJitGetterOp)set_allowSharedNullableArrayBufferView }, | ||||
| 42350 | { prototypes::id::TestJSImplInterface }, | ||||
| 42351 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42352 | JSJitInfo::Setter, | ||||
| 42353 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42354 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42355 | false, /* isInfallible. False in setters. */ | ||||
| 42356 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42357 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42358 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42359 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42360 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42361 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42362 | }; | ||||
| 42363 | |||||
| 42364 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42365 | get_allowSharedArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 42366 | { | ||||
| 42367 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42370( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42368 | "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42370( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42369 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42370( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42370 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42370( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 42371 | |||||
| 42372 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42373 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42374 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42375 | if (objIsXray) { | ||||
| 42376 | unwrappedObj.emplace(cx, obj); | ||||
| 42377 | } | ||||
| 42378 | if (objIsXray) { | ||||
| 42379 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42380 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42381 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42382 | if (!unwrappedObj.ref()) { | ||||
| 42383 | return false; | ||||
| 42384 | } | ||||
| 42385 | } | ||||
| 42386 | FastErrorResult rv; | ||||
| 42387 | JS::Rooted<JSObject*> result(cx); | ||||
| 42388 | // NOTE: This assert does NOT call the function. | ||||
| 42389 | 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"); | ||||
| 42390 | MOZ_KnownLive(self)(self)->GetAllowSharedArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42391 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter" )), 0))) { | ||||
| 42392 | return false; | ||||
| 42393 | } | ||||
| 42394 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42394); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42394; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42395 | JS::ExposeObjectToActiveJS(result); | ||||
| 42396 | args.rval().setObject(*result); | ||||
| 42397 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | ||||
| 42398 | return false; | ||||
| 42399 | } | ||||
| 42400 | return true; | ||||
| 42401 | } | ||||
| 42402 | |||||
| 42403 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42404 | set_allowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 42405 | { | ||||
| 42406 | BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBuffer setter"); | ||||
| 42407 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42410( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42408 | "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42410( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42409 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42410( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42410 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42410( cx, "TestJSImplInterface" , "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 42411 | |||||
| 42412 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42413 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42414 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42415 | if (objIsXray) { | ||||
| 42416 | unwrappedObj.emplace(cx, obj); | ||||
| 42417 | } | ||||
| 42418 | RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx); | ||||
| 42419 | if (args[0].isObject()) { | ||||
| 42420 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42421 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBuffer"); | ||||
| 42422 | return false; | ||||
| 42423 | } | ||||
| 42424 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) { | ||||
| 42425 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 42426 | return false; | ||||
| 42427 | } | ||||
| 42428 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) { | ||||
| 42429 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 42430 | return false; | ||||
| 42431 | } | ||||
| 42432 | } else { | ||||
| 42433 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 42434 | return false; | ||||
| 42435 | } | ||||
| 42436 | if (objIsXray) { | ||||
| 42437 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42438 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42439 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42440 | if (!unwrappedObj.ref()) { | ||||
| 42441 | return false; | ||||
| 42442 | } | ||||
| 42443 | } | ||||
| 42444 | FastErrorResult rv; | ||||
| 42445 | // NOTE: This assert does NOT call the function. | ||||
| 42446 | 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"); | ||||
| 42447 | MOZ_KnownLive(self)(self)->SetAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42448 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter" )), 0))) { | ||||
| 42449 | return false; | ||||
| 42450 | } | ||||
| 42451 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42451); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42451; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42452 | |||||
| 42453 | return true; | ||||
| 42454 | } | ||||
| 42455 | |||||
| 42456 | static const JSJitInfo allowSharedArrayBuffer_getterinfo = { | ||||
| 42457 | { get_allowSharedArrayBuffer }, | ||||
| 42458 | { prototypes::id::TestJSImplInterface }, | ||||
| 42459 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42460 | JSJitInfo::Getter, | ||||
| 42461 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42462 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 42463 | false, /* isInfallible. False in setters. */ | ||||
| 42464 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42465 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42466 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42467 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42468 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42469 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42470 | }; | ||||
| 42471 | static const JSJitInfo allowSharedArrayBuffer_setterinfo = { | ||||
| 42472 | { (JSJitGetterOp)set_allowSharedArrayBuffer }, | ||||
| 42473 | { prototypes::id::TestJSImplInterface }, | ||||
| 42474 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42475 | JSJitInfo::Setter, | ||||
| 42476 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42477 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42478 | false, /* isInfallible. False in setters. */ | ||||
| 42479 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42480 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42481 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42482 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42483 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42484 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42485 | }; | ||||
| 42486 | |||||
| 42487 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42488 | get_allowSharedNullableArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | ||||
| 42489 | { | ||||
| 42490 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42493( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42491 | "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42493( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42492 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42493( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42493 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42493( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42494 | |||||
| 42495 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42496 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42497 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42498 | if (objIsXray) { | ||||
| 42499 | unwrappedObj.emplace(cx, obj); | ||||
| 42500 | } | ||||
| 42501 | if (objIsXray) { | ||||
| 42502 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42503 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42504 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42505 | if (!unwrappedObj.ref()) { | ||||
| 42506 | return false; | ||||
| 42507 | } | ||||
| 42508 | } | ||||
| 42509 | FastErrorResult rv; | ||||
| 42510 | JS::Rooted<JSObject*> result(cx); | ||||
| 42511 | // NOTE: This assert does NOT call the function. | ||||
| 42512 | 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"); | ||||
| 42513 | MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42514 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter" )), 0))) { | ||||
| 42515 | return false; | ||||
| 42516 | } | ||||
| 42517 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42517); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42517; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42518 | if (result) { | ||||
| 42519 | JS::ExposeObjectToActiveJS(result); | ||||
| 42520 | } | ||||
| 42521 | args.rval().setObjectOrNull(result); | ||||
| 42522 | if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) { | ||||
| 42523 | return false; | ||||
| 42524 | } | ||||
| 42525 | return true; | ||||
| 42526 | } | ||||
| 42527 | |||||
| 42528 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42529 | set_allowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | ||||
| 42530 | { | ||||
| 42531 | BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"); | ||||
| 42532 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42535( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42533 | "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42535( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42534 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42535( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42535 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42535( cx, "TestJSImplInterface" , "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42536 | |||||
| 42537 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42538 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42539 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42540 | if (objIsXray) { | ||||
| 42541 | unwrappedObj.emplace(cx, obj); | ||||
| 42542 | } | ||||
| 42543 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | ||||
| 42544 | if (args[0].isObject()) { | ||||
| 42545 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 42546 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferOrNull"); | ||||
| 42547 | return false; | ||||
| 42548 | } | ||||
| 42549 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 42550 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | ||||
| 42551 | return false; | ||||
| 42552 | } | ||||
| 42553 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 42554 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | ||||
| 42555 | return false; | ||||
| 42556 | } | ||||
| 42557 | } else if (args[0].isNullOrUndefined()) { | ||||
| 42558 | arg0.SetNull(); | ||||
| 42559 | } else { | ||||
| 42560 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | ||||
| 42561 | return false; | ||||
| 42562 | } | ||||
| 42563 | if (objIsXray) { | ||||
| 42564 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42565 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42566 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42567 | if (!unwrappedObj.ref()) { | ||||
| 42568 | return false; | ||||
| 42569 | } | ||||
| 42570 | } | ||||
| 42571 | FastErrorResult rv; | ||||
| 42572 | // NOTE: This assert does NOT call the function. | ||||
| 42573 | 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"); | ||||
| 42574 | MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42575 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter" )), 0))) { | ||||
| 42576 | return false; | ||||
| 42577 | } | ||||
| 42578 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42578); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42578; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42579 | |||||
| 42580 | return true; | ||||
| 42581 | } | ||||
| 42582 | |||||
| 42583 | static const JSJitInfo allowSharedNullableArrayBuffer_getterinfo = { | ||||
| 42584 | { get_allowSharedNullableArrayBuffer }, | ||||
| 42585 | { prototypes::id::TestJSImplInterface }, | ||||
| 42586 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42587 | JSJitInfo::Getter, | ||||
| 42588 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42589 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | ||||
| 42590 | false, /* isInfallible. False in setters. */ | ||||
| 42591 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42592 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42593 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42594 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42595 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42596 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42597 | }; | ||||
| 42598 | static const JSJitInfo allowSharedNullableArrayBuffer_setterinfo = { | ||||
| 42599 | { (JSJitGetterOp)set_allowSharedNullableArrayBuffer }, | ||||
| 42600 | { prototypes::id::TestJSImplInterface }, | ||||
| 42601 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42602 | JSJitInfo::Setter, | ||||
| 42603 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42604 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42605 | false, /* isInfallible. False in setters. */ | ||||
| 42606 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42607 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42608 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42609 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42610 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42611 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42612 | }; | ||||
| 42613 | |||||
| 42614 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42615 | passAllowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42616 | { | ||||
| 42617 | BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"); | ||||
| 42618 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42621( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42619 | "TestJSImplInterface", "passAllowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42621( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42620 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42621( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42621 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42621( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42622 | |||||
| 42623 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42624 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", 1)) { | ||||
| 42625 | return false; | ||||
| 42626 | } | ||||
| 42627 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42628 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42629 | if (objIsXray) { | ||||
| 42630 | unwrappedObj.emplace(cx, obj); | ||||
| 42631 | } | ||||
| 42632 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | ||||
| 42633 | if (args[0].isObject()) { | ||||
| 42634 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42635 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView"); | ||||
| 42636 | return false; | ||||
| 42637 | } | ||||
| 42638 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 42639 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 42640 | return false; | ||||
| 42641 | } | ||||
| 42642 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 42643 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 42644 | return false; | ||||
| 42645 | } | ||||
| 42646 | } else { | ||||
| 42647 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 42648 | return false; | ||||
| 42649 | } | ||||
| 42650 | if (objIsXray) { | ||||
| 42651 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42652 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42653 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42654 | if (!unwrappedObj.ref()) { | ||||
| 42655 | return false; | ||||
| 42656 | } | ||||
| 42657 | } | ||||
| 42658 | FastErrorResult rv; | ||||
| 42659 | // NOTE: This assert does NOT call the function. | ||||
| 42660 | 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"); | ||||
| 42661 | MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42662 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef" )), 0))) { | ||||
| 42663 | return false; | ||||
| 42664 | } | ||||
| 42665 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42665); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42665; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42666 | args.rval().setUndefined(); | ||||
| 42667 | return true; | ||||
| 42668 | } | ||||
| 42669 | |||||
| 42670 | static const JSJitInfo passAllowSharedArrayBufferViewTypedef_methodinfo = { | ||||
| 42671 | { (JSJitGetterOp)passAllowSharedArrayBufferViewTypedef }, | ||||
| 42672 | { prototypes::id::TestJSImplInterface }, | ||||
| 42673 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42674 | JSJitInfo::Method, | ||||
| 42675 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42676 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42677 | false, /* isInfallible. False in setters. */ | ||||
| 42678 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42679 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42680 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42681 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42682 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42683 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42684 | }; | ||||
| 42685 | |||||
| 42686 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42687 | passAllowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42688 | { | ||||
| 42689 | BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferView"); | ||||
| 42690 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42693( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42691 | "TestJSImplInterface", "passAllowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42693( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42692 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42693( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42693 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42693( cx, "TestJSImplInterface" , "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42694 | |||||
| 42695 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42696 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferView", 1)) { | ||||
| 42697 | return false; | ||||
| 42698 | } | ||||
| 42699 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42700 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42701 | if (objIsXray) { | ||||
| 42702 | unwrappedObj.emplace(cx, obj); | ||||
| 42703 | } | ||||
| 42704 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | ||||
| 42705 | if (args[0].isObject()) { | ||||
| 42706 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42707 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView"); | ||||
| 42708 | return false; | ||||
| 42709 | } | ||||
| 42710 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | ||||
| 42711 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 42712 | return false; | ||||
| 42713 | } | ||||
| 42714 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | ||||
| 42715 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 42716 | return false; | ||||
| 42717 | } | ||||
| 42718 | } else { | ||||
| 42719 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 42720 | return false; | ||||
| 42721 | } | ||||
| 42722 | if (objIsXray) { | ||||
| 42723 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42724 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42725 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42726 | if (!unwrappedObj.ref()) { | ||||
| 42727 | return false; | ||||
| 42728 | } | ||||
| 42729 | } | ||||
| 42730 | FastErrorResult rv; | ||||
| 42731 | // NOTE: This assert does NOT call the function. | ||||
| 42732 | 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"); | ||||
| 42733 | MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42734 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView" )), 0))) { | ||||
| 42735 | return false; | ||||
| 42736 | } | ||||
| 42737 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42737); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42737; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42738 | args.rval().setUndefined(); | ||||
| 42739 | return true; | ||||
| 42740 | } | ||||
| 42741 | |||||
| 42742 | static const JSJitInfo passAllowSharedArrayBufferView_methodinfo = { | ||||
| 42743 | { (JSJitGetterOp)passAllowSharedArrayBufferView }, | ||||
| 42744 | { prototypes::id::TestJSImplInterface }, | ||||
| 42745 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42746 | JSJitInfo::Method, | ||||
| 42747 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42748 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42749 | false, /* isInfallible. False in setters. */ | ||||
| 42750 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42751 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42752 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42753 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42754 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42755 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42756 | }; | ||||
| 42757 | |||||
| 42758 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42759 | passAllowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42760 | { | ||||
| 42761 | BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"); | ||||
| 42762 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42765( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42763 | "TestJSImplInterface", "passAllowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42765( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42764 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42765( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42765 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42765( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42766 | |||||
| 42767 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42768 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", 1)) { | ||||
| 42769 | return false; | ||||
| 42770 | } | ||||
| 42771 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42772 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42773 | if (objIsXray) { | ||||
| 42774 | unwrappedObj.emplace(cx, obj); | ||||
| 42775 | } | ||||
| 42776 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx); | ||||
| 42777 | if (args[0].isObject()) { | ||||
| 42778 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 42779 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferViewOrNull"); | ||||
| 42780 | return false; | ||||
| 42781 | } | ||||
| 42782 | if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) { | ||||
| 42783 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 42784 | return false; | ||||
| 42785 | } | ||||
| 42786 | if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) { | ||||
| 42787 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 42788 | return false; | ||||
| 42789 | } | ||||
| 42790 | } else if (args[0].isNullOrUndefined()) { | ||||
| 42791 | arg0.SetNull(); | ||||
| 42792 | } else { | ||||
| 42793 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 42794 | return false; | ||||
| 42795 | } | ||||
| 42796 | if (objIsXray) { | ||||
| 42797 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42798 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42799 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42800 | if (!unwrappedObj.ref()) { | ||||
| 42801 | return false; | ||||
| 42802 | } | ||||
| 42803 | } | ||||
| 42804 | FastErrorResult rv; | ||||
| 42805 | // NOTE: This assert does NOT call the function. | ||||
| 42806 | 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"); | ||||
| 42807 | MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42808 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView" )), 0))) { | ||||
| 42809 | return false; | ||||
| 42810 | } | ||||
| 42811 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42811; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42812 | args.rval().setUndefined(); | ||||
| 42813 | return true; | ||||
| 42814 | } | ||||
| 42815 | |||||
| 42816 | static const JSJitInfo passAllowSharedNullableArrayBufferView_methodinfo = { | ||||
| 42817 | { (JSJitGetterOp)passAllowSharedNullableArrayBufferView }, | ||||
| 42818 | { prototypes::id::TestJSImplInterface }, | ||||
| 42819 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42820 | JSJitInfo::Method, | ||||
| 42821 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42822 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42823 | false, /* isInfallible. False in setters. */ | ||||
| 42824 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42825 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42826 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42827 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42828 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42829 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42830 | }; | ||||
| 42831 | |||||
| 42832 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42833 | passAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42834 | { | ||||
| 42835 | BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBuffer"); | ||||
| 42836 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42839( cx, "TestJSImplInterface" , "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42837 | "TestJSImplInterface", "passAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42839( cx, "TestJSImplInterface" , "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42838 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42839( cx, "TestJSImplInterface" , "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42839 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42839( cx, "TestJSImplInterface" , "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42840 | |||||
| 42841 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42842 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBuffer", 1)) { | ||||
| 42843 | return false; | ||||
| 42844 | } | ||||
| 42845 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42846 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42847 | if (objIsXray) { | ||||
| 42848 | unwrappedObj.emplace(cx, obj); | ||||
| 42849 | } | ||||
| 42850 | RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx); | ||||
| 42851 | if (args[0].isObject()) { | ||||
| 42852 | if (!arg0.Init(&args[0].toObject())) { | ||||
| 42853 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer"); | ||||
| 42854 | return false; | ||||
| 42855 | } | ||||
| 42856 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) { | ||||
| 42857 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 42858 | return false; | ||||
| 42859 | } | ||||
| 42860 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) { | ||||
| 42861 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 42862 | return false; | ||||
| 42863 | } | ||||
| 42864 | } else { | ||||
| 42865 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 42866 | return false; | ||||
| 42867 | } | ||||
| 42868 | if (objIsXray) { | ||||
| 42869 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42870 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42871 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42872 | if (!unwrappedObj.ref()) { | ||||
| 42873 | return false; | ||||
| 42874 | } | ||||
| 42875 | } | ||||
| 42876 | FastErrorResult rv; | ||||
| 42877 | // NOTE: This assert does NOT call the function. | ||||
| 42878 | 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"); | ||||
| 42879 | MOZ_KnownLive(self)(self)->PassAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42880 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer" )), 0))) { | ||||
| 42881 | return false; | ||||
| 42882 | } | ||||
| 42883 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42883); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42883; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42884 | args.rval().setUndefined(); | ||||
| 42885 | return true; | ||||
| 42886 | } | ||||
| 42887 | |||||
| 42888 | static const JSJitInfo passAllowSharedArrayBuffer_methodinfo = { | ||||
| 42889 | { (JSJitGetterOp)passAllowSharedArrayBuffer }, | ||||
| 42890 | { prototypes::id::TestJSImplInterface }, | ||||
| 42891 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42892 | JSJitInfo::Method, | ||||
| 42893 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42894 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42895 | false, /* isInfallible. False in setters. */ | ||||
| 42896 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42897 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42898 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42899 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42900 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42901 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42902 | }; | ||||
| 42903 | |||||
| 42904 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42905 | passAllowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42906 | { | ||||
| 42907 | BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"); | ||||
| 42908 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42911( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42909 | "TestJSImplInterface", "passAllowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42911( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42910 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42911( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 42911 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42911( cx, "TestJSImplInterface" , "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 42912 | |||||
| 42913 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42914 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", 1)) { | ||||
| 42915 | return false; | ||||
| 42916 | } | ||||
| 42917 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42918 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42919 | if (objIsXray) { | ||||
| 42920 | unwrappedObj.emplace(cx, obj); | ||||
| 42921 | } | ||||
| 42922 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | ||||
| 42923 | if (args[0].isObject()) { | ||||
| 42924 | if (!arg0.SetValue().Init(&args[0].toObject())) { | ||||
| 42925 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | ||||
| 42926 | return false; | ||||
| 42927 | } | ||||
| 42928 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 42929 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | ||||
| 42930 | return false; | ||||
| 42931 | } | ||||
| 42932 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | ||||
| 42933 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | ||||
| 42934 | return false; | ||||
| 42935 | } | ||||
| 42936 | } else if (args[0].isNullOrUndefined()) { | ||||
| 42937 | arg0.SetNull(); | ||||
| 42938 | } else { | ||||
| 42939 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 42940 | return false; | ||||
| 42941 | } | ||||
| 42942 | if (objIsXray) { | ||||
| 42943 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 42944 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 42945 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 42946 | if (!unwrappedObj.ref()) { | ||||
| 42947 | return false; | ||||
| 42948 | } | ||||
| 42949 | } | ||||
| 42950 | FastErrorResult rv; | ||||
| 42951 | // NOTE: This assert does NOT call the function. | ||||
| 42952 | 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"); | ||||
| 42953 | MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 42954 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer" )), 0))) { | ||||
| 42955 | return false; | ||||
| 42956 | } | ||||
| 42957 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 42957); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 42957; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 42958 | args.rval().setUndefined(); | ||||
| 42959 | return true; | ||||
| 42960 | } | ||||
| 42961 | |||||
| 42962 | static const JSJitInfo passAllowSharedNullableArrayBuffer_methodinfo = { | ||||
| 42963 | { (JSJitGetterOp)passAllowSharedNullableArrayBuffer }, | ||||
| 42964 | { prototypes::id::TestJSImplInterface }, | ||||
| 42965 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 42966 | JSJitInfo::Method, | ||||
| 42967 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 42968 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 42969 | false, /* isInfallible. False in setters. */ | ||||
| 42970 | false, /* isMovable. Not relevant for setters. */ | ||||
| 42971 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 42972 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 42973 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 42974 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 42975 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 42976 | }; | ||||
| 42977 | |||||
| 42978 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 42979 | passUnionArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 42980 | { | ||||
| 42981 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionArrayBuffer"); | ||||
| 42982 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42985( cx, "TestJSImplInterface" , "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42983 | "TestJSImplInterface", "passUnionArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42985( cx, "TestJSImplInterface" , "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42984 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42985( cx, "TestJSImplInterface" , "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 42985 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42985( cx, "TestJSImplInterface" , "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 42986 | |||||
| 42987 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 42988 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionArrayBuffer", 1)) { | ||||
| 42989 | return false; | ||||
| 42990 | } | ||||
| 42991 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 42992 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 42993 | if (objIsXray) { | ||||
| 42994 | unwrappedObj.emplace(cx, obj); | ||||
| 42995 | } | ||||
| 42996 | StringOrArrayBuffer arg0; | ||||
| 42997 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 42998 | return false; | ||||
| 42999 | } | ||||
| 43000 | if (objIsXray) { | ||||
| 43001 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 43002 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 43003 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 43004 | if (!unwrappedObj.ref()) { | ||||
| 43005 | return false; | ||||
| 43006 | } | ||||
| 43007 | } | ||||
| 43008 | FastErrorResult rv; | ||||
| 43009 | // NOTE: This assert does NOT call the function. | ||||
| 43010 | 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"); | ||||
| 43011 | MOZ_KnownLive(self)(self)->PassUnionArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 43012 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer" )), 0))) { | ||||
| 43013 | return false; | ||||
| 43014 | } | ||||
| 43015 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 43015); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 43015; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 43016 | args.rval().setUndefined(); | ||||
| 43017 | return true; | ||||
| 43018 | } | ||||
| 43019 | |||||
| 43020 | static const JSJitInfo passUnionArrayBuffer_methodinfo = { | ||||
| 43021 | { (JSJitGetterOp)passUnionArrayBuffer }, | ||||
| 43022 | { prototypes::id::TestJSImplInterface }, | ||||
| 43023 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 43024 | JSJitInfo::Method, | ||||
| 43025 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 43026 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 43027 | false, /* isInfallible. False in setters. */ | ||||
| 43028 | false, /* isMovable. Not relevant for setters. */ | ||||
| 43029 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 43030 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 43031 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 43032 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 43033 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 43034 | }; | ||||
| 43035 | |||||
| 43036 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 43037 | passUnionAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 43038 | { | ||||
| 43039 | BindingCallContext cx(cx_, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"); | ||||
| 43040 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43043( cx, "TestJSImplInterface" , "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 43041 | "TestJSImplInterface", "passUnionAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43043( cx, "TestJSImplInterface" , "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 43042 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43043( cx, "TestJSImplInterface" , "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | ||||
| 43043 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43043( cx, "TestJSImplInterface" , "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | ||||
| 43044 | |||||
| 43045 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 43046 | if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", 1)) { | ||||
| 43047 | return false; | ||||
| 43048 | } | ||||
| 43049 | Maybe<JS::Rooted<JSObject*> > unwrappedObj; | ||||
| 43050 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 43051 | if (objIsXray) { | ||||
| 43052 | unwrappedObj.emplace(cx, obj); | ||||
| 43053 | } | ||||
| 43054 | StringOrMaybeSharedArrayBuffer arg0; | ||||
| 43055 | if (!arg0.Init(cx, args[0], "Argument 1", true)) { | ||||
| 43056 | return false; | ||||
| 43057 | } | ||||
| 43058 | if (objIsXray) { | ||||
| 43059 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 43060 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 43061 | unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref()); | ||||
| 43062 | if (!unwrappedObj.ref()) { | ||||
| 43063 | return false; | ||||
| 43064 | } | ||||
| 43065 | } | ||||
| 43066 | FastErrorResult rv; | ||||
| 43067 | // NOTE: This assert does NOT call the function. | ||||
| 43068 | 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"); | ||||
| 43069 | MOZ_KnownLive(self)(self)->PassUnionAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))); | ||||
| 43070 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer" )), 0))) { | ||||
| 43071 | return false; | ||||
| 43072 | } | ||||
| 43073 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 43073); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 43073; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 43074 | args.rval().setUndefined(); | ||||
| 43075 | return true; | ||||
| 43076 | } | ||||
| 43077 | |||||
| 43078 | static const JSJitInfo passUnionAllowSharedArrayBuffer_methodinfo = { | ||||
| 43079 | { (JSJitGetterOp)passUnionAllowSharedArrayBuffer }, | ||||
| 43080 | { prototypes::id::TestJSImplInterface }, | ||||
| 43081 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 43082 | JSJitInfo::Method, | ||||
| 43083 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 43084 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | ||||
| 43085 | false, /* isInfallible. False in setters. */ | ||||
| 43086 | false, /* isMovable. Not relevant for setters. */ | ||||
| 43087 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 43088 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 43089 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 43090 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 43091 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 43092 | }; | ||||
| 43093 | |||||
| 43094 | MOZ_CAN_RUN_SCRIPT static bool | ||||
| 43095 | toJSON(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | ||||
| 43096 | { | ||||
| 43097 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43100( cx, "TestJSImplInterface" , "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 43098 | "TestJSImplInterface", "toJSON", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43100( cx, "TestJSImplInterface" , "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 43099 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43100( cx, "TestJSImplInterface" , "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | ||||
| 43100 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43100( cx, "TestJSImplInterface" , "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | ||||
| 43101 | |||||
| 43102 | auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self); | ||||
| 43103 | JS::Rooted<JSObject*> result(cx, JS_NewPlainObject(cx)); | ||||
| 43104 | if (!result) { | ||||
| 43105 | return false; | ||||
| 43106 | } | ||||
| 43107 | if (!TestJSImplInterface_Binding::CollectJSONAttributes(cx, obj, MOZ_KnownLive(self)(self), result)) { | ||||
| 43108 | return false; | ||||
| 43109 | } | ||||
| 43110 | args.rval().setObject(*result); | ||||
| 43111 | return true; | ||||
| 43112 | } | ||||
| 43113 | |||||
| 43114 | static const JSJitInfo toJSON_methodinfo = { | ||||
| 43115 | { (JSJitGetterOp)toJSON }, | ||||
| 43116 | { prototypes::id::TestJSImplInterface }, | ||||
| 43117 | { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth }, | ||||
| 43118 | JSJitInfo::Method, | ||||
| 43119 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | ||||
| 43120 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | ||||
| 43121 | false, /* isInfallible. False in setters. */ | ||||
| 43122 | false, /* isMovable. Not relevant for setters. */ | ||||
| 43123 | false, /* isEliminatable. Not relevant for setters. */ | ||||
| 43124 | false, /* isAlwaysInSlot. Only relevant for getters. */ | ||||
| 43125 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | ||||
| 43126 | false, /* isTypedMethod. Only relevant for methods. */ | ||||
| 43127 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | ||||
| 43128 | }; | ||||
| 43129 | |||||
| 43130 | static bool | ||||
| 43131 | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) | ||||
| 43132 | { | ||||
| 43133 | mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj); | ||||
| 43134 | // We don't want to preserve if we don't have a wrapper, and we | ||||
| 43135 | // obviously can't preserve if we're not initialized. | ||||
| 43136 | if (self && self->GetWrapperPreserveColor()) { | ||||
| 43137 | PreserveWrapper(self); | ||||
| 43138 | } | ||||
| 43139 | return true; | ||||
| 43140 | } | ||||
| 43141 | |||||
| 43142 | static void | ||||
| 43143 | _finalize(JS::GCContext* gcx, JSObject* obj) | ||||
| 43144 | { | ||||
| 43145 | mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj); | ||||
| 43146 | if (self) { | ||||
| 43147 | JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue()); | ||||
| 43148 | ClearWrapper(self, self, obj); | ||||
| 43149 | if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) { | ||||
| 43150 | JS::RemoveAssociatedMemory(obj, mallocBytes, | ||||
| 43151 | JS::MemoryUse::DOMBinding); | ||||
| 43152 | } | ||||
| 43153 | AddForDeferredFinalization<mozilla::dom::TestJSImplInterface>(self); | ||||
| 43154 | } | ||||
| 43155 | } | ||||
| 43156 | |||||
| 43157 | static nsWrapperCache* | ||||
| 43158 | _getWrapperCache(JS::Handle<JSObject*> obj) | ||||
| 43159 | { | ||||
| 43160 | mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj); | ||||
| 43161 | return self; | ||||
| 43162 | } | ||||
| 43163 | |||||
| 43164 | static size_t | ||||
| 43165 | _objectMoved(JSObject* obj, JSObject* old) | ||||
| 43166 | { | ||||
| 43167 | mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj); | ||||
| 43168 | if (self) { | ||||
| 43169 | UpdateWrapper(self, self, obj, old); | ||||
| 43170 | } | ||||
| 43171 | |||||
| 43172 | return 0; | ||||
| 43173 | } | ||||
| 43174 | |||||
| 43175 | MOZ_GLOBINIT static const JSFunctionSpec sChromeStaticMethods_specs[] = { | ||||
| 43176 | JS_FNSPEC("_create", TestJSImplInterface::_Create, nullptr, 2, 0, nullptr){JSFunctionSpec::Name("_create"), {TestJSImplInterface::_Create , nullptr}, 2, 0, nullptr}, | ||||
| 43177 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr } | ||||
| 43178 | }; | ||||
| 43179 | |||||
| 43180 | |||||
| 43181 | static const Prefable<const JSFunctionSpec> sChromeStaticMethods[] = { | ||||
| 43182 | { nullptr, &sChromeStaticMethods_specs[0] }, | ||||
| 43183 | { nullptr, nullptr } | ||||
| 43184 | }; | ||||
| 43185 | |||||
| 43186 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43187 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43188 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43189 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43190 | |||||
| 43191 | MOZ_GLOBINIT static const JSFunctionSpec sMethods_specs[] = { | ||||
| 43192 | 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}, | ||||
| 43193 | 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}, | ||||
| 43194 | 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}, | ||||
| 43195 | 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}, | ||||
| 43196 | 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}, | ||||
| 43197 | 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}, | ||||
| 43198 | 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}, | ||||
| 43199 | 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}, | ||||
| 43200 | 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}, | ||||
| 43201 | 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}, | ||||
| 43202 | 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}, | ||||
| 43203 | 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}, | ||||
| 43204 | 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}, | ||||
| 43205 | 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}, | ||||
| 43206 | 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 }, | ||||
| 43207 | 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}, | ||||
| 43208 | 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}, | ||||
| 43209 | 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}, | ||||
| 43210 | 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}, | ||||
| 43211 | 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}, | ||||
| 43212 | 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}, | ||||
| 43213 | 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 }, | ||||
| 43214 | 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}, | ||||
| 43215 | 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}, | ||||
| 43216 | 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}, | ||||
| 43217 | 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}, | ||||
| 43218 | 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 }, | ||||
| 43219 | 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}, | ||||
| 43220 | 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}, | ||||
| 43221 | 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}, | ||||
| 43222 | 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}, | ||||
| 43223 | 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}, | ||||
| 43224 | 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}, | ||||
| 43225 | 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}, | ||||
| 43226 | 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}, | ||||
| 43227 | 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}, | ||||
| 43228 | 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}, | ||||
| 43229 | 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}, | ||||
| 43230 | 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}, | ||||
| 43231 | 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}, | ||||
| 43232 | 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}, | ||||
| 43233 | 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}, | ||||
| 43234 | 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}, | ||||
| 43235 | 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}, | ||||
| 43236 | 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}, | ||||
| 43237 | 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}, | ||||
| 43238 | 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}, | ||||
| 43239 | 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}, | ||||
| 43240 | 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}, | ||||
| 43241 | 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}, | ||||
| 43242 | 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}, | ||||
| 43243 | 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}, | ||||
| 43244 | 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}, | ||||
| 43245 | 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}, | ||||
| 43246 | 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}, | ||||
| 43247 | 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}, | ||||
| 43248 | 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}, | ||||
| 43249 | 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}, | ||||
| 43250 | 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}, | ||||
| 43251 | 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}, | ||||
| 43252 | 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}, | ||||
| 43253 | 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}, | ||||
| 43254 | 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 }, | ||||
| 43255 | 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}, | ||||
| 43256 | 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}, | ||||
| 43257 | 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}, | ||||
| 43258 | 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}, | ||||
| 43259 | 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}, | ||||
| 43260 | 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}, | ||||
| 43261 | 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}, | ||||
| 43262 | 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}, | ||||
| 43263 | 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}, | ||||
| 43264 | 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}, | ||||
| 43265 | 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}, | ||||
| 43266 | 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}, | ||||
| 43267 | 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}, | ||||
| 43268 | 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}, | ||||
| 43269 | 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}, | ||||
| 43270 | 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}, | ||||
| 43271 | 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}, | ||||
| 43272 | 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 }, | ||||
| 43273 | 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}, | ||||
| 43274 | 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}, | ||||
| 43275 | 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}, | ||||
| 43276 | 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}, | ||||
| 43277 | 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}, | ||||
| 43278 | 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}, | ||||
| 43279 | 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}, | ||||
| 43280 | 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}, | ||||
| 43281 | 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}, | ||||
| 43282 | 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}, | ||||
| 43283 | 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}, | ||||
| 43284 | 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}, | ||||
| 43285 | 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}, | ||||
| 43286 | 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}, | ||||
| 43287 | 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}, | ||||
| 43288 | 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}, | ||||
| 43289 | 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}, | ||||
| 43290 | 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}, | ||||
| 43291 | 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}, | ||||
| 43292 | 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}, | ||||
| 43293 | 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}, | ||||
| 43294 | 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}, | ||||
| 43295 | 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}, | ||||
| 43296 | 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}, | ||||
| 43297 | 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}, | ||||
| 43298 | 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}, | ||||
| 43299 | 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}, | ||||
| 43300 | 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}, | ||||
| 43301 | 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}, | ||||
| 43302 | 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}, | ||||
| 43303 | 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}, | ||||
| 43304 | 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}, | ||||
| 43305 | 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}, | ||||
| 43306 | 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}, | ||||
| 43307 | 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}, | ||||
| 43308 | 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}, | ||||
| 43309 | 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}, | ||||
| 43310 | 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}, | ||||
| 43311 | 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}, | ||||
| 43312 | 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}, | ||||
| 43313 | 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}, | ||||
| 43314 | 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}, | ||||
| 43315 | 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}, | ||||
| 43316 | 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}, | ||||
| 43317 | 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}, | ||||
| 43318 | 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}, | ||||
| 43319 | 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}, | ||||
| 43320 | 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}, | ||||
| 43321 | 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}, | ||||
| 43322 | 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}, | ||||
| 43323 | 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}, | ||||
| 43324 | 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}, | ||||
| 43325 | 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}, | ||||
| 43326 | 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}, | ||||
| 43327 | 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 }, | ||||
| 43328 | 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}, | ||||
| 43329 | 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}, | ||||
| 43330 | 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}, | ||||
| 43331 | 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}, | ||||
| 43332 | 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}, | ||||
| 43333 | 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}, | ||||
| 43334 | 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}, | ||||
| 43335 | 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}, | ||||
| 43336 | 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}, | ||||
| 43337 | 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}, | ||||
| 43338 | 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 }, | ||||
| 43339 | 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 }, | ||||
| 43340 | 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 }, | ||||
| 43341 | 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 }, | ||||
| 43342 | 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}, | ||||
| 43343 | 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}, | ||||
| 43344 | 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}, | ||||
| 43345 | 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}, | ||||
| 43346 | 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}, | ||||
| 43347 | 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}, | ||||
| 43348 | 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}, | ||||
| 43349 | 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}, | ||||
| 43350 | 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}, | ||||
| 43351 | 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}, | ||||
| 43352 | 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}, | ||||
| 43353 | 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}, | ||||
| 43354 | 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}, | ||||
| 43355 | 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}, | ||||
| 43356 | 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}, | ||||
| 43357 | 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}, | ||||
| 43358 | 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}, | ||||
| 43359 | 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}, | ||||
| 43360 | 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}, | ||||
| 43361 | 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 }, | ||||
| 43362 | 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}, | ||||
| 43363 | 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}, | ||||
| 43364 | 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}, | ||||
| 43365 | 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}, | ||||
| 43366 | 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}, | ||||
| 43367 | 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}, | ||||
| 43368 | 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}, | ||||
| 43369 | 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}, | ||||
| 43370 | 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}, | ||||
| 43371 | 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 }, | ||||
| 43372 | 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}, | ||||
| 43373 | 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}, | ||||
| 43374 | 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}, | ||||
| 43375 | 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}, | ||||
| 43376 | 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}, | ||||
| 43377 | 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}, | ||||
| 43378 | 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}, | ||||
| 43379 | 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}, | ||||
| 43380 | 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}, | ||||
| 43381 | 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}, | ||||
| 43382 | 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}, | ||||
| 43383 | 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}, | ||||
| 43384 | 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}, | ||||
| 43385 | 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}, | ||||
| 43386 | 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}, | ||||
| 43387 | 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}, | ||||
| 43388 | 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}, | ||||
| 43389 | 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 }, | ||||
| 43390 | 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}, | ||||
| 43391 | 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}, | ||||
| 43392 | 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}, | ||||
| 43393 | 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}, | ||||
| 43394 | 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}, | ||||
| 43395 | 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}, | ||||
| 43396 | 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}, | ||||
| 43397 | 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}, | ||||
| 43398 | 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}, | ||||
| 43399 | 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}, | ||||
| 43400 | 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}, | ||||
| 43401 | 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 }, | ||||
| 43402 | 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}, | ||||
| 43403 | 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}, | ||||
| 43404 | 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}, | ||||
| 43405 | 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}, | ||||
| 43406 | 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}, | ||||
| 43407 | 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}, | ||||
| 43408 | 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}, | ||||
| 43409 | 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}, | ||||
| 43410 | 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}, | ||||
| 43411 | 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}, | ||||
| 43412 | 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}, | ||||
| 43413 | 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}, | ||||
| 43414 | 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}, | ||||
| 43415 | 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}, | ||||
| 43416 | 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}, | ||||
| 43417 | 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}, | ||||
| 43418 | 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}, | ||||
| 43419 | 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}, | ||||
| 43420 | 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}, | ||||
| 43421 | 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}, | ||||
| 43422 | 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}, | ||||
| 43423 | 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}, | ||||
| 43424 | 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}, | ||||
| 43425 | 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}, | ||||
| 43426 | 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}, | ||||
| 43427 | 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}, | ||||
| 43428 | 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}, | ||||
| 43429 | 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}, | ||||
| 43430 | 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}, | ||||
| 43431 | 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}, | ||||
| 43432 | 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}, | ||||
| 43433 | 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}, | ||||
| 43434 | 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}, | ||||
| 43435 | 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}, | ||||
| 43436 | 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}, | ||||
| 43437 | 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}, | ||||
| 43438 | 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}, | ||||
| 43439 | 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}, | ||||
| 43440 | 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}, | ||||
| 43441 | 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}, | ||||
| 43442 | 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}, | ||||
| 43443 | 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}, | ||||
| 43444 | 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}, | ||||
| 43445 | 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}, | ||||
| 43446 | 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}, | ||||
| 43447 | 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 }, | ||||
| 43448 | 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}, | ||||
| 43449 | 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}, | ||||
| 43450 | 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}, | ||||
| 43451 | 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}, | ||||
| 43452 | 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}, | ||||
| 43453 | 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}, | ||||
| 43454 | 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}, | ||||
| 43455 | 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}, | ||||
| 43456 | 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}, | ||||
| 43457 | 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}, | ||||
| 43458 | 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}, | ||||
| 43459 | 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}, | ||||
| 43460 | 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}, | ||||
| 43461 | 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}, | ||||
| 43462 | 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}, | ||||
| 43463 | 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}, | ||||
| 43464 | 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}, | ||||
| 43465 | 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}, | ||||
| 43466 | 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}, | ||||
| 43467 | 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}, | ||||
| 43468 | 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}, | ||||
| 43469 | 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}, | ||||
| 43470 | 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}, | ||||
| 43471 | 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}, | ||||
| 43472 | 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}, | ||||
| 43473 | 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}, | ||||
| 43474 | 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}, | ||||
| 43475 | 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}, | ||||
| 43476 | 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}, | ||||
| 43477 | 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}, | ||||
| 43478 | 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}, | ||||
| 43479 | 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}, | ||||
| 43480 | 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}, | ||||
| 43481 | 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}, | ||||
| 43482 | 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}, | ||||
| 43483 | 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}, | ||||
| 43484 | 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}, | ||||
| 43485 | 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}, | ||||
| 43486 | 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}, | ||||
| 43487 | 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}, | ||||
| 43488 | 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}, | ||||
| 43489 | 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}, | ||||
| 43490 | 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}, | ||||
| 43491 | 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}, | ||||
| 43492 | 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}, | ||||
| 43493 | 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}, | ||||
| 43494 | 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}, | ||||
| 43495 | 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}, | ||||
| 43496 | 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}, | ||||
| 43497 | 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}, | ||||
| 43498 | 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}, | ||||
| 43499 | 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}, | ||||
| 43500 | 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}, | ||||
| 43501 | 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}, | ||||
| 43502 | 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}, | ||||
| 43503 | 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}, | ||||
| 43504 | 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}, | ||||
| 43505 | 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}, | ||||
| 43506 | 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}, | ||||
| 43507 | 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}, | ||||
| 43508 | 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}, | ||||
| 43509 | 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}, | ||||
| 43510 | 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}, | ||||
| 43511 | 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}, | ||||
| 43512 | 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}, | ||||
| 43513 | 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}, | ||||
| 43514 | 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}, | ||||
| 43515 | 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}, | ||||
| 43516 | 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}, | ||||
| 43517 | 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}, | ||||
| 43518 | 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}, | ||||
| 43519 | 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}, | ||||
| 43520 | 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}, | ||||
| 43521 | 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}, | ||||
| 43522 | 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}, | ||||
| 43523 | 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}, | ||||
| 43524 | 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}, | ||||
| 43525 | 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}, | ||||
| 43526 | 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}, | ||||
| 43527 | 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}, | ||||
| 43528 | 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}, | ||||
| 43529 | 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}, | ||||
| 43530 | 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}, | ||||
| 43531 | 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}, | ||||
| 43532 | 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}, | ||||
| 43533 | 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}, | ||||
| 43534 | 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}, | ||||
| 43535 | 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}, | ||||
| 43536 | 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}, | ||||
| 43537 | 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}, | ||||
| 43538 | 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}, | ||||
| 43539 | 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}, | ||||
| 43540 | 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}, | ||||
| 43541 | 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}, | ||||
| 43542 | 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}, | ||||
| 43543 | 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}, | ||||
| 43544 | 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}, | ||||
| 43545 | 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}, | ||||
| 43546 | 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}, | ||||
| 43547 | 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}, | ||||
| 43548 | 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}, | ||||
| 43549 | 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}, | ||||
| 43550 | 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}, | ||||
| 43551 | 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}, | ||||
| 43552 | 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}, | ||||
| 43553 | 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}, | ||||
| 43554 | 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}, | ||||
| 43555 | 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 }, | ||||
| 43556 | 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 }, | ||||
| 43557 | 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}, | ||||
| 43558 | 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}, | ||||
| 43559 | 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}, | ||||
| 43560 | 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}, | ||||
| 43561 | 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}, | ||||
| 43562 | 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}, | ||||
| 43563 | 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}, | ||||
| 43564 | 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}, | ||||
| 43565 | 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}, | ||||
| 43566 | 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 }, | ||||
| 43567 | 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}, | ||||
| 43568 | 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}, | ||||
| 43569 | 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}, | ||||
| 43570 | 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}, | ||||
| 43571 | 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}, | ||||
| 43572 | 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}, | ||||
| 43573 | 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}, | ||||
| 43574 | 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}, | ||||
| 43575 | 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}, | ||||
| 43576 | 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}, | ||||
| 43577 | 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}, | ||||
| 43578 | 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}, | ||||
| 43579 | 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 }, | ||||
| 43580 | 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}, | ||||
| 43581 | 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}, | ||||
| 43582 | 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}, | ||||
| 43583 | 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}, | ||||
| 43584 | 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}, | ||||
| 43585 | 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}, | ||||
| 43586 | 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}, | ||||
| 43587 | 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}, | ||||
| 43588 | 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}, | ||||
| 43589 | 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}, | ||||
| 43590 | 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}, | ||||
| 43591 | 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}, | ||||
| 43592 | 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}, | ||||
| 43593 | 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}, | ||||
| 43594 | 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}, | ||||
| 43595 | 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}, | ||||
| 43596 | 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}, | ||||
| 43597 | 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}, | ||||
| 43598 | 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}, | ||||
| 43599 | 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}, | ||||
| 43600 | 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}, | ||||
| 43601 | 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}, | ||||
| 43602 | 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}, | ||||
| 43603 | 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}, | ||||
| 43604 | 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}, | ||||
| 43605 | 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}, | ||||
| 43606 | 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}, | ||||
| 43607 | 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}, | ||||
| 43608 | 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}, | ||||
| 43609 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43610 | 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}, | ||||
| 43611 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43612 | 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}, | ||||
| 43613 | 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}, | ||||
| 43614 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43615 | 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}, | ||||
| 43616 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43617 | 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}, | ||||
| 43618 | 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}, | ||||
| 43619 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43620 | 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}, | ||||
| 43621 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43622 | 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}, | ||||
| 43623 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43624 | 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}, | ||||
| 43625 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43626 | 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}, | ||||
| 43627 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr }, | ||||
| 43628 | 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}, | ||||
| 43629 | 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 }, | ||||
| 43630 | 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 }, | ||||
| 43631 | 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}, | ||||
| 43632 | 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}, | ||||
| 43633 | 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}, | ||||
| 43634 | 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}, | ||||
| 43635 | 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 }, | ||||
| 43636 | 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}, | ||||
| 43637 | 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}, | ||||
| 43638 | 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}, | ||||
| 43639 | 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}, | ||||
| 43640 | 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}, | ||||
| 43641 | 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}, | ||||
| 43642 | 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}, | ||||
| 43643 | 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}, | ||||
| 43644 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr } | ||||
| 43645 | }; | ||||
| 43646 | |||||
| 43647 | static const PrefableDisablers sMethods_disablers418 = { | ||||
| 43648 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr | ||||
| 43649 | }; | ||||
| 43650 | |||||
| 43651 | static const PrefableDisablers sMethods_disablers420 = { | ||||
| 43652 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43653 | }; | ||||
| 43654 | |||||
| 43655 | static const PrefableDisablers sMethods_disablers423 = { | ||||
| 43656 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember | ||||
| 43657 | }; | ||||
| 43658 | |||||
| 43659 | static const PrefableDisablers sMethods_disablers425 = { | ||||
| 43660 | WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember | ||||
| 43661 | }; | ||||
| 43662 | |||||
| 43663 | static const PrefableDisablers sMethods_disablers428 = { | ||||
| 43664 | WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr | ||||
| 43665 | }; | ||||
| 43666 | |||||
| 43667 | static const PrefableDisablers sMethods_disablers430 = { | ||||
| 43668 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr | ||||
| 43669 | }; | ||||
| 43670 | |||||
| 43671 | static const PrefableDisablers sMethods_disablers432 = { | ||||
| 43672 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43673 | }; | ||||
| 43674 | |||||
| 43675 | static const PrefableDisablers sMethods_disablers434 = { | ||||
| 43676 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember | ||||
| 43677 | }; | ||||
| 43678 | |||||
| 43679 | static const Prefable<const JSFunctionSpec> sMethods[] = { | ||||
| 43680 | { nullptr, &sMethods_specs[0] }, | ||||
| 43681 | { &sMethods_disablers418, &sMethods_specs[418] }, | ||||
| 43682 | { &sMethods_disablers420, &sMethods_specs[420] }, | ||||
| 43683 | { &sMethods_disablers423, &sMethods_specs[423] }, | ||||
| 43684 | { &sMethods_disablers425, &sMethods_specs[425] }, | ||||
| 43685 | { &sMethods_disablers428, &sMethods_specs[428] }, | ||||
| 43686 | { &sMethods_disablers430, &sMethods_specs[430] }, | ||||
| 43687 | { &sMethods_disablers432, &sMethods_specs[432] }, | ||||
| 43688 | { &sMethods_disablers434, &sMethods_specs[434] }, | ||||
| 43689 | { nullptr, &sMethods_specs[436] }, | ||||
| 43690 | { nullptr, nullptr } | ||||
| 43691 | }; | ||||
| 43692 | |||||
| 43693 | static_assert(10 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43694 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43695 | static_assert(417 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43696 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43697 | |||||
| 43698 | MOZ_GLOBINIT static const JSFunctionSpec sChromeMethods_specs[] = { | ||||
| 43699 | 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}, | ||||
| 43700 | JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr } | ||||
| 43701 | }; | ||||
| 43702 | |||||
| 43703 | static const PrefableDisablers sChromeMethods_disablers0 = { | ||||
| 43704 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember | ||||
| 43705 | }; | ||||
| 43706 | |||||
| 43707 | static const Prefable<const JSFunctionSpec> sChromeMethods[] = { | ||||
| 43708 | { &sChromeMethods_disablers0, &sChromeMethods_specs[0] }, | ||||
| 43709 | { nullptr, nullptr } | ||||
| 43710 | }; | ||||
| 43711 | |||||
| 43712 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43713 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43714 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43715 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43716 | |||||
| 43717 | MOZ_GLOBINIT static const JSPropertySpec sAttributes_specs[] = { | ||||
| 43718 | JSPropertySpec::nativeAccessors("readonlyByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyByte_getterinfo, nullptr, nullptr), | ||||
| 43719 | JSPropertySpec::nativeAccessors("writableByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableByte_getterinfo, GenericSetter<NormalThisPolicy>, &writableByte_setterinfo), | ||||
| 43720 | JSPropertySpec::nativeAccessors("sideEffectFreeByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sideEffectFreeByte_getterinfo, GenericSetter<NormalThisPolicy>, &sideEffectFreeByte_setterinfo), | ||||
| 43721 | JSPropertySpec::nativeAccessors("domDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domDependentByte_getterinfo, GenericSetter<NormalThisPolicy>, &domDependentByte_setterinfo), | ||||
| 43722 | JSPropertySpec::nativeAccessors("constantByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &constantByte_getterinfo, nullptr, nullptr), | ||||
| 43723 | JSPropertySpec::nativeAccessors("deviceStateDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deviceStateDependentByte_getterinfo, nullptr, nullptr), | ||||
| 43724 | JSPropertySpec::nativeAccessors("readonlyShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyShort_getterinfo, nullptr, nullptr), | ||||
| 43725 | JSPropertySpec::nativeAccessors("writableShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableShort_setterinfo), | ||||
| 43726 | JSPropertySpec::nativeAccessors("readonlyLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLong_getterinfo, nullptr, nullptr), | ||||
| 43727 | JSPropertySpec::nativeAccessors("writableLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLong_setterinfo), | ||||
| 43728 | JSPropertySpec::nativeAccessors("readonlyLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLongLong_getterinfo, nullptr, nullptr), | ||||
| 43729 | JSPropertySpec::nativeAccessors("writableLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLongLong_setterinfo), | ||||
| 43730 | JSPropertySpec::nativeAccessors("readonlyOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyOctet_getterinfo, nullptr, nullptr), | ||||
| 43731 | JSPropertySpec::nativeAccessors("writableOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableOctet_getterinfo, GenericSetter<NormalThisPolicy>, &writableOctet_setterinfo), | ||||
| 43732 | JSPropertySpec::nativeAccessors("readonlyUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedShort_getterinfo, nullptr, nullptr), | ||||
| 43733 | JSPropertySpec::nativeAccessors("writableUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedShort_setterinfo), | ||||
| 43734 | JSPropertySpec::nativeAccessors("readonlyUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLong_getterinfo, nullptr, nullptr), | ||||
| 43735 | JSPropertySpec::nativeAccessors("writableUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLong_setterinfo), | ||||
| 43736 | JSPropertySpec::nativeAccessors("readonlyUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLongLong_getterinfo, nullptr, nullptr), | ||||
| 43737 | JSPropertySpec::nativeAccessors("writableUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLongLong_setterinfo), | ||||
| 43738 | JSPropertySpec::nativeAccessors("writableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableFloat_setterinfo), | ||||
| 43739 | JSPropertySpec::nativeAccessors("writableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedFloat_setterinfo), | ||||
| 43740 | JSPropertySpec::nativeAccessors("writableNullableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableFloat_setterinfo), | ||||
| 43741 | JSPropertySpec::nativeAccessors("writableNullableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedFloat_setterinfo), | ||||
| 43742 | JSPropertySpec::nativeAccessors("writableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableDouble_setterinfo), | ||||
| 43743 | JSPropertySpec::nativeAccessors("writableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedDouble_setterinfo), | ||||
| 43744 | JSPropertySpec::nativeAccessors("writableNullableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableDouble_setterinfo), | ||||
| 43745 | JSPropertySpec::nativeAccessors("writableNullableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedDouble_setterinfo), | ||||
| 43746 | JSPropertySpec::nativeAccessors("lenientFloatAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientFloatAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientFloatAttr_setterinfo), | ||||
| 43747 | JSPropertySpec::nativeAccessors("lenientDoubleAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientDoubleAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientDoubleAttr_setterinfo), | ||||
| 43748 | JSPropertySpec::nativeAccessors("nonNullSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullSelf_setterinfo), | ||||
| 43749 | JSPropertySpec::nativeAccessors("nullableSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nullableSelf_setterinfo), | ||||
| 43750 | JSPropertySpec::nativeAccessors("nonNullExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullExternal_setterinfo), | ||||
| 43751 | JSPropertySpec::nativeAccessors("nullableExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nullableExternal_setterinfo), | ||||
| 43752 | JSPropertySpec::nativeAccessors("nonNullCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullCallbackInterface_setterinfo), | ||||
| 43753 | JSPropertySpec::nativeAccessors("nullableCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nullableCallbackInterface_setterinfo), | ||||
| 43754 | JSPropertySpec::nativeAccessors("uint8ArrayAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &uint8ArrayAttr_getterinfo, GenericSetter<NormalThisPolicy>, &uint8ArrayAttr_setterinfo), | ||||
| 43755 | JSPropertySpec::nativeAccessors("readonlyJSStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyJSStringAttr_getterinfo, nullptr, nullptr), | ||||
| 43756 | JSPropertySpec::nativeAccessors("jsStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &jsStringAttr_getterinfo, GenericSetter<NormalThisPolicy>, &jsStringAttr_setterinfo), | ||||
| 43757 | JSPropertySpec::nativeAccessors("enumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enumAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &enumAttribute_setterinfo), | ||||
| 43758 | JSPropertySpec::nativeAccessors("readonlyEnumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyEnumAttribute_getterinfo, nullptr, nullptr), | ||||
| 43759 | JSPropertySpec::nativeAccessors("writableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnion_setterinfo), | ||||
| 43760 | JSPropertySpec::nativeAccessors("writableUnionContainingNull", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnionContainingNull_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnionContainingNull_setterinfo), | ||||
| 43761 | JSPropertySpec::nativeAccessors("writableNullableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnion_setterinfo), | ||||
| 43762 | JSPropertySpec::nativeAccessors("attributeGetterRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeGetterRenamedFrom_getterinfo, nullptr, nullptr), | ||||
| 43763 | JSPropertySpec::nativeAccessors("attributeRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeRenamedFrom_getterinfo, GenericSetter<NormalThisPolicy>, &attributeRenamedFrom_setterinfo), | ||||
| 43764 | JSPropertySpec::nativeAccessors("enforcedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByte_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByte_setterinfo), | ||||
| 43765 | JSPropertySpec::nativeAccessors("enforcedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByteNullable_setterinfo), | ||||
| 43766 | JSPropertySpec::nativeAccessors("clampedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByte_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByte_setterinfo), | ||||
| 43767 | JSPropertySpec::nativeAccessors("clampedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByteNullable_setterinfo), | ||||
| 43768 | JSPropertySpec::nativeAccessors("deprecatedAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deprecatedAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &deprecatedAttribute_setterinfo), | ||||
| 43769 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43770 | JSPropertySpec::nativeAccessors("prefable1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable1_getterinfo, nullptr, nullptr), | ||||
| 43771 | JSPropertySpec::nativeAccessors("prefable2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable2_getterinfo, nullptr, nullptr), | ||||
| 43772 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43773 | JSPropertySpec::nativeAccessors("prefable3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable3_getterinfo, nullptr, nullptr), | ||||
| 43774 | JSPropertySpec::nativeAccessors("prefable4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable4_getterinfo, nullptr, nullptr), | ||||
| 43775 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43776 | JSPropertySpec::nativeAccessors("prefable5", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable5_getterinfo, nullptr, nullptr), | ||||
| 43777 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43778 | JSPropertySpec::nativeAccessors("prefable6", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable6_getterinfo, nullptr, nullptr), | ||||
| 43779 | JSPropertySpec::nativeAccessors("prefable7", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable7_getterinfo, nullptr, nullptr), | ||||
| 43780 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43781 | JSPropertySpec::nativeAccessors("prefable8", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable8_getterinfo, nullptr, nullptr), | ||||
| 43782 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43783 | JSPropertySpec::nativeAccessors("prefable9", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable9_getterinfo, nullptr, nullptr), | ||||
| 43784 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43785 | JSPropertySpec::nativeAccessors("prefable12", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable12_getterinfo, nullptr, nullptr), | ||||
| 43786 | JSPropertySpec::nativeAccessors("prefable14", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable14_getterinfo, nullptr, nullptr), | ||||
| 43787 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43788 | JSPropertySpec::nativeAccessors("prefable15", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable15_getterinfo, nullptr, nullptr), | ||||
| 43789 | JSPropertySpec::nativeAccessors("prefable16", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable16_getterinfo, nullptr, nullptr), | ||||
| 43790 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43791 | JSPropertySpec::nativeAccessors("conditionalOnSecureContext1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext1_getterinfo, nullptr, nullptr), | ||||
| 43792 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43793 | JSPropertySpec::nativeAccessors("conditionalOnSecureContext2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext2_getterinfo, nullptr, nullptr), | ||||
| 43794 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43795 | JSPropertySpec::nativeAccessors("conditionalOnSecureContext3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext3_getterinfo, nullptr, nullptr), | ||||
| 43796 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43797 | JSPropertySpec::nativeAccessors("conditionalOnSecureContext4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext4_getterinfo, nullptr, nullptr), | ||||
| 43798 | JS_PS_ENDJSPropertySpec::sentinel(), | ||||
| 43799 | JSPropertySpec::nativeAccessors("attrWithLenientThis", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &attrWithLenientThis_getterinfo, GenericSetter<LenientThisPolicy>, &attrWithLenientThis_setterinfo), | ||||
| 43800 | JSPropertySpec::nativeAccessors("putForwardsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr_setterinfo), | ||||
| 43801 | JSPropertySpec::nativeAccessors("putForwardsAttr2", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &putForwardsAttr2_getterinfo, GenericSetter<LenientThisPolicy>, &putForwardsAttr2_setterinfo), | ||||
| 43802 | JSPropertySpec::nativeAccessors("throwingAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingAttr_setterinfo), | ||||
| 43803 | JSPropertySpec::nativeAccessors("throwingGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingGetterAttr_setterinfo), | ||||
| 43804 | JSPropertySpec::nativeAccessors("throwingSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingSetterAttr_setterinfo), | ||||
| 43805 | JSPropertySpec::nativeAccessors("canOOMAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMAttr_setterinfo), | ||||
| 43806 | JSPropertySpec::nativeAccessors("canOOMGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMGetterAttr_setterinfo), | ||||
| 43807 | JSPropertySpec::nativeAccessors("canOOMSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMSetterAttr_setterinfo), | ||||
| 43808 | JSPropertySpec::nativeAccessors("ceReactionsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ceReactionsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &ceReactionsAttr_setterinfo), | ||||
| 43809 | JSPropertySpec::nativeAccessors("toJSONShouldSkipThis", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis_setterinfo), | ||||
| 43810 | JSPropertySpec::nativeAccessors("toJSONShouldSkipThis2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis2_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis2_setterinfo), | ||||
| 43811 | JSPropertySpec::nativeAccessors("toJSONShouldSkipThis3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis3_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis3_setterinfo), | ||||
| 43812 | JSPropertySpec::nativeAccessors("dashed-attribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dashed_attribute_getterinfo, GenericSetter<NormalThisPolicy>, &dashed_attribute_setterinfo), | ||||
| 43813 | JSPropertySpec::nativeAccessors("nonEnumerableAttr", 0, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonEnumerableAttr_getterinfo, GenericSetter<NormalThisPolicy>, &nonEnumerableAttr_setterinfo), | ||||
| 43814 | JSPropertySpec::nativeAccessors("allowSharedArrayBufferViewTypedef", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferViewTypedef_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferViewTypedef_setterinfo), | ||||
| 43815 | JSPropertySpec::nativeAccessors("allowSharedArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferView_setterinfo), | ||||
| 43816 | JSPropertySpec::nativeAccessors("allowSharedNullableArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBufferView_setterinfo), | ||||
| 43817 | JSPropertySpec::nativeAccessors("allowSharedArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBuffer_setterinfo), | ||||
| 43818 | JSPropertySpec::nativeAccessors("allowSharedNullableArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBuffer_setterinfo), | ||||
| 43819 | JS_PS_ENDJSPropertySpec::sentinel() | ||||
| 43820 | }; | ||||
| 43821 | |||||
| 43822 | static const PrefableDisablers sAttributes_disablers52 = { | ||||
| 43823 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr | ||||
| 43824 | }; | ||||
| 43825 | |||||
| 43826 | static const PrefableDisablers sAttributes_disablers55 = { | ||||
| 43827 | WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), nullptr | ||||
| 43828 | }; | ||||
| 43829 | |||||
| 43830 | static const PrefableDisablers sAttributes_disablers58 = { | ||||
| 43831 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr | ||||
| 43832 | }; | ||||
| 43833 | |||||
| 43834 | static const PrefableDisablers sAttributes_disablers60 = { | ||||
| 43835 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43836 | }; | ||||
| 43837 | |||||
| 43838 | static const PrefableDisablers sAttributes_disablers63 = { | ||||
| 43839 | WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43840 | }; | ||||
| 43841 | |||||
| 43842 | static const PrefableDisablers sAttributes_disablers65 = { | ||||
| 43843 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43844 | }; | ||||
| 43845 | |||||
| 43846 | static const PrefableDisablers sAttributes_disablers67 = { | ||||
| 43847 | WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember | ||||
| 43848 | }; | ||||
| 43849 | |||||
| 43850 | static const PrefableDisablers sAttributes_disablers70 = { | ||||
| 43851 | WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember | ||||
| 43852 | }; | ||||
| 43853 | |||||
| 43854 | static const PrefableDisablers sAttributes_disablers73 = { | ||||
| 43855 | WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr | ||||
| 43856 | }; | ||||
| 43857 | |||||
| 43858 | static const PrefableDisablers sAttributes_disablers75 = { | ||||
| 43859 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr | ||||
| 43860 | }; | ||||
| 43861 | |||||
| 43862 | static const PrefableDisablers sAttributes_disablers77 = { | ||||
| 43863 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled | ||||
| 43864 | }; | ||||
| 43865 | |||||
| 43866 | static const PrefableDisablers sAttributes_disablers79 = { | ||||
| 43867 | WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember | ||||
| 43868 | }; | ||||
| 43869 | |||||
| 43870 | static const Prefable<const JSPropertySpec> sAttributes[] = { | ||||
| 43871 | { nullptr, &sAttributes_specs[0] }, | ||||
| 43872 | { &sAttributes_disablers52, &sAttributes_specs[52] }, | ||||
| 43873 | { &sAttributes_disablers55, &sAttributes_specs[55] }, | ||||
| 43874 | { &sAttributes_disablers58, &sAttributes_specs[58] }, | ||||
| 43875 | { &sAttributes_disablers60, &sAttributes_specs[60] }, | ||||
| 43876 | { &sAttributes_disablers63, &sAttributes_specs[63] }, | ||||
| 43877 | { &sAttributes_disablers65, &sAttributes_specs[65] }, | ||||
| 43878 | { &sAttributes_disablers67, &sAttributes_specs[67] }, | ||||
| 43879 | { &sAttributes_disablers70, &sAttributes_specs[70] }, | ||||
| 43880 | { &sAttributes_disablers73, &sAttributes_specs[73] }, | ||||
| 43881 | { &sAttributes_disablers75, &sAttributes_specs[75] }, | ||||
| 43882 | { &sAttributes_disablers77, &sAttributes_specs[77] }, | ||||
| 43883 | { &sAttributes_disablers79, &sAttributes_specs[79] }, | ||||
| 43884 | { nullptr, &sAttributes_specs[81] }, | ||||
| 43885 | { nullptr, nullptr } | ||||
| 43886 | }; | ||||
| 43887 | |||||
| 43888 | static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43889 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43890 | static_assert(51 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43891 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43892 | |||||
| 43893 | MOZ_GLOBINIT static const JSPropertySpec sChromeAttributes_specs[] = { | ||||
| 43894 | JSPropertySpec::nativeAccessors("putForwardsAttr3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr3_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr3_setterinfo), | ||||
| 43895 | JS_PS_ENDJSPropertySpec::sentinel() | ||||
| 43896 | }; | ||||
| 43897 | |||||
| 43898 | |||||
| 43899 | static const Prefable<const JSPropertySpec> sChromeAttributes[] = { | ||||
| 43900 | { nullptr, &sChromeAttributes_specs[0] }, | ||||
| 43901 | { nullptr, nullptr } | ||||
| 43902 | }; | ||||
| 43903 | |||||
| 43904 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43905 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43906 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43907 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43908 | |||||
| 43909 | MOZ_GLOBINIT static const ConstantSpec sConstants_specs[] = { | ||||
| 43910 | { "myLongConstant", JS::Int32Value(5) }, | ||||
| 43911 | { "nonEnumerableConst", JS::BooleanValue(true) }, | ||||
| 43912 | { 0, JS::UndefinedValue() } | ||||
| 43913 | }; | ||||
| 43914 | |||||
| 43915 | |||||
| 43916 | static const Prefable<const ConstantSpec> sConstants[] = { | ||||
| 43917 | { nullptr, &sConstants_specs[0] }, | ||||
| 43918 | { nullptr, nullptr } | ||||
| 43919 | }; | ||||
| 43920 | |||||
| 43921 | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13, | ||||
| 43922 | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); | ||||
| 43923 | static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16, | ||||
| 43924 | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); | ||||
| 43925 | |||||
| 43926 | |||||
| 43927 | static uint16_t sNativeProperties_sortedPropertyIndices[533]; | ||||
| 43928 | static PropertyInfo sNativeProperties_propertyInfos[533]; | ||||
| 43929 | |||||
| 43930 | static const NativePropertiesN<3> sNativeProperties = { | ||||
| 43931 | false, 0, | ||||
| 43932 | false, 0, | ||||
| 43933 | true, 0 /* sMethods */, | ||||
| 43934 | true, 1 /* sAttributes */, | ||||
| 43935 | false, 0, | ||||
| 43936 | false, 0, | ||||
| 43937 | true, 2 /* sConstants */, | ||||
| 43938 | -1, | ||||
| 43939 | 533, | ||||
| 43940 | sNativeProperties_sortedPropertyIndices, | ||||
| 43941 | { | ||||
| 43942 | { sMethods, &sNativeProperties_propertyInfos[0] }, | ||||
| 43943 | { sAttributes, &sNativeProperties_propertyInfos[443] }, | ||||
| 43944 | { sConstants, &sNativeProperties_propertyInfos[531] } | ||||
| 43945 | } | ||||
| 43946 | }; | ||||
| 43947 | static_assert(533 < 1ull << (CHAR_BIT8 * sizeof(sNativeProperties.propertyInfoCount)), | ||||
| 43948 | "We have a property info count that is oversized"); | ||||
| 43949 | |||||
| 43950 | static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[3]; | ||||
| 43951 | static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[3]; | ||||
| 43952 | |||||
| 43953 | static const NativePropertiesN<3> sChromeOnlyNativeProperties = { | ||||
| 43954 | true, 0 /* sChromeStaticMethods */, | ||||
| 43955 | false, 0, | ||||
| 43956 | true, 1 /* sChromeMethods */, | ||||
| 43957 | true, 2 /* sChromeAttributes */, | ||||
| 43958 | false, 0, | ||||
| 43959 | false, 0, | ||||
| 43960 | false, 0, | ||||
| 43961 | -1, | ||||
| 43962 | 3, | ||||
| 43963 | sChromeOnlyNativeProperties_sortedPropertyIndices, | ||||
| 43964 | { | ||||
| 43965 | { sChromeStaticMethods, &sChromeOnlyNativeProperties_propertyInfos[0] }, | ||||
| 43966 | { sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[1] }, | ||||
| 43967 | { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[2] } | ||||
| 43968 | } | ||||
| 43969 | }; | ||||
| 43970 | static_assert(3 < 1ull << (CHAR_BIT8 * sizeof(sChromeOnlyNativeProperties.propertyInfoCount)), | ||||
| 43971 | "We have a property info count that is oversized"); | ||||
| 43972 | |||||
| 43973 | MOZ_CAN_RUN_SCRIPT bool | ||||
| 43974 | CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TestJSImplInterface* self, JS::Rooted<JSObject*>& result) | ||||
| 43975 | { | ||||
| 43976 | JS::Rooted<JSObject*> unwrappedObj(cx, js::CheckedUnwrapStatic(obj)); | ||||
| 43977 | if (!unwrappedObj) { | ||||
| 43978 | // How did that happen? We managed to get called with that | ||||
| 43979 | // object as "this"! Just give up on sanity. | ||||
| 43980 | return false; | ||||
| 43981 | } | ||||
| 43982 | |||||
| 43983 | { // scope for "temp" | ||||
| 43984 | JS::Rooted<JS::Value> temp(cx); | ||||
| 43985 | if (!get_readonlyByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 43986 | return false; | ||||
| 43987 | } | ||||
| 43988 | if (!JS_DefineProperty(cx, result, "readonlyByte", temp, JSPROP_ENUMERATE)) { | ||||
| 43989 | return false; | ||||
| 43990 | } | ||||
| 43991 | } | ||||
| 43992 | { // scope for "temp" | ||||
| 43993 | JS::Rooted<JS::Value> temp(cx); | ||||
| 43994 | if (!get_writableByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 43995 | return false; | ||||
| 43996 | } | ||||
| 43997 | if (!JS_DefineProperty(cx, result, "writableByte", temp, JSPROP_ENUMERATE)) { | ||||
| 43998 | return false; | ||||
| 43999 | } | ||||
| 44000 | } | ||||
| 44001 | { // scope for "temp" | ||||
| 44002 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44003 | if (!get_sideEffectFreeByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44004 | return false; | ||||
| 44005 | } | ||||
| 44006 | if (!JS_DefineProperty(cx, result, "sideEffectFreeByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44007 | return false; | ||||
| 44008 | } | ||||
| 44009 | } | ||||
| 44010 | { // scope for "temp" | ||||
| 44011 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44012 | if (!get_domDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44013 | return false; | ||||
| 44014 | } | ||||
| 44015 | if (!JS_DefineProperty(cx, result, "domDependentByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44016 | return false; | ||||
| 44017 | } | ||||
| 44018 | } | ||||
| 44019 | { // scope for "temp" | ||||
| 44020 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44021 | if (!get_constantByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44022 | return false; | ||||
| 44023 | } | ||||
| 44024 | if (!JS_DefineProperty(cx, result, "constantByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44025 | return false; | ||||
| 44026 | } | ||||
| 44027 | } | ||||
| 44028 | { // scope for "temp" | ||||
| 44029 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44030 | if (!get_deviceStateDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44031 | return false; | ||||
| 44032 | } | ||||
| 44033 | if (!JS_DefineProperty(cx, result, "deviceStateDependentByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44034 | return false; | ||||
| 44035 | } | ||||
| 44036 | } | ||||
| 44037 | { // scope for "temp" | ||||
| 44038 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44039 | if (!get_readonlyShort(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44040 | return false; | ||||
| 44041 | } | ||||
| 44042 | if (!JS_DefineProperty(cx, result, "readonlyShort", temp, JSPROP_ENUMERATE)) { | ||||
| 44043 | return false; | ||||
| 44044 | } | ||||
| 44045 | } | ||||
| 44046 | { // scope for "temp" | ||||
| 44047 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44048 | if (!get_writableShort(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44049 | return false; | ||||
| 44050 | } | ||||
| 44051 | if (!JS_DefineProperty(cx, result, "writableShort", temp, JSPROP_ENUMERATE)) { | ||||
| 44052 | return false; | ||||
| 44053 | } | ||||
| 44054 | } | ||||
| 44055 | { // scope for "temp" | ||||
| 44056 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44057 | if (!get_readonlyLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44058 | return false; | ||||
| 44059 | } | ||||
| 44060 | if (!JS_DefineProperty(cx, result, "readonlyLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44061 | return false; | ||||
| 44062 | } | ||||
| 44063 | } | ||||
| 44064 | { // scope for "temp" | ||||
| 44065 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44066 | if (!get_writableLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44067 | return false; | ||||
| 44068 | } | ||||
| 44069 | if (!JS_DefineProperty(cx, result, "writableLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44070 | return false; | ||||
| 44071 | } | ||||
| 44072 | } | ||||
| 44073 | { // scope for "temp" | ||||
| 44074 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44075 | if (!get_readonlyLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44076 | return false; | ||||
| 44077 | } | ||||
| 44078 | if (!JS_DefineProperty(cx, result, "readonlyLongLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44079 | return false; | ||||
| 44080 | } | ||||
| 44081 | } | ||||
| 44082 | { // scope for "temp" | ||||
| 44083 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44084 | if (!get_writableLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44085 | return false; | ||||
| 44086 | } | ||||
| 44087 | if (!JS_DefineProperty(cx, result, "writableLongLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44088 | return false; | ||||
| 44089 | } | ||||
| 44090 | } | ||||
| 44091 | { // scope for "temp" | ||||
| 44092 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44093 | if (!get_readonlyOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44094 | return false; | ||||
| 44095 | } | ||||
| 44096 | if (!JS_DefineProperty(cx, result, "readonlyOctet", temp, JSPROP_ENUMERATE)) { | ||||
| 44097 | return false; | ||||
| 44098 | } | ||||
| 44099 | } | ||||
| 44100 | { // scope for "temp" | ||||
| 44101 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44102 | if (!get_writableOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44103 | return false; | ||||
| 44104 | } | ||||
| 44105 | if (!JS_DefineProperty(cx, result, "writableOctet", temp, JSPROP_ENUMERATE)) { | ||||
| 44106 | return false; | ||||
| 44107 | } | ||||
| 44108 | } | ||||
| 44109 | { // scope for "temp" | ||||
| 44110 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44111 | if (!get_readonlyUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44112 | return false; | ||||
| 44113 | } | ||||
| 44114 | if (!JS_DefineProperty(cx, result, "readonlyUnsignedShort", temp, JSPROP_ENUMERATE)) { | ||||
| 44115 | return false; | ||||
| 44116 | } | ||||
| 44117 | } | ||||
| 44118 | { // scope for "temp" | ||||
| 44119 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44120 | if (!get_writableUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44121 | return false; | ||||
| 44122 | } | ||||
| 44123 | if (!JS_DefineProperty(cx, result, "writableUnsignedShort", temp, JSPROP_ENUMERATE)) { | ||||
| 44124 | return false; | ||||
| 44125 | } | ||||
| 44126 | } | ||||
| 44127 | { // scope for "temp" | ||||
| 44128 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44129 | if (!get_readonlyUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44130 | return false; | ||||
| 44131 | } | ||||
| 44132 | if (!JS_DefineProperty(cx, result, "readonlyUnsignedLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44133 | return false; | ||||
| 44134 | } | ||||
| 44135 | } | ||||
| 44136 | { // scope for "temp" | ||||
| 44137 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44138 | if (!get_writableUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44139 | return false; | ||||
| 44140 | } | ||||
| 44141 | if (!JS_DefineProperty(cx, result, "writableUnsignedLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44142 | return false; | ||||
| 44143 | } | ||||
| 44144 | } | ||||
| 44145 | { // scope for "temp" | ||||
| 44146 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44147 | if (!get_readonlyUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44148 | return false; | ||||
| 44149 | } | ||||
| 44150 | if (!JS_DefineProperty(cx, result, "readonlyUnsignedLongLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44151 | return false; | ||||
| 44152 | } | ||||
| 44153 | } | ||||
| 44154 | { // scope for "temp" | ||||
| 44155 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44156 | if (!get_writableUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44157 | return false; | ||||
| 44158 | } | ||||
| 44159 | if (!JS_DefineProperty(cx, result, "writableUnsignedLongLong", temp, JSPROP_ENUMERATE)) { | ||||
| 44160 | return false; | ||||
| 44161 | } | ||||
| 44162 | } | ||||
| 44163 | { // scope for "temp" | ||||
| 44164 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44165 | if (!get_writableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44166 | return false; | ||||
| 44167 | } | ||||
| 44168 | if (!JS_DefineProperty(cx, result, "writableFloat", temp, JSPROP_ENUMERATE)) { | ||||
| 44169 | return false; | ||||
| 44170 | } | ||||
| 44171 | } | ||||
| 44172 | { // scope for "temp" | ||||
| 44173 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44174 | if (!get_writableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44175 | return false; | ||||
| 44176 | } | ||||
| 44177 | if (!JS_DefineProperty(cx, result, "writableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) { | ||||
| 44178 | return false; | ||||
| 44179 | } | ||||
| 44180 | } | ||||
| 44181 | { // scope for "temp" | ||||
| 44182 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44183 | if (!get_writableNullableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44184 | return false; | ||||
| 44185 | } | ||||
| 44186 | if (!JS_DefineProperty(cx, result, "writableNullableFloat", temp, JSPROP_ENUMERATE)) { | ||||
| 44187 | return false; | ||||
| 44188 | } | ||||
| 44189 | } | ||||
| 44190 | { // scope for "temp" | ||||
| 44191 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44192 | if (!get_writableNullableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44193 | return false; | ||||
| 44194 | } | ||||
| 44195 | if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) { | ||||
| 44196 | return false; | ||||
| 44197 | } | ||||
| 44198 | } | ||||
| 44199 | { // scope for "temp" | ||||
| 44200 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44201 | if (!get_writableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44202 | return false; | ||||
| 44203 | } | ||||
| 44204 | if (!JS_DefineProperty(cx, result, "writableDouble", temp, JSPROP_ENUMERATE)) { | ||||
| 44205 | return false; | ||||
| 44206 | } | ||||
| 44207 | } | ||||
| 44208 | { // scope for "temp" | ||||
| 44209 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44210 | if (!get_writableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44211 | return false; | ||||
| 44212 | } | ||||
| 44213 | if (!JS_DefineProperty(cx, result, "writableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) { | ||||
| 44214 | return false; | ||||
| 44215 | } | ||||
| 44216 | } | ||||
| 44217 | { // scope for "temp" | ||||
| 44218 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44219 | if (!get_writableNullableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44220 | return false; | ||||
| 44221 | } | ||||
| 44222 | if (!JS_DefineProperty(cx, result, "writableNullableDouble", temp, JSPROP_ENUMERATE)) { | ||||
| 44223 | return false; | ||||
| 44224 | } | ||||
| 44225 | } | ||||
| 44226 | { // scope for "temp" | ||||
| 44227 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44228 | if (!get_writableNullableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44229 | return false; | ||||
| 44230 | } | ||||
| 44231 | if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) { | ||||
| 44232 | return false; | ||||
| 44233 | } | ||||
| 44234 | } | ||||
| 44235 | { // scope for "temp" | ||||
| 44236 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44237 | if (!get_lenientFloatAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44238 | return false; | ||||
| 44239 | } | ||||
| 44240 | if (!JS_DefineProperty(cx, result, "lenientFloatAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44241 | return false; | ||||
| 44242 | } | ||||
| 44243 | } | ||||
| 44244 | { // scope for "temp" | ||||
| 44245 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44246 | if (!get_lenientDoubleAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44247 | return false; | ||||
| 44248 | } | ||||
| 44249 | if (!JS_DefineProperty(cx, result, "lenientDoubleAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44250 | return false; | ||||
| 44251 | } | ||||
| 44252 | } | ||||
| 44253 | { // scope for "temp" | ||||
| 44254 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44255 | if (!get_nonNullSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44256 | return false; | ||||
| 44257 | } | ||||
| 44258 | if (!JS_DefineProperty(cx, result, "nonNullSelf", temp, JSPROP_ENUMERATE)) { | ||||
| 44259 | return false; | ||||
| 44260 | } | ||||
| 44261 | } | ||||
| 44262 | { // scope for "temp" | ||||
| 44263 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44264 | if (!get_nullableSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44265 | return false; | ||||
| 44266 | } | ||||
| 44267 | if (!JS_DefineProperty(cx, result, "nullableSelf", temp, JSPROP_ENUMERATE)) { | ||||
| 44268 | return false; | ||||
| 44269 | } | ||||
| 44270 | } | ||||
| 44271 | { // scope for "temp" | ||||
| 44272 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44273 | if (!get_readonlyJSStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44274 | return false; | ||||
| 44275 | } | ||||
| 44276 | if (!JS_DefineProperty(cx, result, "readonlyJSStringAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44277 | return false; | ||||
| 44278 | } | ||||
| 44279 | } | ||||
| 44280 | { // scope for "temp" | ||||
| 44281 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44282 | if (!get_jsStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44283 | return false; | ||||
| 44284 | } | ||||
| 44285 | if (!JS_DefineProperty(cx, result, "jsStringAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44286 | return false; | ||||
| 44287 | } | ||||
| 44288 | } | ||||
| 44289 | { // scope for "temp" | ||||
| 44290 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44291 | if (!get_enumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44292 | return false; | ||||
| 44293 | } | ||||
| 44294 | if (!JS_DefineProperty(cx, result, "enumAttribute", temp, JSPROP_ENUMERATE)) { | ||||
| 44295 | return false; | ||||
| 44296 | } | ||||
| 44297 | } | ||||
| 44298 | { // scope for "temp" | ||||
| 44299 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44300 | if (!get_readonlyEnumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44301 | return false; | ||||
| 44302 | } | ||||
| 44303 | if (!JS_DefineProperty(cx, result, "readonlyEnumAttribute", temp, JSPROP_ENUMERATE)) { | ||||
| 44304 | return false; | ||||
| 44305 | } | ||||
| 44306 | } | ||||
| 44307 | { // scope for "temp" | ||||
| 44308 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44309 | if (!get_attributeGetterRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44310 | return false; | ||||
| 44311 | } | ||||
| 44312 | if (!JS_DefineProperty(cx, result, "attributeGetterRenamedFrom", temp, JSPROP_ENUMERATE)) { | ||||
| 44313 | return false; | ||||
| 44314 | } | ||||
| 44315 | } | ||||
| 44316 | { // scope for "temp" | ||||
| 44317 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44318 | if (!get_attributeRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44319 | return false; | ||||
| 44320 | } | ||||
| 44321 | if (!JS_DefineProperty(cx, result, "attributeRenamedFrom", temp, JSPROP_ENUMERATE)) { | ||||
| 44322 | return false; | ||||
| 44323 | } | ||||
| 44324 | } | ||||
| 44325 | { // scope for "temp" | ||||
| 44326 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44327 | if (!get_enforcedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44328 | return false; | ||||
| 44329 | } | ||||
| 44330 | if (!JS_DefineProperty(cx, result, "enforcedByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44331 | return false; | ||||
| 44332 | } | ||||
| 44333 | } | ||||
| 44334 | { // scope for "temp" | ||||
| 44335 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44336 | if (!get_enforcedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44337 | return false; | ||||
| 44338 | } | ||||
| 44339 | if (!JS_DefineProperty(cx, result, "enforcedByteNullable", temp, JSPROP_ENUMERATE)) { | ||||
| 44340 | return false; | ||||
| 44341 | } | ||||
| 44342 | } | ||||
| 44343 | { // scope for "temp" | ||||
| 44344 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44345 | if (!get_clampedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44346 | return false; | ||||
| 44347 | } | ||||
| 44348 | if (!JS_DefineProperty(cx, result, "clampedByte", temp, JSPROP_ENUMERATE)) { | ||||
| 44349 | return false; | ||||
| 44350 | } | ||||
| 44351 | } | ||||
| 44352 | { // scope for "temp" | ||||
| 44353 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44354 | if (!get_clampedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44355 | return false; | ||||
| 44356 | } | ||||
| 44357 | if (!JS_DefineProperty(cx, result, "clampedByteNullable", temp, JSPROP_ENUMERATE)) { | ||||
| 44358 | return false; | ||||
| 44359 | } | ||||
| 44360 | } | ||||
| 44361 | { // scope for "temp" | ||||
| 44362 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44363 | if (!get_deprecatedAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44364 | return false; | ||||
| 44365 | } | ||||
| 44366 | if (!JS_DefineProperty(cx, result, "deprecatedAttribute", temp, JSPROP_ENUMERATE)) { | ||||
| 44367 | return false; | ||||
| 44368 | } | ||||
| 44369 | } | ||||
| 44370 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44371 | // only do it for things which _might_ be disabled, which should | ||||
| 44372 | // help keep the performance problems down. | ||||
| 44373 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable1, sAttributes)) { | ||||
| 44374 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44375 | if (!get_prefable1(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44376 | return false; | ||||
| 44377 | } | ||||
| 44378 | if (!JS_DefineProperty(cx, result, "prefable1", temp, JSPROP_ENUMERATE)) { | ||||
| 44379 | return false; | ||||
| 44380 | } | ||||
| 44381 | } | ||||
| 44382 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44383 | // only do it for things which _might_ be disabled, which should | ||||
| 44384 | // help keep the performance problems down. | ||||
| 44385 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable2, sAttributes)) { | ||||
| 44386 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44387 | if (!get_prefable2(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44388 | return false; | ||||
| 44389 | } | ||||
| 44390 | if (!JS_DefineProperty(cx, result, "prefable2", temp, JSPROP_ENUMERATE)) { | ||||
| 44391 | return false; | ||||
| 44392 | } | ||||
| 44393 | } | ||||
| 44394 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44395 | // only do it for things which _might_ be disabled, which should | ||||
| 44396 | // help keep the performance problems down. | ||||
| 44397 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable3, sAttributes)) { | ||||
| 44398 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44399 | if (!get_prefable3(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44400 | return false; | ||||
| 44401 | } | ||||
| 44402 | if (!JS_DefineProperty(cx, result, "prefable3", temp, JSPROP_ENUMERATE)) { | ||||
| 44403 | return false; | ||||
| 44404 | } | ||||
| 44405 | } | ||||
| 44406 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44407 | // only do it for things which _might_ be disabled, which should | ||||
| 44408 | // help keep the performance problems down. | ||||
| 44409 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable4, sAttributes)) { | ||||
| 44410 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44411 | if (!get_prefable4(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44412 | return false; | ||||
| 44413 | } | ||||
| 44414 | if (!JS_DefineProperty(cx, result, "prefable4", temp, JSPROP_ENUMERATE)) { | ||||
| 44415 | return false; | ||||
| 44416 | } | ||||
| 44417 | } | ||||
| 44418 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44419 | // only do it for things which _might_ be disabled, which should | ||||
| 44420 | // help keep the performance problems down. | ||||
| 44421 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable5, sAttributes)) { | ||||
| 44422 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44423 | if (!get_prefable5(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44424 | return false; | ||||
| 44425 | } | ||||
| 44426 | if (!JS_DefineProperty(cx, result, "prefable5", temp, JSPROP_ENUMERATE)) { | ||||
| 44427 | return false; | ||||
| 44428 | } | ||||
| 44429 | } | ||||
| 44430 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44431 | // only do it for things which _might_ be disabled, which should | ||||
| 44432 | // help keep the performance problems down. | ||||
| 44433 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable6, sAttributes)) { | ||||
| 44434 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44435 | if (!get_prefable6(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44436 | return false; | ||||
| 44437 | } | ||||
| 44438 | if (!JS_DefineProperty(cx, result, "prefable6", temp, JSPROP_ENUMERATE)) { | ||||
| 44439 | return false; | ||||
| 44440 | } | ||||
| 44441 | } | ||||
| 44442 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44443 | // only do it for things which _might_ be disabled, which should | ||||
| 44444 | // help keep the performance problems down. | ||||
| 44445 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable7, sAttributes)) { | ||||
| 44446 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44447 | if (!get_prefable7(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44448 | return false; | ||||
| 44449 | } | ||||
| 44450 | if (!JS_DefineProperty(cx, result, "prefable7", temp, JSPROP_ENUMERATE)) { | ||||
| 44451 | return false; | ||||
| 44452 | } | ||||
| 44453 | } | ||||
| 44454 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44455 | // only do it for things which _might_ be disabled, which should | ||||
| 44456 | // help keep the performance problems down. | ||||
| 44457 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable8, sAttributes)) { | ||||
| 44458 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44459 | if (!get_prefable8(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44460 | return false; | ||||
| 44461 | } | ||||
| 44462 | if (!JS_DefineProperty(cx, result, "prefable8", temp, JSPROP_ENUMERATE)) { | ||||
| 44463 | return false; | ||||
| 44464 | } | ||||
| 44465 | } | ||||
| 44466 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44467 | // only do it for things which _might_ be disabled, which should | ||||
| 44468 | // help keep the performance problems down. | ||||
| 44469 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable9, sAttributes)) { | ||||
| 44470 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44471 | if (!get_prefable9(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44472 | return false; | ||||
| 44473 | } | ||||
| 44474 | if (!JS_DefineProperty(cx, result, "prefable9", temp, JSPROP_ENUMERATE)) { | ||||
| 44475 | return false; | ||||
| 44476 | } | ||||
| 44477 | } | ||||
| 44478 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44479 | // only do it for things which _might_ be disabled, which should | ||||
| 44480 | // help keep the performance problems down. | ||||
| 44481 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable12, sAttributes)) { | ||||
| 44482 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44483 | if (!get_prefable12(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44484 | return false; | ||||
| 44485 | } | ||||
| 44486 | if (!JS_DefineProperty(cx, result, "prefable12", temp, JSPROP_ENUMERATE)) { | ||||
| 44487 | return false; | ||||
| 44488 | } | ||||
| 44489 | } | ||||
| 44490 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44491 | // only do it for things which _might_ be disabled, which should | ||||
| 44492 | // help keep the performance problems down. | ||||
| 44493 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable14, sAttributes)) { | ||||
| 44494 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44495 | if (!get_prefable14(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44496 | return false; | ||||
| 44497 | } | ||||
| 44498 | if (!JS_DefineProperty(cx, result, "prefable14", temp, JSPROP_ENUMERATE)) { | ||||
| 44499 | return false; | ||||
| 44500 | } | ||||
| 44501 | } | ||||
| 44502 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44503 | // only do it for things which _might_ be disabled, which should | ||||
| 44504 | // help keep the performance problems down. | ||||
| 44505 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable15, sAttributes)) { | ||||
| 44506 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44507 | if (!get_prefable15(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44508 | return false; | ||||
| 44509 | } | ||||
| 44510 | if (!JS_DefineProperty(cx, result, "prefable15", temp, JSPROP_ENUMERATE)) { | ||||
| 44511 | return false; | ||||
| 44512 | } | ||||
| 44513 | } | ||||
| 44514 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44515 | // only do it for things which _might_ be disabled, which should | ||||
| 44516 | // help keep the performance problems down. | ||||
| 44517 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable16, sAttributes)) { | ||||
| 44518 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44519 | if (!get_prefable16(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44520 | return false; | ||||
| 44521 | } | ||||
| 44522 | if (!JS_DefineProperty(cx, result, "prefable16", temp, JSPROP_ENUMERATE)) { | ||||
| 44523 | return false; | ||||
| 44524 | } | ||||
| 44525 | } | ||||
| 44526 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44527 | // only do it for things which _might_ be disabled, which should | ||||
| 44528 | // help keep the performance problems down. | ||||
| 44529 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext1, sAttributes)) { | ||||
| 44530 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44531 | if (!get_conditionalOnSecureContext1(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44532 | return false; | ||||
| 44533 | } | ||||
| 44534 | if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext1", temp, JSPROP_ENUMERATE)) { | ||||
| 44535 | return false; | ||||
| 44536 | } | ||||
| 44537 | } | ||||
| 44538 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44539 | // only do it for things which _might_ be disabled, which should | ||||
| 44540 | // help keep the performance problems down. | ||||
| 44541 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext2, sAttributes)) { | ||||
| 44542 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44543 | if (!get_conditionalOnSecureContext2(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44544 | return false; | ||||
| 44545 | } | ||||
| 44546 | if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext2", temp, JSPROP_ENUMERATE)) { | ||||
| 44547 | return false; | ||||
| 44548 | } | ||||
| 44549 | } | ||||
| 44550 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44551 | // only do it for things which _might_ be disabled, which should | ||||
| 44552 | // help keep the performance problems down. | ||||
| 44553 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext3, sAttributes)) { | ||||
| 44554 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44555 | if (!get_conditionalOnSecureContext3(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44556 | return false; | ||||
| 44557 | } | ||||
| 44558 | if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext3", temp, JSPROP_ENUMERATE)) { | ||||
| 44559 | return false; | ||||
| 44560 | } | ||||
| 44561 | } | ||||
| 44562 | // This is unfortunately a linear scan through sAttributes, but we | ||||
| 44563 | // only do it for things which _might_ be disabled, which should | ||||
| 44564 | // help keep the performance problems down. | ||||
| 44565 | if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext4, sAttributes)) { | ||||
| 44566 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44567 | if (!get_conditionalOnSecureContext4(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44568 | return false; | ||||
| 44569 | } | ||||
| 44570 | if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext4", temp, JSPROP_ENUMERATE)) { | ||||
| 44571 | return false; | ||||
| 44572 | } | ||||
| 44573 | } | ||||
| 44574 | { // scope for "temp" | ||||
| 44575 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44576 | if (!get_attrWithLenientThis(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44577 | return false; | ||||
| 44578 | } | ||||
| 44579 | if (!JS_DefineProperty(cx, result, "attrWithLenientThis", temp, JSPROP_ENUMERATE)) { | ||||
| 44580 | return false; | ||||
| 44581 | } | ||||
| 44582 | } | ||||
| 44583 | { // scope for "temp" | ||||
| 44584 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44585 | if (!get_putForwardsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44586 | return false; | ||||
| 44587 | } | ||||
| 44588 | if (!JS_DefineProperty(cx, result, "putForwardsAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44589 | return false; | ||||
| 44590 | } | ||||
| 44591 | } | ||||
| 44592 | { // scope for "temp" | ||||
| 44593 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44594 | if (!get_putForwardsAttr2(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44595 | return false; | ||||
| 44596 | } | ||||
| 44597 | if (!JS_DefineProperty(cx, result, "putForwardsAttr2", temp, JSPROP_ENUMERATE)) { | ||||
| 44598 | return false; | ||||
| 44599 | } | ||||
| 44600 | } | ||||
| 44601 | { // scope for "temp" | ||||
| 44602 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44603 | if (!get_putForwardsAttr3(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44604 | return false; | ||||
| 44605 | } | ||||
| 44606 | if (!JS_DefineProperty(cx, result, "putForwardsAttr3", temp, JSPROP_ENUMERATE)) { | ||||
| 44607 | return false; | ||||
| 44608 | } | ||||
| 44609 | } | ||||
| 44610 | { // scope for "temp" | ||||
| 44611 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44612 | if (!get_throwingAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44613 | return false; | ||||
| 44614 | } | ||||
| 44615 | if (!JS_DefineProperty(cx, result, "throwingAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44616 | return false; | ||||
| 44617 | } | ||||
| 44618 | } | ||||
| 44619 | { // scope for "temp" | ||||
| 44620 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44621 | if (!get_throwingGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44622 | return false; | ||||
| 44623 | } | ||||
| 44624 | if (!JS_DefineProperty(cx, result, "throwingGetterAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44625 | return false; | ||||
| 44626 | } | ||||
| 44627 | } | ||||
| 44628 | { // scope for "temp" | ||||
| 44629 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44630 | if (!get_throwingSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44631 | return false; | ||||
| 44632 | } | ||||
| 44633 | if (!JS_DefineProperty(cx, result, "throwingSetterAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44634 | return false; | ||||
| 44635 | } | ||||
| 44636 | } | ||||
| 44637 | { // scope for "temp" | ||||
| 44638 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44639 | if (!get_canOOMAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44640 | return false; | ||||
| 44641 | } | ||||
| 44642 | if (!JS_DefineProperty(cx, result, "canOOMAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44643 | return false; | ||||
| 44644 | } | ||||
| 44645 | } | ||||
| 44646 | { // scope for "temp" | ||||
| 44647 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44648 | if (!get_canOOMGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44649 | return false; | ||||
| 44650 | } | ||||
| 44651 | if (!JS_DefineProperty(cx, result, "canOOMGetterAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44652 | return false; | ||||
| 44653 | } | ||||
| 44654 | } | ||||
| 44655 | { // scope for "temp" | ||||
| 44656 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44657 | if (!get_canOOMSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44658 | return false; | ||||
| 44659 | } | ||||
| 44660 | if (!JS_DefineProperty(cx, result, "canOOMSetterAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44661 | return false; | ||||
| 44662 | } | ||||
| 44663 | } | ||||
| 44664 | { // scope for "temp" | ||||
| 44665 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44666 | if (!get_ceReactionsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44667 | return false; | ||||
| 44668 | } | ||||
| 44669 | if (!JS_DefineProperty(cx, result, "ceReactionsAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44670 | return false; | ||||
| 44671 | } | ||||
| 44672 | } | ||||
| 44673 | { // scope for "temp" | ||||
| 44674 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44675 | if (!get_dashed_attribute(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44676 | return false; | ||||
| 44677 | } | ||||
| 44678 | if (!JS_DefineProperty(cx, result, "dashed_attribute", temp, JSPROP_ENUMERATE)) { | ||||
| 44679 | return false; | ||||
| 44680 | } | ||||
| 44681 | } | ||||
| 44682 | { // scope for "temp" | ||||
| 44683 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44684 | if (!get_nonEnumerableAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) { | ||||
| 44685 | return false; | ||||
| 44686 | } | ||||
| 44687 | if (!JS_DefineProperty(cx, result, "nonEnumerableAttr", temp, JSPROP_ENUMERATE)) { | ||||
| 44688 | return false; | ||||
| 44689 | } | ||||
| 44690 | } | ||||
| 44691 | return true; | ||||
| 44692 | } | ||||
| 44693 | |||||
| 44694 | bool sNativePropertiesInited = false; | ||||
| 44695 | const NativePropertyHooks sNativePropertyHooks = { | ||||
| 44696 | nullptr, | ||||
| 44697 | { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast(), &sNativePropertiesInited }, | ||||
| 44698 | prototypes::id::TestJSImplInterface, | ||||
| 44699 | constructors::id::TestJSImplInterface, | ||||
| 44700 | &DefaultXrayExpandoObjectClass | ||||
| 44701 | }; | ||||
| 44702 | |||||
| 44703 | static bool | ||||
| 44704 | _constructor(JSContext* cx_, unsigned argc, JS::Value* vp) | ||||
| 44705 | { | ||||
| 44706 | BindingCallContext cx(cx_, "TestJSImplInterface constructor"); | ||||
| 44707 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject44709( cx, "TestJSImplInterface" , "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 44708 | "TestJSImplInterface", "constructor", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject44709( cx, "TestJSImplInterface" , "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | ||||
| 44709 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject44709( cx, "TestJSImplInterface" , "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | ||||
| 44710 | |||||
| 44711 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | ||||
| 44712 | JS::Rooted<JSObject*> obj(cx, &args.callee()); | ||||
| 44713 | if (!args.isConstructing()) { | ||||
| 44714 | return ThrowConstructorWithoutNew(cx, "TestJSImplInterface"); | ||||
| 44715 | } | ||||
| 44716 | |||||
| 44717 | JS::Rooted<JSObject*> desiredProto(cx); | ||||
| 44718 | if (!GetDesiredProto(cx, args, | ||||
| 44719 | prototypes::id::TestJSImplInterface, | ||||
| 44720 | CreateInterfaceObjects, | ||||
| 44721 | &desiredProto)) { | ||||
| 44722 | return false; | ||||
| 44723 | } | ||||
| 44724 | |||||
| 44725 | if (!args.requireAtLeast(cx, "TestJSImplInterface constructor", 15)) { | ||||
| 44726 | return false; | ||||
| 44727 | } | ||||
| 44728 | GlobalObject global(cx, obj); | ||||
| 44729 | if (global.Failed()) { | ||||
| 44730 | return false; | ||||
| 44731 | } | ||||
| 44732 | |||||
| 44733 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | ||||
| 44734 | binding_detail::FakeString<char16_t> arg0; | ||||
| 44735 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | ||||
| 44736 | return false; | ||||
| 44737 | } | ||||
| 44738 | uint32_t arg1; | ||||
| 44739 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) { | ||||
| 44740 | return false; | ||||
| 44741 | } | ||||
| 44742 | Nullable<bool> arg2; | ||||
| 44743 | if (args[2].isNullOrUndefined()) { | ||||
| 44744 | arg2.SetNull(); | ||||
| 44745 | } else if (!ValueToPrimitive<bool, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) { | ||||
| 44746 | return false; | ||||
| 44747 | } | ||||
| 44748 | mozilla::dom::TestInterface* arg3; | ||||
| 44749 | if (args[3].isObject()) { | ||||
| 44750 | { | ||||
| 44751 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 44752 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[3], arg3, cx); | ||||
| 44753 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 44754 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 4", "TestInterface"); | ||||
| 44755 | return false; | ||||
| 44756 | } | ||||
| 44757 | } | ||||
| 44758 | } else if (args[3].isNullOrUndefined()) { | ||||
| 44759 | arg3 = nullptr; | ||||
| 44760 | } else { | ||||
| 44761 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 4"); | ||||
| 44762 | return false; | ||||
| 44763 | } | ||||
| 44764 | int32_t arg4; | ||||
| 44765 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], "Argument 5", &arg4)) { | ||||
| 44766 | return false; | ||||
| 44767 | } | ||||
| 44768 | RootedDictionary<binding_detail::FastDictForConstructor> arg5(cx); | ||||
| 44769 | if (!arg5.Init(cx, args[5], "Argument 6", true)) { | ||||
| 44770 | return false; | ||||
| 44771 | } | ||||
| 44772 | JS::Rooted<JS::Value> arg6(cx); | ||||
| 44773 | #ifdef __clang__1 | ||||
| 44774 | #pragma clang diagnostic push | ||||
| 44775 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44776 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44777 | #endif // __clang__ | ||||
| 44778 | if ((true) && !CallerSubsumes(args[6])) { | ||||
| 44779 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 7"); | ||||
| 44780 | return false; | ||||
| 44781 | } | ||||
| 44782 | #ifdef __clang__1 | ||||
| 44783 | #pragma clang diagnostic pop | ||||
| 44784 | #endif // __clang__ | ||||
| 44785 | arg6 = args[6]; | ||||
| 44786 | JS::Rooted<JSObject*> arg7(cx); | ||||
| 44787 | if (args[7].isObject()) { | ||||
| 44788 | #ifdef __clang__1 | ||||
| 44789 | #pragma clang diagnostic push | ||||
| 44790 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44791 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44792 | #endif // __clang__ | ||||
| 44793 | if ((true) && !CallerSubsumes(args[7])) { | ||||
| 44794 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 8"); | ||||
| 44795 | return false; | ||||
| 44796 | } | ||||
| 44797 | #ifdef __clang__1 | ||||
| 44798 | #pragma clang diagnostic pop | ||||
| 44799 | #endif // __clang__ | ||||
| 44800 | arg7 = &args[7].toObject(); | ||||
| 44801 | } else { | ||||
| 44802 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 8"); | ||||
| 44803 | return false; | ||||
| 44804 | } | ||||
| 44805 | JS::Rooted<JSObject*> arg8(cx); | ||||
| 44806 | if (args[8].isObject()) { | ||||
| 44807 | #ifdef __clang__1 | ||||
| 44808 | #pragma clang diagnostic push | ||||
| 44809 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44810 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44811 | #endif // __clang__ | ||||
| 44812 | if ((true) && !CallerSubsumes(args[8])) { | ||||
| 44813 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 9"); | ||||
| 44814 | return false; | ||||
| 44815 | } | ||||
| 44816 | #ifdef __clang__1 | ||||
| 44817 | #pragma clang diagnostic pop | ||||
| 44818 | #endif // __clang__ | ||||
| 44819 | arg8 = &args[8].toObject(); | ||||
| 44820 | } else if (args[8].isNullOrUndefined()) { | ||||
| 44821 | arg8 = nullptr; | ||||
| 44822 | } else { | ||||
| 44823 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 9"); | ||||
| 44824 | return false; | ||||
| 44825 | } | ||||
| 44826 | binding_detail::AutoSequence<Dict> arg9; | ||||
| 44827 | SequenceRooter<Dict> arg9_holder(cx, &arg9); | ||||
| 44828 | if (args[9].isObject()) { | ||||
| 44829 | JS::ForOfIterator iter(cx); | ||||
| 44830 | if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) { | ||||
| 44831 | return false; | ||||
| 44832 | } | ||||
| 44833 | if (!iter.valueIsIterable()) { | ||||
| 44834 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | ||||
| 44835 | return false; | ||||
| 44836 | } | ||||
| 44837 | binding_detail::AutoSequence<Dict> &arr = arg9; | ||||
| 44838 | JS::Rooted<JS::Value> temp(cx); | ||||
| 44839 | while (true) { | ||||
| 44840 | bool done; | ||||
| 44841 | if (!iter.next(&temp, &done)) { | ||||
| 44842 | return false; | ||||
| 44843 | } | ||||
| 44844 | if (done) { | ||||
| 44845 | break; | ||||
| 44846 | } | ||||
| 44847 | Dict* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 44848 | if (!slotPtr) { | ||||
| 44849 | JS_ReportOutOfMemory(cx); | ||||
| 44850 | return false; | ||||
| 44851 | } | ||||
| 44852 | Dict& slot = *slotPtr; | ||||
| 44853 | if (!slot.Init(cx, temp, "Element of argument 10", true)) { | ||||
| 44854 | return false; | ||||
| 44855 | } | ||||
| 44856 | } | ||||
| 44857 | } else { | ||||
| 44858 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | ||||
| 44859 | return false; | ||||
| 44860 | } | ||||
| 44861 | JS::Rooted<JS::Value> arg10(cx); | ||||
| 44862 | if (args.hasDefined(10)) { | ||||
| 44863 | #ifdef __clang__1 | ||||
| 44864 | #pragma clang diagnostic push | ||||
| 44865 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44866 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44867 | #endif // __clang__ | ||||
| 44868 | if ((true) && !CallerSubsumes(args[10])) { | ||||
| 44869 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 11"); | ||||
| 44870 | return false; | ||||
| 44871 | } | ||||
| 44872 | #ifdef __clang__1 | ||||
| 44873 | #pragma clang diagnostic pop | ||||
| 44874 | #endif // __clang__ | ||||
| 44875 | arg10 = args[10]; | ||||
| 44876 | } else { | ||||
| 44877 | arg10 = JS::UndefinedValue(); | ||||
| 44878 | } | ||||
| 44879 | Optional<JS::Handle<JSObject*>> arg11; | ||||
| 44880 | if (args.hasDefined(11)) { | ||||
| 44881 | arg11.Construct(cx); | ||||
| 44882 | if (args[11].isObject()) { | ||||
| 44883 | #ifdef __clang__1 | ||||
| 44884 | #pragma clang diagnostic push | ||||
| 44885 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44886 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44887 | #endif // __clang__ | ||||
| 44888 | if ((true) && !CallerSubsumes(args[11])) { | ||||
| 44889 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 12"); | ||||
| 44890 | return false; | ||||
| 44891 | } | ||||
| 44892 | #ifdef __clang__1 | ||||
| 44893 | #pragma clang diagnostic pop | ||||
| 44894 | #endif // __clang__ | ||||
| 44895 | arg11.Value() = &args[11].toObject(); | ||||
| 44896 | } else { | ||||
| 44897 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 12"); | ||||
| 44898 | return false; | ||||
| 44899 | } | ||||
| 44900 | } | ||||
| 44901 | Optional<JS::Handle<JSObject*>> arg12; | ||||
| 44902 | if (args.hasDefined(12)) { | ||||
| 44903 | arg12.Construct(cx); | ||||
| 44904 | if (args[12].isObject()) { | ||||
| 44905 | #ifdef __clang__1 | ||||
| 44906 | #pragma clang diagnostic push | ||||
| 44907 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 44908 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 44909 | #endif // __clang__ | ||||
| 44910 | if ((true) && !CallerSubsumes(args[12])) { | ||||
| 44911 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 13"); | ||||
| 44912 | return false; | ||||
| 44913 | } | ||||
| 44914 | #ifdef __clang__1 | ||||
| 44915 | #pragma clang diagnostic pop | ||||
| 44916 | #endif // __clang__ | ||||
| 44917 | arg12.Value() = &args[12].toObject(); | ||||
| 44918 | } else if (args[12].isNullOrUndefined()) { | ||||
| 44919 | arg12.Value() = nullptr; | ||||
| 44920 | } else { | ||||
| 44921 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 13"); | ||||
| 44922 | return false; | ||||
| 44923 | } | ||||
| 44924 | } | ||||
| 44925 | RootedSpiderMonkeyInterface<Uint8Array> arg13(cx); | ||||
| 44926 | if (args[13].isObject()) { | ||||
| 44927 | if (!arg13.Init(&args[13].toObject())) { | ||||
| 44928 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 14", "Uint8Array"); | ||||
| 44929 | return false; | ||||
| 44930 | } | ||||
| 44931 | if (JS::IsArrayBufferViewShared(arg13.Obj())) { | ||||
| 44932 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 14"); | ||||
| 44933 | return false; | ||||
| 44934 | } | ||||
| 44935 | if (JS::IsLargeArrayBufferView(arg13.Obj())) { | ||||
| 44936 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 14"); | ||||
| 44937 | return false; | ||||
| 44938 | } | ||||
| 44939 | if (JS::IsResizableArrayBufferView(arg13.Obj())) { | ||||
| 44940 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 14"); | ||||
| 44941 | return false; | ||||
| 44942 | } | ||||
| 44943 | } else { | ||||
| 44944 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 14"); | ||||
| 44945 | return false; | ||||
| 44946 | } | ||||
| 44947 | RootedSpiderMonkeyInterface<ArrayBuffer> arg14(cx); | ||||
| 44948 | if (args[14].isObject()) { | ||||
| 44949 | if (!arg14.Init(&args[14].toObject())) { | ||||
| 44950 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 15", "ArrayBuffer"); | ||||
| 44951 | return false; | ||||
| 44952 | } | ||||
| 44953 | if (JS::IsSharedArrayBufferObject(arg14.Obj())) { | ||||
| 44954 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 15"); | ||||
| 44955 | return false; | ||||
| 44956 | } | ||||
| 44957 | if (JS::IsLargeArrayBufferMaybeShared(arg14.Obj())) { | ||||
| 44958 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 15"); | ||||
| 44959 | return false; | ||||
| 44960 | } | ||||
| 44961 | if (JS::IsResizableArrayBufferMaybeShared(arg14.Obj())) { | ||||
| 44962 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 15"); | ||||
| 44963 | return false; | ||||
| 44964 | } | ||||
| 44965 | } else { | ||||
| 44966 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 15"); | ||||
| 44967 | return false; | ||||
| 44968 | } | ||||
| 44969 | Maybe<JSAutoRealm> ar; | ||||
| 44970 | if (objIsXray) { | ||||
| 44971 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | ||||
| 44972 | // we know Xrays have no dynamic unwrap behavior. | ||||
| 44973 | obj = js::CheckedUnwrapStatic(obj); | ||||
| 44974 | if (!obj) { | ||||
| 44975 | return false; | ||||
| 44976 | } | ||||
| 44977 | ar.emplace(cx, obj); | ||||
| 44978 | if (!JS_WrapObject(cx, &desiredProto)) { | ||||
| 44979 | return false; | ||||
| 44980 | } | ||||
| 44981 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mAny1))) { | ||||
| 44982 | return false; | ||||
| 44983 | } | ||||
| 44984 | if (arg5.mDict.WasPassed()) { | ||||
| 44985 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mAnotherAny))) { | ||||
| 44986 | return false; | ||||
| 44987 | } | ||||
| 44988 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mAnotherObj))) { | ||||
| 44989 | return false; | ||||
| 44990 | } | ||||
| 44991 | if (arg5.mDict.Value().mArrayBuffer.WasPassed()) { | ||||
| 44992 | if (!arg5.mDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 44993 | return false; | ||||
| 44994 | } | ||||
| 44995 | } | ||||
| 44996 | if (arg5.mDict.Value().mCustomEventInit.WasPassed()) { | ||||
| 44997 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mCustomEventInit.Value().mDetail))) { | ||||
| 44998 | return false; | ||||
| 44999 | } | ||||
| 45000 | } | ||||
| 45001 | if (arg5.mDict.Value().mDictionaryTypedef.WasPassed()) { | ||||
| 45002 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mDictionaryTypedef.Value().mDetail))) { | ||||
| 45003 | return false; | ||||
| 45004 | } | ||||
| 45005 | } | ||||
| 45006 | if (arg5.mDict.Value().mEventInitOrLong2.WasPassed()) { | ||||
| 45007 | if (arg5.mDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45008 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45009 | return false; | ||||
| 45010 | } | ||||
| 45011 | } | ||||
| 45012 | } | ||||
| 45013 | if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45014 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45015 | return false; | ||||
| 45016 | } | ||||
| 45017 | } | ||||
| 45018 | if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45019 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45020 | return false; | ||||
| 45021 | } | ||||
| 45022 | } | ||||
| 45023 | if (!arg5.mDict.Value().mFloat64Array.IsNull()) { | ||||
| 45024 | if (!arg5.mDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45025 | return false; | ||||
| 45026 | } | ||||
| 45027 | } | ||||
| 45028 | if (arg5.mDict.Value().mNullableArrayBuffer.WasPassed()) { | ||||
| 45029 | if (!arg5.mDict.Value().mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45030 | if (!arg5.mDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45031 | return false; | ||||
| 45032 | } | ||||
| 45033 | } | ||||
| 45034 | } | ||||
| 45035 | if (arg5.mDict.Value().mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45036 | if (!arg5.mDict.Value().mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45037 | if (arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45038 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45039 | return false; | ||||
| 45040 | } | ||||
| 45041 | } | ||||
| 45042 | } | ||||
| 45043 | } | ||||
| 45044 | if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45045 | if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45046 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45047 | return false; | ||||
| 45048 | } | ||||
| 45049 | } | ||||
| 45050 | } | ||||
| 45051 | if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45052 | if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45053 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45054 | return false; | ||||
| 45055 | } | ||||
| 45056 | } | ||||
| 45057 | } | ||||
| 45058 | if (arg5.mDict.Value().mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45059 | if (!arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45060 | if (arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45061 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45062 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45063 | return false; | ||||
| 45064 | } | ||||
| 45065 | } | ||||
| 45066 | } | ||||
| 45067 | } | ||||
| 45068 | } | ||||
| 45069 | if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45070 | if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45071 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45072 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45073 | return false; | ||||
| 45074 | } | ||||
| 45075 | } | ||||
| 45076 | } | ||||
| 45077 | } | ||||
| 45078 | if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45079 | if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45080 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45081 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45082 | return false; | ||||
| 45083 | } | ||||
| 45084 | } | ||||
| 45085 | } | ||||
| 45086 | } | ||||
| 45087 | if (arg5.mDict.Value().mObjectOrLong.WasPassed()) { | ||||
| 45088 | if (arg5.mDict.Value().mObjectOrLong.Value().IsObject()) { | ||||
| 45089 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45090 | return false; | ||||
| 45091 | } | ||||
| 45092 | } | ||||
| 45093 | } | ||||
| 45094 | if (arg5.mDict.Value().mObjectSequenceOrLong.WasPassed()) { | ||||
| 45095 | if (arg5.mDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45096 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45097 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45098 | return false; | ||||
| 45099 | } | ||||
| 45100 | } | ||||
| 45101 | } | ||||
| 45102 | } | ||||
| 45103 | if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45104 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45105 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) { | ||||
| 45106 | return false; | ||||
| 45107 | } | ||||
| 45108 | } | ||||
| 45109 | } | ||||
| 45110 | if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45111 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45112 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) { | ||||
| 45113 | return false; | ||||
| 45114 | } | ||||
| 45115 | } | ||||
| 45116 | } | ||||
| 45117 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mRequiredObject))) { | ||||
| 45118 | return false; | ||||
| 45119 | } | ||||
| 45120 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mSomeAny))) { | ||||
| 45121 | return false; | ||||
| 45122 | } | ||||
| 45123 | if (arg5.mDict.Value().mSomeObj.WasPassed()) { | ||||
| 45124 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mSomeObj.Value()))) { | ||||
| 45125 | return false; | ||||
| 45126 | } | ||||
| 45127 | } | ||||
| 45128 | if (arg5.mDict.Value().mUint8Array.WasPassed()) { | ||||
| 45129 | if (!arg5.mDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45130 | return false; | ||||
| 45131 | } | ||||
| 45132 | } | ||||
| 45133 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mParentAny))) { | ||||
| 45134 | return false; | ||||
| 45135 | } | ||||
| 45136 | } | ||||
| 45137 | if (arg5.mDict2.WasPassed()) { | ||||
| 45138 | if (arg5.mDict2.Value().mMemberDict.WasPassed()) { | ||||
| 45139 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherAny))) { | ||||
| 45140 | return false; | ||||
| 45141 | } | ||||
| 45142 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherObj))) { | ||||
| 45143 | return false; | ||||
| 45144 | } | ||||
| 45145 | if (arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.WasPassed()) { | ||||
| 45146 | if (!arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45147 | return false; | ||||
| 45148 | } | ||||
| 45149 | } | ||||
| 45150 | if (arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.WasPassed()) { | ||||
| 45151 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.Value().mDetail))) { | ||||
| 45152 | return false; | ||||
| 45153 | } | ||||
| 45154 | } | ||||
| 45155 | if (arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.WasPassed()) { | ||||
| 45156 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.Value().mDetail))) { | ||||
| 45157 | return false; | ||||
| 45158 | } | ||||
| 45159 | } | ||||
| 45160 | if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.WasPassed()) { | ||||
| 45161 | if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45162 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45163 | return false; | ||||
| 45164 | } | ||||
| 45165 | } | ||||
| 45166 | } | ||||
| 45167 | if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45168 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45169 | return false; | ||||
| 45170 | } | ||||
| 45171 | } | ||||
| 45172 | if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45173 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45174 | return false; | ||||
| 45175 | } | ||||
| 45176 | } | ||||
| 45177 | if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.IsNull()) { | ||||
| 45178 | if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45179 | return false; | ||||
| 45180 | } | ||||
| 45181 | } | ||||
| 45182 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.WasPassed()) { | ||||
| 45183 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45184 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45185 | return false; | ||||
| 45186 | } | ||||
| 45187 | } | ||||
| 45188 | } | ||||
| 45189 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45190 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45191 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45192 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45193 | return false; | ||||
| 45194 | } | ||||
| 45195 | } | ||||
| 45196 | } | ||||
| 45197 | } | ||||
| 45198 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45199 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45200 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45201 | return false; | ||||
| 45202 | } | ||||
| 45203 | } | ||||
| 45204 | } | ||||
| 45205 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45206 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45207 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45208 | return false; | ||||
| 45209 | } | ||||
| 45210 | } | ||||
| 45211 | } | ||||
| 45212 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45213 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45214 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45215 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45216 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45217 | return false; | ||||
| 45218 | } | ||||
| 45219 | } | ||||
| 45220 | } | ||||
| 45221 | } | ||||
| 45222 | } | ||||
| 45223 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45224 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45225 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45226 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45227 | return false; | ||||
| 45228 | } | ||||
| 45229 | } | ||||
| 45230 | } | ||||
| 45231 | } | ||||
| 45232 | if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45233 | if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45234 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45235 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45236 | return false; | ||||
| 45237 | } | ||||
| 45238 | } | ||||
| 45239 | } | ||||
| 45240 | } | ||||
| 45241 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.WasPassed()) { | ||||
| 45242 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().IsObject()) { | ||||
| 45243 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45244 | return false; | ||||
| 45245 | } | ||||
| 45246 | } | ||||
| 45247 | } | ||||
| 45248 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.WasPassed()) { | ||||
| 45249 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45250 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45251 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) { | ||||
| 45252 | return false; | ||||
| 45253 | } | ||||
| 45254 | } | ||||
| 45255 | } | ||||
| 45256 | } | ||||
| 45257 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45258 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45259 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) { | ||||
| 45260 | return false; | ||||
| 45261 | } | ||||
| 45262 | } | ||||
| 45263 | } | ||||
| 45264 | if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45265 | for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) { | ||||
| 45266 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) { | ||||
| 45267 | return false; | ||||
| 45268 | } | ||||
| 45269 | } | ||||
| 45270 | } | ||||
| 45271 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mRequiredObject))) { | ||||
| 45272 | return false; | ||||
| 45273 | } | ||||
| 45274 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeAny))) { | ||||
| 45275 | return false; | ||||
| 45276 | } | ||||
| 45277 | if (arg5.mDict2.Value().mMemberDict.Value().mSomeObj.WasPassed()) { | ||||
| 45278 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeObj.Value()))) { | ||||
| 45279 | return false; | ||||
| 45280 | } | ||||
| 45281 | } | ||||
| 45282 | if (arg5.mDict2.Value().mMemberDict.Value().mUint8Array.WasPassed()) { | ||||
| 45283 | if (!arg5.mDict2.Value().mMemberDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45284 | return false; | ||||
| 45285 | } | ||||
| 45286 | } | ||||
| 45287 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mParentAny))) { | ||||
| 45288 | return false; | ||||
| 45289 | } | ||||
| 45290 | } | ||||
| 45291 | } | ||||
| 45292 | if (arg5.mObj1.WasPassed()) { | ||||
| 45293 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj1.Value()))) { | ||||
| 45294 | return false; | ||||
| 45295 | } | ||||
| 45296 | } | ||||
| 45297 | if (arg5.mObj2.WasPassed()) { | ||||
| 45298 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj2.Value()))) { | ||||
| 45299 | return false; | ||||
| 45300 | } | ||||
| 45301 | } | ||||
| 45302 | if (arg5.mSeq1.WasPassed()) { | ||||
| 45303 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq1.Value().Length(); ++indexName0) { | ||||
| 45304 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherAny))) { | ||||
| 45305 | return false; | ||||
| 45306 | } | ||||
| 45307 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherObj))) { | ||||
| 45308 | return false; | ||||
| 45309 | } | ||||
| 45310 | if (arg5.mSeq1.Value()[indexName0].mArrayBuffer.WasPassed()) { | ||||
| 45311 | if (!arg5.mSeq1.Value()[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45312 | return false; | ||||
| 45313 | } | ||||
| 45314 | } | ||||
| 45315 | if (arg5.mSeq1.Value()[indexName0].mCustomEventInit.WasPassed()) { | ||||
| 45316 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mCustomEventInit.Value().mDetail))) { | ||||
| 45317 | return false; | ||||
| 45318 | } | ||||
| 45319 | } | ||||
| 45320 | if (arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.WasPassed()) { | ||||
| 45321 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.Value().mDetail))) { | ||||
| 45322 | return false; | ||||
| 45323 | } | ||||
| 45324 | } | ||||
| 45325 | if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.WasPassed()) { | ||||
| 45326 | if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45327 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45328 | return false; | ||||
| 45329 | } | ||||
| 45330 | } | ||||
| 45331 | } | ||||
| 45332 | if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45333 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45334 | return false; | ||||
| 45335 | } | ||||
| 45336 | } | ||||
| 45337 | if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45338 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45339 | return false; | ||||
| 45340 | } | ||||
| 45341 | } | ||||
| 45342 | if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.IsNull()) { | ||||
| 45343 | if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45344 | return false; | ||||
| 45345 | } | ||||
| 45346 | } | ||||
| 45347 | if (arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.WasPassed()) { | ||||
| 45348 | if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45349 | if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45350 | return false; | ||||
| 45351 | } | ||||
| 45352 | } | ||||
| 45353 | } | ||||
| 45354 | if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45355 | if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45356 | if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45357 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45358 | return false; | ||||
| 45359 | } | ||||
| 45360 | } | ||||
| 45361 | } | ||||
| 45362 | } | ||||
| 45363 | if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45364 | if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45365 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45366 | return false; | ||||
| 45367 | } | ||||
| 45368 | } | ||||
| 45369 | } | ||||
| 45370 | if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45371 | if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45372 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45373 | return false; | ||||
| 45374 | } | ||||
| 45375 | } | ||||
| 45376 | } | ||||
| 45377 | if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45378 | if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45379 | if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45380 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45381 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45382 | return false; | ||||
| 45383 | } | ||||
| 45384 | } | ||||
| 45385 | } | ||||
| 45386 | } | ||||
| 45387 | } | ||||
| 45388 | if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45389 | if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45390 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45391 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45392 | return false; | ||||
| 45393 | } | ||||
| 45394 | } | ||||
| 45395 | } | ||||
| 45396 | } | ||||
| 45397 | if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45398 | if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45399 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45400 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45401 | return false; | ||||
| 45402 | } | ||||
| 45403 | } | ||||
| 45404 | } | ||||
| 45405 | } | ||||
| 45406 | if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.WasPassed()) { | ||||
| 45407 | if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().IsObject()) { | ||||
| 45408 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45409 | return false; | ||||
| 45410 | } | ||||
| 45411 | } | ||||
| 45412 | } | ||||
| 45413 | if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.WasPassed()) { | ||||
| 45414 | if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45415 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45416 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45417 | return false; | ||||
| 45418 | } | ||||
| 45419 | } | ||||
| 45420 | } | ||||
| 45421 | } | ||||
| 45422 | if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45423 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45424 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) { | ||||
| 45425 | return false; | ||||
| 45426 | } | ||||
| 45427 | } | ||||
| 45428 | } | ||||
| 45429 | if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45430 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45431 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) { | ||||
| 45432 | return false; | ||||
| 45433 | } | ||||
| 45434 | } | ||||
| 45435 | } | ||||
| 45436 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mRequiredObject))) { | ||||
| 45437 | return false; | ||||
| 45438 | } | ||||
| 45439 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeAny))) { | ||||
| 45440 | return false; | ||||
| 45441 | } | ||||
| 45442 | if (arg5.mSeq1.Value()[indexName0].mSomeObj.WasPassed()) { | ||||
| 45443 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeObj.Value()))) { | ||||
| 45444 | return false; | ||||
| 45445 | } | ||||
| 45446 | } | ||||
| 45447 | if (arg5.mSeq1.Value()[indexName0].mUint8Array.WasPassed()) { | ||||
| 45448 | if (!arg5.mSeq1.Value()[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45449 | return false; | ||||
| 45450 | } | ||||
| 45451 | } | ||||
| 45452 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mParentAny))) { | ||||
| 45453 | return false; | ||||
| 45454 | } | ||||
| 45455 | } | ||||
| 45456 | } | ||||
| 45457 | if (arg5.mSeq2.WasPassed()) { | ||||
| 45458 | if (!arg5.mSeq2.Value().IsNull()) { | ||||
| 45459 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq2.Value().Value().Length(); ++indexName0) { | ||||
| 45460 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq2.Value().Value()[indexName0].Length(); ++indexName1) { | ||||
| 45461 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherAny))) { | ||||
| 45462 | return false; | ||||
| 45463 | } | ||||
| 45464 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherObj))) { | ||||
| 45465 | return false; | ||||
| 45466 | } | ||||
| 45467 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.WasPassed()) { | ||||
| 45468 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45469 | return false; | ||||
| 45470 | } | ||||
| 45471 | } | ||||
| 45472 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.WasPassed()) { | ||||
| 45473 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.Value().mDetail))) { | ||||
| 45474 | return false; | ||||
| 45475 | } | ||||
| 45476 | } | ||||
| 45477 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.WasPassed()) { | ||||
| 45478 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.Value().mDetail))) { | ||||
| 45479 | return false; | ||||
| 45480 | } | ||||
| 45481 | } | ||||
| 45482 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.WasPassed()) { | ||||
| 45483 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45484 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45485 | return false; | ||||
| 45486 | } | ||||
| 45487 | } | ||||
| 45488 | } | ||||
| 45489 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45490 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45491 | return false; | ||||
| 45492 | } | ||||
| 45493 | } | ||||
| 45494 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45495 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45496 | return false; | ||||
| 45497 | } | ||||
| 45498 | } | ||||
| 45499 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.IsNull()) { | ||||
| 45500 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45501 | return false; | ||||
| 45502 | } | ||||
| 45503 | } | ||||
| 45504 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.WasPassed()) { | ||||
| 45505 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45506 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45507 | return false; | ||||
| 45508 | } | ||||
| 45509 | } | ||||
| 45510 | } | ||||
| 45511 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45512 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45513 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45514 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45515 | return false; | ||||
| 45516 | } | ||||
| 45517 | } | ||||
| 45518 | } | ||||
| 45519 | } | ||||
| 45520 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45521 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45522 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45523 | return false; | ||||
| 45524 | } | ||||
| 45525 | } | ||||
| 45526 | } | ||||
| 45527 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45528 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45529 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45530 | return false; | ||||
| 45531 | } | ||||
| 45532 | } | ||||
| 45533 | } | ||||
| 45534 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45535 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45536 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45537 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45538 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45539 | return false; | ||||
| 45540 | } | ||||
| 45541 | } | ||||
| 45542 | } | ||||
| 45543 | } | ||||
| 45544 | } | ||||
| 45545 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45546 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45547 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45548 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45549 | return false; | ||||
| 45550 | } | ||||
| 45551 | } | ||||
| 45552 | } | ||||
| 45553 | } | ||||
| 45554 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45555 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45556 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45557 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45558 | return false; | ||||
| 45559 | } | ||||
| 45560 | } | ||||
| 45561 | } | ||||
| 45562 | } | ||||
| 45563 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.WasPassed()) { | ||||
| 45564 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().IsObject()) { | ||||
| 45565 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45566 | return false; | ||||
| 45567 | } | ||||
| 45568 | } | ||||
| 45569 | } | ||||
| 45570 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.WasPassed()) { | ||||
| 45571 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45572 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45573 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45574 | return false; | ||||
| 45575 | } | ||||
| 45576 | } | ||||
| 45577 | } | ||||
| 45578 | } | ||||
| 45579 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45580 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45581 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) { | ||||
| 45582 | return false; | ||||
| 45583 | } | ||||
| 45584 | } | ||||
| 45585 | } | ||||
| 45586 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45587 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45588 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) { | ||||
| 45589 | return false; | ||||
| 45590 | } | ||||
| 45591 | } | ||||
| 45592 | } | ||||
| 45593 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mRequiredObject))) { | ||||
| 45594 | return false; | ||||
| 45595 | } | ||||
| 45596 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeAny))) { | ||||
| 45597 | return false; | ||||
| 45598 | } | ||||
| 45599 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.WasPassed()) { | ||||
| 45600 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.Value()))) { | ||||
| 45601 | return false; | ||||
| 45602 | } | ||||
| 45603 | } | ||||
| 45604 | if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.WasPassed()) { | ||||
| 45605 | if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45606 | return false; | ||||
| 45607 | } | ||||
| 45608 | } | ||||
| 45609 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mParentAny))) { | ||||
| 45610 | return false; | ||||
| 45611 | } | ||||
| 45612 | } | ||||
| 45613 | } | ||||
| 45614 | } | ||||
| 45615 | } | ||||
| 45616 | if (arg5.mSeq3.WasPassed()) { | ||||
| 45617 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq3.Value().Length(); ++indexName0) { | ||||
| 45618 | if (!arg5.mSeq3.Value()[indexName0].IsNull()) { | ||||
| 45619 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq3.Value()[indexName0].Value().Length(); ++indexName1) { | ||||
| 45620 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherAny))) { | ||||
| 45621 | return false; | ||||
| 45622 | } | ||||
| 45623 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherObj))) { | ||||
| 45624 | return false; | ||||
| 45625 | } | ||||
| 45626 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.WasPassed()) { | ||||
| 45627 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45628 | return false; | ||||
| 45629 | } | ||||
| 45630 | } | ||||
| 45631 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.WasPassed()) { | ||||
| 45632 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.Value().mDetail))) { | ||||
| 45633 | return false; | ||||
| 45634 | } | ||||
| 45635 | } | ||||
| 45636 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.WasPassed()) { | ||||
| 45637 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.Value().mDetail))) { | ||||
| 45638 | return false; | ||||
| 45639 | } | ||||
| 45640 | } | ||||
| 45641 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.WasPassed()) { | ||||
| 45642 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45643 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45644 | return false; | ||||
| 45645 | } | ||||
| 45646 | } | ||||
| 45647 | } | ||||
| 45648 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45649 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45650 | return false; | ||||
| 45651 | } | ||||
| 45652 | } | ||||
| 45653 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45654 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45655 | return false; | ||||
| 45656 | } | ||||
| 45657 | } | ||||
| 45658 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.IsNull()) { | ||||
| 45659 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45660 | return false; | ||||
| 45661 | } | ||||
| 45662 | } | ||||
| 45663 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.WasPassed()) { | ||||
| 45664 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45665 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45666 | return false; | ||||
| 45667 | } | ||||
| 45668 | } | ||||
| 45669 | } | ||||
| 45670 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45671 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45672 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45673 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45674 | return false; | ||||
| 45675 | } | ||||
| 45676 | } | ||||
| 45677 | } | ||||
| 45678 | } | ||||
| 45679 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45680 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45681 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45682 | return false; | ||||
| 45683 | } | ||||
| 45684 | } | ||||
| 45685 | } | ||||
| 45686 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45687 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45688 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45689 | return false; | ||||
| 45690 | } | ||||
| 45691 | } | ||||
| 45692 | } | ||||
| 45693 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45694 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45695 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45696 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45697 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45698 | return false; | ||||
| 45699 | } | ||||
| 45700 | } | ||||
| 45701 | } | ||||
| 45702 | } | ||||
| 45703 | } | ||||
| 45704 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45705 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45706 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45707 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45708 | return false; | ||||
| 45709 | } | ||||
| 45710 | } | ||||
| 45711 | } | ||||
| 45712 | } | ||||
| 45713 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45714 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45715 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45716 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45717 | return false; | ||||
| 45718 | } | ||||
| 45719 | } | ||||
| 45720 | } | ||||
| 45721 | } | ||||
| 45722 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.WasPassed()) { | ||||
| 45723 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().IsObject()) { | ||||
| 45724 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45725 | return false; | ||||
| 45726 | } | ||||
| 45727 | } | ||||
| 45728 | } | ||||
| 45729 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.WasPassed()) { | ||||
| 45730 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45731 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45732 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) { | ||||
| 45733 | return false; | ||||
| 45734 | } | ||||
| 45735 | } | ||||
| 45736 | } | ||||
| 45737 | } | ||||
| 45738 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45739 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45740 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) { | ||||
| 45741 | return false; | ||||
| 45742 | } | ||||
| 45743 | } | ||||
| 45744 | } | ||||
| 45745 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45746 | for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) { | ||||
| 45747 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) { | ||||
| 45748 | return false; | ||||
| 45749 | } | ||||
| 45750 | } | ||||
| 45751 | } | ||||
| 45752 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mRequiredObject))) { | ||||
| 45753 | return false; | ||||
| 45754 | } | ||||
| 45755 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeAny))) { | ||||
| 45756 | return false; | ||||
| 45757 | } | ||||
| 45758 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.WasPassed()) { | ||||
| 45759 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.Value()))) { | ||||
| 45760 | return false; | ||||
| 45761 | } | ||||
| 45762 | } | ||||
| 45763 | if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.WasPassed()) { | ||||
| 45764 | if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45765 | return false; | ||||
| 45766 | } | ||||
| 45767 | } | ||||
| 45768 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mParentAny))) { | ||||
| 45769 | return false; | ||||
| 45770 | } | ||||
| 45771 | } | ||||
| 45772 | } | ||||
| 45773 | } | ||||
| 45774 | } | ||||
| 45775 | if (arg5.mSeq4.WasPassed()) { | ||||
| 45776 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq4.Value().Length(); ++indexName0) { | ||||
| 45777 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq4.Value()[indexName0]))) { | ||||
| 45778 | return false; | ||||
| 45779 | } | ||||
| 45780 | } | ||||
| 45781 | } | ||||
| 45782 | if (arg5.mSeq5.WasPassed()) { | ||||
| 45783 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq5.Value().Length(); ++indexName0) { | ||||
| 45784 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq5.Value()[indexName0]))) { | ||||
| 45785 | return false; | ||||
| 45786 | } | ||||
| 45787 | } | ||||
| 45788 | } | ||||
| 45789 | if (arg5.mSeq6.WasPassed()) { | ||||
| 45790 | for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq6.Value().Length(); ++indexName0) { | ||||
| 45791 | if (arg5.mSeq6.Value()[indexName0].mOurSequence3.WasPassed()) { | ||||
| 45792 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence3.Value().Length(); ++indexName1) { | ||||
| 45793 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence3.Value()[indexName1]))) { | ||||
| 45794 | return false; | ||||
| 45795 | } | ||||
| 45796 | } | ||||
| 45797 | } | ||||
| 45798 | if (arg5.mSeq6.Value()[indexName0].mOurSequence4.WasPassed()) { | ||||
| 45799 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence4.Value().Length(); ++indexName1) { | ||||
| 45800 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence4.Value()[indexName1]))) { | ||||
| 45801 | return false; | ||||
| 45802 | } | ||||
| 45803 | } | ||||
| 45804 | } | ||||
| 45805 | if (arg5.mSeq6.Value()[indexName0].mOurSequence5.WasPassed()) { | ||||
| 45806 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence5.Value().Length(); ++indexName1) { | ||||
| 45807 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence5.Value()[indexName1]))) { | ||||
| 45808 | return false; | ||||
| 45809 | } | ||||
| 45810 | } | ||||
| 45811 | } | ||||
| 45812 | if (arg5.mSeq6.Value()[indexName0].mOurSequence6.WasPassed()) { | ||||
| 45813 | if (!arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().IsNull()) { | ||||
| 45814 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value().Length(); ++indexName1) { | ||||
| 45815 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value()[indexName1]))) { | ||||
| 45816 | return false; | ||||
| 45817 | } | ||||
| 45818 | } | ||||
| 45819 | } | ||||
| 45820 | } | ||||
| 45821 | if (arg5.mSeq6.Value()[indexName0].mOurSequence7.WasPassed()) { | ||||
| 45822 | if (!arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().IsNull()) { | ||||
| 45823 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value().Length(); ++indexName1) { | ||||
| 45824 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value()[indexName1]))) { | ||||
| 45825 | return false; | ||||
| 45826 | } | ||||
| 45827 | } | ||||
| 45828 | } | ||||
| 45829 | } | ||||
| 45830 | if (!arg5.mSeq6.Value()[indexName0].mOurSequence8.IsNull()) { | ||||
| 45831 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence8.Value().Length(); ++indexName1) { | ||||
| 45832 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence8.Value()[indexName1]))) { | ||||
| 45833 | return false; | ||||
| 45834 | } | ||||
| 45835 | } | ||||
| 45836 | } | ||||
| 45837 | if (!arg5.mSeq6.Value()[indexName0].mOurSequence9.IsNull()) { | ||||
| 45838 | for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence9.Value().Length(); ++indexName1) { | ||||
| 45839 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence9.Value()[indexName1]))) { | ||||
| 45840 | return false; | ||||
| 45841 | } | ||||
| 45842 | } | ||||
| 45843 | } | ||||
| 45844 | } | ||||
| 45845 | } | ||||
| 45846 | if (!JS_WrapValue(cx, &arg6)) { | ||||
| 45847 | return false; | ||||
| 45848 | } | ||||
| 45849 | if (!JS_WrapObject(cx, &arg7)) { | ||||
| 45850 | return false; | ||||
| 45851 | } | ||||
| 45852 | if (!JS_WrapObject(cx, &arg8)) { | ||||
| 45853 | return false; | ||||
| 45854 | } | ||||
| 45855 | for (uint32_t indexName0 = 0; indexName0 < arg9.Length(); ++indexName0) { | ||||
| 45856 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mAnotherAny))) { | ||||
| 45857 | return false; | ||||
| 45858 | } | ||||
| 45859 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mAnotherObj))) { | ||||
| 45860 | return false; | ||||
| 45861 | } | ||||
| 45862 | if (arg9[indexName0].mArrayBuffer.WasPassed()) { | ||||
| 45863 | if (!arg9[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45864 | return false; | ||||
| 45865 | } | ||||
| 45866 | } | ||||
| 45867 | if (arg9[indexName0].mCustomEventInit.WasPassed()) { | ||||
| 45868 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mCustomEventInit.Value().mDetail))) { | ||||
| 45869 | return false; | ||||
| 45870 | } | ||||
| 45871 | } | ||||
| 45872 | if (arg9[indexName0].mDictionaryTypedef.WasPassed()) { | ||||
| 45873 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mDictionaryTypedef.Value().mDetail))) { | ||||
| 45874 | return false; | ||||
| 45875 | } | ||||
| 45876 | } | ||||
| 45877 | if (arg9[indexName0].mEventInitOrLong2.WasPassed()) { | ||||
| 45878 | if (arg9[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) { | ||||
| 45879 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45880 | return false; | ||||
| 45881 | } | ||||
| 45882 | } | ||||
| 45883 | } | ||||
| 45884 | if (arg9[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | ||||
| 45885 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | ||||
| 45886 | return false; | ||||
| 45887 | } | ||||
| 45888 | } | ||||
| 45889 | if (arg9[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | ||||
| 45890 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | ||||
| 45891 | return false; | ||||
| 45892 | } | ||||
| 45893 | } | ||||
| 45894 | if (!arg9[indexName0].mFloat64Array.IsNull()) { | ||||
| 45895 | if (!arg9[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 45896 | return false; | ||||
| 45897 | } | ||||
| 45898 | } | ||||
| 45899 | if (arg9[indexName0].mNullableArrayBuffer.WasPassed()) { | ||||
| 45900 | if (!arg9[indexName0].mNullableArrayBuffer.Value().IsNull()) { | ||||
| 45901 | if (!arg9[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | ||||
| 45902 | return false; | ||||
| 45903 | } | ||||
| 45904 | } | ||||
| 45905 | } | ||||
| 45906 | if (arg9[indexName0].mNullableEventInitOrLong2.WasPassed()) { | ||||
| 45907 | if (!arg9[indexName0].mNullableEventInitOrLong2.Value().IsNull()) { | ||||
| 45908 | if (arg9[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | ||||
| 45909 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45910 | return false; | ||||
| 45911 | } | ||||
| 45912 | } | ||||
| 45913 | } | ||||
| 45914 | } | ||||
| 45915 | if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | ||||
| 45916 | if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | ||||
| 45917 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45918 | return false; | ||||
| 45919 | } | ||||
| 45920 | } | ||||
| 45921 | } | ||||
| 45922 | if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | ||||
| 45923 | if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | ||||
| 45924 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | ||||
| 45925 | return false; | ||||
| 45926 | } | ||||
| 45927 | } | ||||
| 45928 | } | ||||
| 45929 | if (arg9[indexName0].mNullableObjectSequenceOrLong.WasPassed()) { | ||||
| 45930 | if (!arg9[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) { | ||||
| 45931 | if (arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | ||||
| 45932 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45933 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45934 | return false; | ||||
| 45935 | } | ||||
| 45936 | } | ||||
| 45937 | } | ||||
| 45938 | } | ||||
| 45939 | } | ||||
| 45940 | if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | ||||
| 45941 | if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | ||||
| 45942 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45943 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45944 | return false; | ||||
| 45945 | } | ||||
| 45946 | } | ||||
| 45947 | } | ||||
| 45948 | } | ||||
| 45949 | if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | ||||
| 45950 | if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | ||||
| 45951 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45952 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45953 | return false; | ||||
| 45954 | } | ||||
| 45955 | } | ||||
| 45956 | } | ||||
| 45957 | } | ||||
| 45958 | if (arg9[indexName0].mObjectOrLong.WasPassed()) { | ||||
| 45959 | if (arg9[indexName0].mObjectOrLong.Value().IsObject()) { | ||||
| 45960 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectOrLong.Value().GetAsObject()))) { | ||||
| 45961 | return false; | ||||
| 45962 | } | ||||
| 45963 | } | ||||
| 45964 | } | ||||
| 45965 | if (arg9[indexName0].mObjectSequenceOrLong.WasPassed()) { | ||||
| 45966 | if (arg9[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) { | ||||
| 45967 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45968 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) { | ||||
| 45969 | return false; | ||||
| 45970 | } | ||||
| 45971 | } | ||||
| 45972 | } | ||||
| 45973 | } | ||||
| 45974 | if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | ||||
| 45975 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45976 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) { | ||||
| 45977 | return false; | ||||
| 45978 | } | ||||
| 45979 | } | ||||
| 45980 | } | ||||
| 45981 | if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | ||||
| 45982 | for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) { | ||||
| 45983 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) { | ||||
| 45984 | return false; | ||||
| 45985 | } | ||||
| 45986 | } | ||||
| 45987 | } | ||||
| 45988 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mRequiredObject))) { | ||||
| 45989 | return false; | ||||
| 45990 | } | ||||
| 45991 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mSomeAny))) { | ||||
| 45992 | return false; | ||||
| 45993 | } | ||||
| 45994 | if (arg9[indexName0].mSomeObj.WasPassed()) { | ||||
| 45995 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mSomeObj.Value()))) { | ||||
| 45996 | return false; | ||||
| 45997 | } | ||||
| 45998 | } | ||||
| 45999 | if (arg9[indexName0].mUint8Array.WasPassed()) { | ||||
| 46000 | if (!arg9[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | ||||
| 46001 | return false; | ||||
| 46002 | } | ||||
| 46003 | } | ||||
| 46004 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mParentAny))) { | ||||
| 46005 | return false; | ||||
| 46006 | } | ||||
| 46007 | } | ||||
| 46008 | if (!JS_WrapValue(cx, &arg10)) { | ||||
| 46009 | return false; | ||||
| 46010 | } | ||||
| 46011 | if (arg11.WasPassed()) { | ||||
| 46012 | if (!JS_WrapObject(cx, &arg11.Value())) { | ||||
| 46013 | return false; | ||||
| 46014 | } | ||||
| 46015 | } | ||||
| 46016 | if (arg12.WasPassed()) { | ||||
| 46017 | if (!JS_WrapObject(cx, &arg12.Value())) { | ||||
| 46018 | return false; | ||||
| 46019 | } | ||||
| 46020 | } | ||||
| 46021 | if (!arg13.WrapIntoNewCompartment(cx)) { | ||||
| 46022 | return false; | ||||
| 46023 | } | ||||
| 46024 | if (!arg14.WrapIntoNewCompartment(cx)) { | ||||
| 46025 | return false; | ||||
| 46026 | } | ||||
| 46027 | } | ||||
| 46028 | FastErrorResult rv; | ||||
| 46029 | 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))); | ||||
| 46030 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor" )), 0))) { | ||||
| 46031 | return false; | ||||
| 46032 | } | ||||
| 46033 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 46033); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 46033; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | ||||
| 46034 | static_assert(!std::is_pointer_v<decltype(result)>, | ||||
| 46035 | "NewObject implies that we need to keep the object alive with a strong reference."); | ||||
| 46036 | if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) { | ||||
| 46037 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 46037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 46037; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46038 | return false; | ||||
| 46039 | } | ||||
| 46040 | return true; | ||||
| 46041 | } | ||||
| 46042 | |||||
| 46043 | static const DOMInterfaceInfo sInterfaceObjectInfo = { | ||||
| 46044 | { _constructor, &sNativePropertyHooks }, | ||||
| 46045 | JS::GetRealmFunctionPrototypeHandle, | ||||
| 46046 | PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth, | ||||
| 46047 | prototypes::id::TestJSImplInterface, | ||||
| 46048 | true, | ||||
| 46049 | 15, | ||||
| 46050 | "TestJSImplInterface", | ||||
| 46051 | }; | ||||
| 46052 | |||||
| 46053 | static const DOMIfaceAndProtoJSClass sPrototypeClass = { | ||||
| 46054 | { | ||||
| 46055 | "TestJSImplInterfacePrototype", | ||||
| 46056 | JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0), | ||||
| 46057 | JS_NULL_CLASS_OPS, | ||||
| 46058 | JS_NULL_CLASS_SPEC, | ||||
| 46059 | JS_NULL_CLASS_EXT, | ||||
| 46060 | JS_NULL_OBJECT_OPS | ||||
| 46061 | }, | ||||
| 46062 | eInterfacePrototype, | ||||
| 46063 | prototypes::id::TestJSImplInterface, | ||||
| 46064 | PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth, | ||||
| 46065 | &sNativePropertyHooks, | ||||
| 46066 | JS::GetRealmObjectPrototype | ||||
| 46067 | }; | ||||
| 46068 | |||||
| 46069 | static const JSClassOps sClassOps = { | ||||
| 46070 | _addProperty, /* addProperty */ | ||||
| 46071 | nullptr, /* delProperty */ | ||||
| 46072 | nullptr, /* enumerate */ | ||||
| 46073 | nullptr, /* newEnumerate */ | ||||
| 46074 | nullptr, /* resolve */ | ||||
| 46075 | nullptr, /* mayResolve */ | ||||
| 46076 | _finalize, /* finalize */ | ||||
| 46077 | nullptr, /* call */ | ||||
| 46078 | nullptr, /* construct */ | ||||
| 46079 | nullptr, /* trace */ | ||||
| 46080 | }; | ||||
| 46081 | |||||
| 46082 | static const js::ClassExtension sClassExtension = { | ||||
| 46083 | _objectMoved /* objectMovedOp */ | ||||
| 46084 | }; | ||||
| 46085 | |||||
| 46086 | static const DOMJSClass sClass = { | ||||
| 46087 | { "TestJSImplInterface", | ||||
| 46088 | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), | ||||
| 46089 | &sClassOps, | ||||
| 46090 | JS_NULL_CLASS_SPEC, | ||||
| 46091 | &sClassExtension, | ||||
| 46092 | JS_NULL_OBJECT_OPS | ||||
| 46093 | }, | ||||
| 46094 | { 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 }, | ||||
| 46095 | std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplInterface>, | ||||
| 46096 | &sNativePropertyHooks, | ||||
| 46097 | FindAssociatedGlobalForNative<mozilla::dom::TestJSImplInterface>::Get, | ||||
| 46098 | GetProtoObjectHandle, | ||||
| 46099 | GetCCParticipant<mozilla::dom::TestJSImplInterface>::Get(), | ||||
| 46100 | nullptr, | ||||
| 46101 | _getWrapperCache | ||||
| 46102 | }; | ||||
| 46103 | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1, | ||||
| 46104 | "Must have the right minimal number of reserved slots."); | ||||
| 46105 | static_assert(1 >= 1, | ||||
| 46106 | "Must have enough reserved slots."); | ||||
| 46107 | |||||
| 46108 | bool | ||||
| 46109 | Wrap(JSContext* aCx, mozilla::dom::TestJSImplInterface* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) | ||||
| 46110 | { | ||||
| 46111 | static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplInterface>, | ||||
| 46112 | "Shouldn't have wrappercached things that are not refcounted."); | ||||
| 46113 | static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplInterface*>); | ||||
| 46114 | 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" , 46114); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)" ")"); do { *((volatile int*)__null) = 46114; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46115 | 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" , 46115); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)" ")"); do { *((volatile int*)__null) = 46115; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); } } while (false); | ||||
| 46116 | 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" , 46118); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46118; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46117 | "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" , 46118); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46118; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46118 | "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" , 46118); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46118; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46119 | |||||
| 46120 | 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" , 46121); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" ") (" "nsISupports must be on our primary inheritance chain" ")"); do { *((volatile int*)__null) = 46121; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46121 | "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" , 46121); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" ") (" "nsISupports must be on our primary inheritance chain" ")"); do { *((volatile int*)__null) = 46121; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46122 | |||||
| 46123 | // If the wrapper cache contains a dead reflector then finalize that | ||||
| 46124 | // now, ensuring that the finalizer for the old reflector always | ||||
| 46125 | // runs before the new reflector is created and attached. This | ||||
| 46126 | // avoids the awkward situation where there are multiple reflector | ||||
| 46127 | // objects that contain pointers to the same native. | ||||
| 46128 | |||||
| 46129 | if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) { | ||||
| 46130 | _finalize(nullptr /* unused */, oldReflector); | ||||
| 46131 | 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" , 46131); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()" ")"); do { *((volatile int*)__null) = 46131; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46132 | } | ||||
| 46133 | |||||
| 46134 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); | ||||
| 46135 | if (!global) { | ||||
| 46136 | return false; | ||||
| 46137 | } | ||||
| 46138 | 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", 46138); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { *((volatile int*)__null) = 46138; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46139 | JS::AssertObjectIsNotGray(global); | ||||
| 46140 | |||||
| 46141 | // That might have ended up wrapping us already, due to the wonders | ||||
| 46142 | // of XBL. Check for that, and bail out as needed. | ||||
| 46143 | aReflector.set(aCache->GetWrapper()); | ||||
| 46144 | if (aReflector) { | ||||
| 46145 | #ifdef DEBUG1 | ||||
| 46146 | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); | ||||
| 46147 | #endif // DEBUG | ||||
| 46148 | return true; | ||||
| 46149 | } | ||||
| 46150 | |||||
| 46151 | JSAutoRealm ar(aCx, global); | ||||
| 46152 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); | ||||
| 46153 | if (!canonicalProto) { | ||||
| 46154 | return false; | ||||
| 46155 | } | ||||
| 46156 | JS::Rooted<JSObject*> proto(aCx); | ||||
| 46157 | if (aGivenProto) { | ||||
| 46158 | proto = aGivenProto; | ||||
| 46159 | // Unfortunately, while aGivenProto was in the compartment of aCx | ||||
| 46160 | // coming in, we changed compartments to that of "parent" so may need | ||||
| 46161 | // to wrap the proto here. | ||||
| 46162 | if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) { | ||||
| 46163 | if (!JS_WrapObject(aCx, &proto)) { | ||||
| 46164 | return false; | ||||
| 46165 | } | ||||
| 46166 | } | ||||
| 46167 | } else { | ||||
| 46168 | proto = canonicalProto; | ||||
| 46169 | } | ||||
| 46170 | |||||
| 46171 | BindingJSObjectCreator<mozilla::dom::TestJSImplInterface> creator(aCx); | ||||
| 46172 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); | ||||
| 46173 | if (!aReflector) { | ||||
| 46174 | return false; | ||||
| 46175 | } | ||||
| 46176 | |||||
| 46177 | aCache->SetWrapper(aReflector); | ||||
| 46178 | creator.InitializationSucceeded(); | ||||
| 46179 | |||||
| 46180 | 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", 46181); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector" ")"); do { *((volatile int*)__null) = 46181; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46181 | 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", 46181); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector" ")"); do { *((volatile int*)__null) = 46181; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46182 | // If proto != canonicalProto, we have to preserve our wrapper; | ||||
| 46183 | // otherwise we won't be able to properly recreate it later, since | ||||
| 46184 | // we won't know what proto to use. Note that we don't check | ||||
| 46185 | // aGivenProto here, since it's entirely possible (and even | ||||
| 46186 | // somewhat common) to have a non-null aGivenProto which is the | ||||
| 46187 | // same as canonicalProto. | ||||
| 46188 | if (proto != canonicalProto) { | ||||
| 46189 | PreserveWrapper(aObject); | ||||
| 46190 | } | ||||
| 46191 | |||||
| 46192 | return true; | ||||
| 46193 | } | ||||
| 46194 | |||||
| 46195 | void | ||||
| 46196 | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal) | ||||
| 46197 | { | ||||
| 46198 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplInterface); | ||||
| 46199 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestJSImplInterface); | ||||
| 46200 | |||||
| 46201 | JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx)); | ||||
| 46202 | if (!parentProto) { | ||||
| 46203 | return; | ||||
| 46204 | } | ||||
| 46205 | |||||
| 46206 | JS::Handle<JSObject*> constructorProto(JS::GetRealmFunctionPrototypeHandle(aCx)); | ||||
| 46207 | if (!constructorProto) { | ||||
| 46208 | return; | ||||
| 46209 | } | ||||
| 46210 | |||||
| 46211 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, | ||||
| 46212 | &sPrototypeClass, protoCache, | ||||
| 46213 | constructorProto, &sInterfaceObjectInfo, 15, false, Span<const LegacyFactoryFunction, 0>{}, | ||||
| 46214 | interfaceCache, | ||||
| 46215 | sNativeProperties.Upcast(), | ||||
| 46216 | sChromeOnlyNativeProperties.Upcast(), | ||||
| 46217 | "TestJSImplInterface", | ||||
| 46218 | aDefineOnGlobal != DefineInterfaceProperty::No, | ||||
| 46219 | nullptr, | ||||
| 46220 | false, | ||||
| 46221 | nullptr); | ||||
| 46222 | } | ||||
| 46223 | |||||
| 46224 | JS::Handle<JSObject*> | ||||
| 46225 | GetProtoObjectHandle(JSContext* aCx) | ||||
| 46226 | { | ||||
| 46227 | /* Get the interface prototype object for this class. This will create the | ||||
| 46228 | object as needed. */ | ||||
| 46229 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplInterface, | ||||
| 46230 | &CreateInterfaceObjects, | ||||
| 46231 | DefineInterfaceProperty::CheckExposure); | ||||
| 46232 | |||||
| 46233 | } | ||||
| 46234 | |||||
| 46235 | JSObject* | ||||
| 46236 | GetProtoObject(JSContext* aCx) | ||||
| 46237 | { | ||||
| 46238 | return GetProtoObjectHandle(aCx); | ||||
| 46239 | } | ||||
| 46240 | |||||
| 46241 | JS::Handle<JSObject*> | ||||
| 46242 | GetConstructorObjectHandle(JSContext* aCx) | ||||
| 46243 | { | ||||
| 46244 | /* Get the interface object for this class. This will create the object as | ||||
| 46245 | needed. */ | ||||
| 46246 | |||||
| 46247 | return GetPerInterfaceObjectHandle(aCx, constructors::id::TestJSImplInterface, | ||||
| 46248 | &CreateInterfaceObjects, | ||||
| 46249 | DefineInterfaceProperty::CheckExposure); | ||||
| 46250 | } | ||||
| 46251 | |||||
| 46252 | } // namespace TestJSImplInterface_Binding | ||||
| 46253 | |||||
| 46254 | |||||
| 46255 | |||||
| 46256 | namespace TestJSImplNoInterfaceObject_Binding { | ||||
| 46257 | |||||
| 46258 | static bool | ||||
| 46259 | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) | ||||
| 46260 | { | ||||
| 46261 | mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj); | ||||
| 46262 | // We don't want to preserve if we don't have a wrapper, and we | ||||
| 46263 | // obviously can't preserve if we're not initialized. | ||||
| 46264 | if (self && self->GetWrapperPreserveColor()) { | ||||
| 46265 | PreserveWrapper(self); | ||||
| 46266 | } | ||||
| 46267 | return true; | ||||
| 46268 | } | ||||
| 46269 | |||||
| 46270 | static void | ||||
| 46271 | _finalize(JS::GCContext* gcx, JSObject* obj) | ||||
| 46272 | { | ||||
| 46273 | mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj); | ||||
| 46274 | if (self) { | ||||
| 46275 | JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue()); | ||||
| 46276 | ClearWrapper(self, self, obj); | ||||
| 46277 | if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) { | ||||
| 46278 | JS::RemoveAssociatedMemory(obj, mallocBytes, | ||||
| 46279 | JS::MemoryUse::DOMBinding); | ||||
| 46280 | } | ||||
| 46281 | AddForDeferredFinalization<mozilla::dom::TestJSImplNoInterfaceObject>(self); | ||||
| 46282 | } | ||||
| 46283 | } | ||||
| 46284 | |||||
| 46285 | static nsWrapperCache* | ||||
| 46286 | _getWrapperCache(JS::Handle<JSObject*> obj) | ||||
| 46287 | { | ||||
| 46288 | mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj); | ||||
| 46289 | return self; | ||||
| 46290 | } | ||||
| 46291 | |||||
| 46292 | static size_t | ||||
| 46293 | _objectMoved(JSObject* obj, JSObject* old) | ||||
| 46294 | { | ||||
| 46295 | mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj); | ||||
| 46296 | if (self) { | ||||
| 46297 | UpdateWrapper(self, self, obj, old); | ||||
| 46298 | } | ||||
| 46299 | |||||
| 46300 | return 0; | ||||
| 46301 | } | ||||
| 46302 | |||||
| 46303 | bool sNativePropertiesInited = false; | ||||
| 46304 | const NativePropertyHooks sNativePropertyHooks = { | ||||
| 46305 | nullptr, | ||||
| 46306 | { nullptr, nullptr, &sNativePropertiesInited }, | ||||
| 46307 | prototypes::id::TestJSImplNoInterfaceObject, | ||||
| 46308 | constructors::id::_ID_Count, | ||||
| 46309 | &DefaultXrayExpandoObjectClass | ||||
| 46310 | }; | ||||
| 46311 | |||||
| 46312 | static const DOMIfaceAndProtoJSClass sPrototypeClass = { | ||||
| 46313 | { | ||||
| 46314 | "TestJSImplNoInterfaceObjectPrototype", | ||||
| 46315 | JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0), | ||||
| 46316 | JS_NULL_CLASS_OPS, | ||||
| 46317 | JS_NULL_CLASS_SPEC, | ||||
| 46318 | JS_NULL_CLASS_EXT, | ||||
| 46319 | JS_NULL_OBJECT_OPS | ||||
| 46320 | }, | ||||
| 46321 | eInterfacePrototype, | ||||
| 46322 | prototypes::id::TestJSImplNoInterfaceObject, | ||||
| 46323 | PrototypeTraits<prototypes::id::TestJSImplNoInterfaceObject>::Depth, | ||||
| 46324 | &sNativePropertyHooks, | ||||
| 46325 | JS::GetRealmObjectPrototype | ||||
| 46326 | }; | ||||
| 46327 | |||||
| 46328 | static JS::Handle<JSObject*> | ||||
| 46329 | GetProtoObjectHandle(JSContext* aCx); | ||||
| 46330 | |||||
| 46331 | static const JSClassOps sClassOps = { | ||||
| 46332 | _addProperty, /* addProperty */ | ||||
| 46333 | nullptr, /* delProperty */ | ||||
| 46334 | nullptr, /* enumerate */ | ||||
| 46335 | nullptr, /* newEnumerate */ | ||||
| 46336 | nullptr, /* resolve */ | ||||
| 46337 | nullptr, /* mayResolve */ | ||||
| 46338 | _finalize, /* finalize */ | ||||
| 46339 | nullptr, /* call */ | ||||
| 46340 | nullptr, /* construct */ | ||||
| 46341 | nullptr, /* trace */ | ||||
| 46342 | }; | ||||
| 46343 | |||||
| 46344 | static const js::ClassExtension sClassExtension = { | ||||
| 46345 | _objectMoved /* objectMovedOp */ | ||||
| 46346 | }; | ||||
| 46347 | |||||
| 46348 | static const DOMJSClass sClass = { | ||||
| 46349 | { "TestJSImplNoInterfaceObject", | ||||
| 46350 | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), | ||||
| 46351 | &sClassOps, | ||||
| 46352 | JS_NULL_CLASS_SPEC, | ||||
| 46353 | &sClassExtension, | ||||
| 46354 | JS_NULL_OBJECT_OPS | ||||
| 46355 | }, | ||||
| 46356 | { 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 }, | ||||
| 46357 | std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplNoInterfaceObject>, | ||||
| 46358 | &sNativePropertyHooks, | ||||
| 46359 | FindAssociatedGlobalForNative<mozilla::dom::TestJSImplNoInterfaceObject>::Get, | ||||
| 46360 | GetProtoObjectHandle, | ||||
| 46361 | GetCCParticipant<mozilla::dom::TestJSImplNoInterfaceObject>::Get(), | ||||
| 46362 | nullptr, | ||||
| 46363 | _getWrapperCache | ||||
| 46364 | }; | ||||
| 46365 | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1, | ||||
| 46366 | "Must have the right minimal number of reserved slots."); | ||||
| 46367 | static_assert(1 >= 1, | ||||
| 46368 | "Must have enough reserved slots."); | ||||
| 46369 | |||||
| 46370 | bool | ||||
| 46371 | Wrap(JSContext* aCx, mozilla::dom::TestJSImplNoInterfaceObject* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) | ||||
| 46372 | { | ||||
| 46373 | static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplNoInterfaceObject>, | ||||
| 46374 | "Shouldn't have wrappercached things that are not refcounted."); | ||||
| 46375 | static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplNoInterfaceObject*>); | ||||
| 46376 | 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" , 46376); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)" ")"); do { *((volatile int*)__null) = 46376; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46377 | 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" , 46377); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)" ")"); do { *((volatile int*)__null) = 46377; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); } } while (false); | ||||
| 46378 | 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" , 46380); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46380; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46379 | "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" , 46380); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46380; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46380 | "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" , 46380); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()" ") (" "You should probably not be using Wrap() directly; use " "GetOrCreateDOMReflector instead" ")"); do { *((volatile int *)__null) = 46380; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46381 | |||||
| 46382 | 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" , 46383); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" ") (" "nsISupports must be on our primary inheritance chain" ")"); do { *((volatile int*)__null) = 46383; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46383 | "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" , 46383); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" ") (" "nsISupports must be on our primary inheritance chain" ")"); do { *((volatile int*)__null) = 46383; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46384 | |||||
| 46385 | // If the wrapper cache contains a dead reflector then finalize that | ||||
| 46386 | // now, ensuring that the finalizer for the old reflector always | ||||
| 46387 | // runs before the new reflector is created and attached. This | ||||
| 46388 | // avoids the awkward situation where there are multiple reflector | ||||
| 46389 | // objects that contain pointers to the same native. | ||||
| 46390 | |||||
| 46391 | if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) { | ||||
| 46392 | _finalize(nullptr /* unused */, oldReflector); | ||||
| 46393 | 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" , 46393); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()" ")"); do { *((volatile int*)__null) = 46393; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46394 | } | ||||
| 46395 | |||||
| 46396 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); | ||||
| 46397 | if (!global) { | ||||
| 46398 | return false; | ||||
| 46399 | } | ||||
| 46400 | 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", 46400); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { *((volatile int*)__null) = 46400; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46401 | JS::AssertObjectIsNotGray(global); | ||||
| 46402 | |||||
| 46403 | // That might have ended up wrapping us already, due to the wonders | ||||
| 46404 | // of XBL. Check for that, and bail out as needed. | ||||
| 46405 | aReflector.set(aCache->GetWrapper()); | ||||
| 46406 | if (aReflector) { | ||||
| 46407 | #ifdef DEBUG1 | ||||
| 46408 | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); | ||||
| 46409 | #endif // DEBUG | ||||
| 46410 | return true; | ||||
| 46411 | } | ||||
| 46412 | |||||
| 46413 | JSAutoRealm ar(aCx, global); | ||||
| 46414 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); | ||||
| 46415 | if (!canonicalProto) { | ||||
| 46416 | return false; | ||||
| 46417 | } | ||||
| 46418 | JS::Rooted<JSObject*> proto(aCx); | ||||
| 46419 | if (aGivenProto) { | ||||
| 46420 | proto = aGivenProto; | ||||
| 46421 | // Unfortunately, while aGivenProto was in the compartment of aCx | ||||
| 46422 | // coming in, we changed compartments to that of "parent" so may need | ||||
| 46423 | // to wrap the proto here. | ||||
| 46424 | if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) { | ||||
| 46425 | if (!JS_WrapObject(aCx, &proto)) { | ||||
| 46426 | return false; | ||||
| 46427 | } | ||||
| 46428 | } | ||||
| 46429 | } else { | ||||
| 46430 | proto = canonicalProto; | ||||
| 46431 | } | ||||
| 46432 | |||||
| 46433 | BindingJSObjectCreator<mozilla::dom::TestJSImplNoInterfaceObject> creator(aCx); | ||||
| 46434 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); | ||||
| 46435 | if (!aReflector) { | ||||
| 46436 | return false; | ||||
| 46437 | } | ||||
| 46438 | |||||
| 46439 | aCache->SetWrapper(aReflector); | ||||
| 46440 | creator.InitializationSucceeded(); | ||||
| 46441 | |||||
| 46442 | 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", 46443); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector" ")"); do { *((volatile int*)__null) = 46443; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 46443 | 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", 46443); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector" ")"); do { *((volatile int*)__null) = 46443; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46444 | // If proto != canonicalProto, we have to preserve our wrapper; | ||||
| 46445 | // otherwise we won't be able to properly recreate it later, since | ||||
| 46446 | // we won't know what proto to use. Note that we don't check | ||||
| 46447 | // aGivenProto here, since it's entirely possible (and even | ||||
| 46448 | // somewhat common) to have a non-null aGivenProto which is the | ||||
| 46449 | // same as canonicalProto. | ||||
| 46450 | if (proto != canonicalProto) { | ||||
| 46451 | PreserveWrapper(aObject); | ||||
| 46452 | } | ||||
| 46453 | |||||
| 46454 | return true; | ||||
| 46455 | } | ||||
| 46456 | |||||
| 46457 | void | ||||
| 46458 | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal) | ||||
| 46459 | { | ||||
| 46460 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplNoInterfaceObject); | ||||
| 46461 | JS::Heap<JSObject*>* interfaceCache = nullptr; | ||||
| 46462 | |||||
| 46463 | JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx)); | ||||
| 46464 | if (!parentProto) { | ||||
| 46465 | return; | ||||
| 46466 | } | ||||
| 46467 | |||||
| 46468 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, | ||||
| 46469 | &sPrototypeClass, protoCache, | ||||
| 46470 | nullptr, nullptr, 0, false, Span<const LegacyFactoryFunction, 0>{}, | ||||
| 46471 | interfaceCache, | ||||
| 46472 | nullptr, | ||||
| 46473 | nullptr, | ||||
| 46474 | "TestJSImplNoInterfaceObject", | ||||
| 46475 | aDefineOnGlobal != DefineInterfaceProperty::No, | ||||
| 46476 | nullptr, | ||||
| 46477 | false, | ||||
| 46478 | nullptr); | ||||
| 46479 | } | ||||
| 46480 | |||||
| 46481 | static JS::Handle<JSObject*> | ||||
| 46482 | GetProtoObjectHandle(JSContext* aCx) | ||||
| 46483 | { | ||||
| 46484 | /* Get the interface prototype object for this class. This will create the | ||||
| 46485 | object as needed. */ | ||||
| 46486 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplNoInterfaceObject, | ||||
| 46487 | &CreateInterfaceObjects, | ||||
| 46488 | DefineInterfaceProperty::CheckExposure); | ||||
| 46489 | |||||
| 46490 | } | ||||
| 46491 | |||||
| 46492 | } // namespace TestJSImplNoInterfaceObject_Binding | ||||
| 46493 | |||||
| 46494 | |||||
| 46495 | |||||
| 46496 | void | ||||
| 46497 | TestJSImplInterfaceJSImpl::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46498 | { | ||||
| 46499 | CallSetup s(this, aRv, "TestJSImplInterface.passByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46500 | if (aRv.Failed()) { | ||||
| 46501 | return; | ||||
| 46502 | } | ||||
| 46503 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46503); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46503; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46504 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46505 | |||||
| 46506 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46507 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46508 | if (!argv.resize(1)) { | ||||
| 46509 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46510 | // the right thing with that. | ||||
| 46511 | return; | ||||
| 46512 | } | ||||
| 46513 | unsigned argc = 1; | ||||
| 46514 | |||||
| 46515 | do { | ||||
| 46516 | argv[0].setInt32(int32_t(arg)); | ||||
| 46517 | break; | ||||
| 46518 | } while (false); | ||||
| 46519 | |||||
| 46520 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46521 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46522 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46523 | !InitIds(cx, atomsCache)) || | ||||
| 46524 | !GetCallableProperty(cx, atomsCache->passByte_id, &callable)) { | ||||
| 46525 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46526 | return; | ||||
| 46527 | } | ||||
| 46528 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46529 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46530 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46531 | aRv.NoteJSContextException(cx); | ||||
| 46532 | return; | ||||
| 46533 | } | ||||
| 46534 | } | ||||
| 46535 | |||||
| 46536 | int8_t | ||||
| 46537 | TestJSImplInterfaceJSImpl::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46538 | { | ||||
| 46539 | CallSetup s(this, aRv, "TestJSImplInterface.receiveByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46540 | if (aRv.Failed()) { | ||||
| 46541 | return int8_t(0); | ||||
| 46542 | } | ||||
| 46543 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46543); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46543; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46544 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46545 | |||||
| 46546 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46547 | |||||
| 46548 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46549 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46550 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46551 | !InitIds(cx, atomsCache)) || | ||||
| 46552 | !GetCallableProperty(cx, atomsCache->receiveByte_id, &callable)) { | ||||
| 46553 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46554 | return int8_t(0); | ||||
| 46555 | } | ||||
| 46556 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46557 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46558 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 46559 | aRv.NoteJSContextException(cx); | ||||
| 46560 | return int8_t(0); | ||||
| 46561 | } | ||||
| 46562 | int8_t rvalDecl; | ||||
| 46563 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveByte", &rvalDecl)) { | ||||
| 46564 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46565 | return int8_t(0); | ||||
| 46566 | } | ||||
| 46567 | return rvalDecl; | ||||
| 46568 | } | ||||
| 46569 | |||||
| 46570 | void | ||||
| 46571 | TestJSImplInterfaceJSImpl::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46572 | { | ||||
| 46573 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46574 | if (aRv.Failed()) { | ||||
| 46575 | return; | ||||
| 46576 | } | ||||
| 46577 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46577); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46577; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46578 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46579 | |||||
| 46580 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46581 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46582 | if (!argv.resize(1)) { | ||||
| 46583 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46584 | // the right thing with that. | ||||
| 46585 | return; | ||||
| 46586 | } | ||||
| 46587 | unsigned argc = 1; | ||||
| 46588 | |||||
| 46589 | do { | ||||
| 46590 | if (arg.WasPassed()) { | ||||
| 46591 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 46592 | break; | ||||
| 46593 | } else if (argc == 1) { | ||||
| 46594 | // This is our current trailing argument; reduce argc | ||||
| 46595 | --argc; | ||||
| 46596 | } else { | ||||
| 46597 | argv[0].setUndefined(); | ||||
| 46598 | } | ||||
| 46599 | } while (false); | ||||
| 46600 | |||||
| 46601 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46602 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46603 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46604 | !InitIds(cx, atomsCache)) || | ||||
| 46605 | !GetCallableProperty(cx, atomsCache->passOptionalByte_id, &callable)) { | ||||
| 46606 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46607 | return; | ||||
| 46608 | } | ||||
| 46609 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46610 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46611 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46612 | aRv.NoteJSContextException(cx); | ||||
| 46613 | return; | ||||
| 46614 | } | ||||
| 46615 | } | ||||
| 46616 | |||||
| 46617 | void | ||||
| 46618 | TestJSImplInterfaceJSImpl::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46619 | { | ||||
| 46620 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46621 | if (aRv.Failed()) { | ||||
| 46622 | return; | ||||
| 46623 | } | ||||
| 46624 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46624); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46624; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46625 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46626 | |||||
| 46627 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46628 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46629 | if (!argv.resize(2)) { | ||||
| 46630 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46631 | // the right thing with that. | ||||
| 46632 | return; | ||||
| 46633 | } | ||||
| 46634 | unsigned argc = 2; | ||||
| 46635 | |||||
| 46636 | do { | ||||
| 46637 | argv[1].setInt32(int32_t(arg2)); | ||||
| 46638 | break; | ||||
| 46639 | } while (false); | ||||
| 46640 | |||||
| 46641 | do { | ||||
| 46642 | if (arg1.WasPassed()) { | ||||
| 46643 | argv[0].setInt32(int32_t(arg1.Value())); | ||||
| 46644 | break; | ||||
| 46645 | } else if (argc == 1) { | ||||
| 46646 | // This is our current trailing argument; reduce argc | ||||
| 46647 | --argc; | ||||
| 46648 | } else { | ||||
| 46649 | argv[0].setUndefined(); | ||||
| 46650 | } | ||||
| 46651 | } while (false); | ||||
| 46652 | |||||
| 46653 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46654 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46655 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46656 | !InitIds(cx, atomsCache)) || | ||||
| 46657 | !GetCallableProperty(cx, atomsCache->passOptionalByteBeforeRequired_id, &callable)) { | ||||
| 46658 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46659 | return; | ||||
| 46660 | } | ||||
| 46661 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46662 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46663 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46664 | aRv.NoteJSContextException(cx); | ||||
| 46665 | return; | ||||
| 46666 | } | ||||
| 46667 | } | ||||
| 46668 | |||||
| 46669 | void | ||||
| 46670 | TestJSImplInterfaceJSImpl::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46671 | { | ||||
| 46672 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46673 | if (aRv.Failed()) { | ||||
| 46674 | return; | ||||
| 46675 | } | ||||
| 46676 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46676); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46676; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46677 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46678 | |||||
| 46679 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46680 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46681 | if (!argv.resize(1)) { | ||||
| 46682 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46683 | // the right thing with that. | ||||
| 46684 | return; | ||||
| 46685 | } | ||||
| 46686 | unsigned argc = 1; | ||||
| 46687 | |||||
| 46688 | do { | ||||
| 46689 | argv[0].setInt32(int32_t(arg)); | ||||
| 46690 | break; | ||||
| 46691 | } while (false); | ||||
| 46692 | |||||
| 46693 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46694 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46695 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46696 | !InitIds(cx, atomsCache)) || | ||||
| 46697 | !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefault_id, &callable)) { | ||||
| 46698 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46699 | return; | ||||
| 46700 | } | ||||
| 46701 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46702 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46703 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46704 | aRv.NoteJSContextException(cx); | ||||
| 46705 | return; | ||||
| 46706 | } | ||||
| 46707 | } | ||||
| 46708 | |||||
| 46709 | void | ||||
| 46710 | TestJSImplInterfaceJSImpl::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46711 | { | ||||
| 46712 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46713 | if (aRv.Failed()) { | ||||
| 46714 | return; | ||||
| 46715 | } | ||||
| 46716 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46716); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46716; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46717 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46718 | |||||
| 46719 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46720 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46721 | if (!argv.resize(2)) { | ||||
| 46722 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46723 | // the right thing with that. | ||||
| 46724 | return; | ||||
| 46725 | } | ||||
| 46726 | unsigned argc = 2; | ||||
| 46727 | |||||
| 46728 | do { | ||||
| 46729 | argv[1].setInt32(int32_t(arg2)); | ||||
| 46730 | break; | ||||
| 46731 | } while (false); | ||||
| 46732 | |||||
| 46733 | do { | ||||
| 46734 | argv[0].setInt32(int32_t(arg1)); | ||||
| 46735 | break; | ||||
| 46736 | } while (false); | ||||
| 46737 | |||||
| 46738 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46739 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46740 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46741 | !InitIds(cx, atomsCache)) || | ||||
| 46742 | !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefaultBeforeRequired_id, &callable)) { | ||||
| 46743 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46744 | return; | ||||
| 46745 | } | ||||
| 46746 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46747 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46748 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46749 | aRv.NoteJSContextException(cx); | ||||
| 46750 | return; | ||||
| 46751 | } | ||||
| 46752 | } | ||||
| 46753 | |||||
| 46754 | void | ||||
| 46755 | TestJSImplInterfaceJSImpl::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46756 | { | ||||
| 46757 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46758 | if (aRv.Failed()) { | ||||
| 46759 | return; | ||||
| 46760 | } | ||||
| 46761 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46761); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46761; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46762 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46763 | |||||
| 46764 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46765 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46766 | if (!argv.resize(1)) { | ||||
| 46767 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46768 | // the right thing with that. | ||||
| 46769 | return; | ||||
| 46770 | } | ||||
| 46771 | unsigned argc = 1; | ||||
| 46772 | |||||
| 46773 | do { | ||||
| 46774 | if (arg.IsNull()) { | ||||
| 46775 | argv[0].setNull(); | ||||
| 46776 | break; | ||||
| 46777 | } | ||||
| 46778 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 46779 | break; | ||||
| 46780 | } while (false); | ||||
| 46781 | |||||
| 46782 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46783 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46784 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46785 | !InitIds(cx, atomsCache)) || | ||||
| 46786 | !GetCallableProperty(cx, atomsCache->passNullableByte_id, &callable)) { | ||||
| 46787 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46788 | return; | ||||
| 46789 | } | ||||
| 46790 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46791 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46792 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46793 | aRv.NoteJSContextException(cx); | ||||
| 46794 | return; | ||||
| 46795 | } | ||||
| 46796 | } | ||||
| 46797 | |||||
| 46798 | void | ||||
| 46799 | TestJSImplInterfaceJSImpl::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46800 | { | ||||
| 46801 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46802 | if (aRv.Failed()) { | ||||
| 46803 | return; | ||||
| 46804 | } | ||||
| 46805 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46805); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46805; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46806 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46807 | |||||
| 46808 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46809 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46810 | if (!argv.resize(1)) { | ||||
| 46811 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46812 | // the right thing with that. | ||||
| 46813 | return; | ||||
| 46814 | } | ||||
| 46815 | unsigned argc = 1; | ||||
| 46816 | |||||
| 46817 | do { | ||||
| 46818 | if (arg.WasPassed()) { | ||||
| 46819 | if (arg.Value().IsNull()) { | ||||
| 46820 | argv[0].setNull(); | ||||
| 46821 | break; | ||||
| 46822 | } | ||||
| 46823 | argv[0].setInt32(int32_t(arg.Value().Value())); | ||||
| 46824 | break; | ||||
| 46825 | } else if (argc == 1) { | ||||
| 46826 | // This is our current trailing argument; reduce argc | ||||
| 46827 | --argc; | ||||
| 46828 | } else { | ||||
| 46829 | argv[0].setUndefined(); | ||||
| 46830 | } | ||||
| 46831 | } while (false); | ||||
| 46832 | |||||
| 46833 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46834 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46835 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46836 | !InitIds(cx, atomsCache)) || | ||||
| 46837 | !GetCallableProperty(cx, atomsCache->passOptionalNullableByte_id, &callable)) { | ||||
| 46838 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46839 | return; | ||||
| 46840 | } | ||||
| 46841 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46842 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46843 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46844 | aRv.NoteJSContextException(cx); | ||||
| 46845 | return; | ||||
| 46846 | } | ||||
| 46847 | } | ||||
| 46848 | |||||
| 46849 | void | ||||
| 46850 | TestJSImplInterfaceJSImpl::PassVariadicByte(const nsTArray<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46851 | { | ||||
| 46852 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46853 | if (aRv.Failed()) { | ||||
| 46854 | return; | ||||
| 46855 | } | ||||
| 46856 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46856); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46856; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46857 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46858 | |||||
| 46859 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46860 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 46861 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 46862 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 46863 | // the right thing with that. | ||||
| 46864 | return; | ||||
| 46865 | } | ||||
| 46866 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 46867 | |||||
| 46868 | do { | ||||
| 46869 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 46870 | argv[0 + idx].setInt32(int32_t(arg[idx])); | ||||
| 46871 | continue; | ||||
| 46872 | } | ||||
| 46873 | break; | ||||
| 46874 | } while (false); | ||||
| 46875 | |||||
| 46876 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46877 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46878 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46879 | !InitIds(cx, atomsCache)) || | ||||
| 46880 | !GetCallableProperty(cx, atomsCache->passVariadicByte_id, &callable)) { | ||||
| 46881 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46882 | return; | ||||
| 46883 | } | ||||
| 46884 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46885 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46886 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 46887 | aRv.NoteJSContextException(cx); | ||||
| 46888 | return; | ||||
| 46889 | } | ||||
| 46890 | } | ||||
| 46891 | |||||
| 46892 | int8_t | ||||
| 46893 | TestJSImplInterfaceJSImpl::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46894 | { | ||||
| 46895 | CallSetup s(this, aRv, "TestJSImplInterface.returnByteSideEffectFree", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46896 | if (aRv.Failed()) { | ||||
| 46897 | return int8_t(0); | ||||
| 46898 | } | ||||
| 46899 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46899); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46899; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46900 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46901 | |||||
| 46902 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46903 | |||||
| 46904 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46905 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46906 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46907 | !InitIds(cx, atomsCache)) || | ||||
| 46908 | !GetCallableProperty(cx, atomsCache->returnByteSideEffectFree_id, &callable)) { | ||||
| 46909 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46910 | return int8_t(0); | ||||
| 46911 | } | ||||
| 46912 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46913 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46914 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 46915 | aRv.NoteJSContextException(cx); | ||||
| 46916 | return int8_t(0); | ||||
| 46917 | } | ||||
| 46918 | int8_t rvalDecl; | ||||
| 46919 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnByteSideEffectFree", &rvalDecl)) { | ||||
| 46920 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46921 | return int8_t(0); | ||||
| 46922 | } | ||||
| 46923 | return rvalDecl; | ||||
| 46924 | } | ||||
| 46925 | |||||
| 46926 | int8_t | ||||
| 46927 | TestJSImplInterfaceJSImpl::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46928 | { | ||||
| 46929 | CallSetup s(this, aRv, "TestJSImplInterface.returnDOMDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46930 | if (aRv.Failed()) { | ||||
| 46931 | return int8_t(0); | ||||
| 46932 | } | ||||
| 46933 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46933); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46933; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46934 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46935 | |||||
| 46936 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46937 | |||||
| 46938 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46939 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46940 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46941 | !InitIds(cx, atomsCache)) || | ||||
| 46942 | !GetCallableProperty(cx, atomsCache->returnDOMDependentByte_id, &callable)) { | ||||
| 46943 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46944 | return int8_t(0); | ||||
| 46945 | } | ||||
| 46946 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46947 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46948 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 46949 | aRv.NoteJSContextException(cx); | ||||
| 46950 | return int8_t(0); | ||||
| 46951 | } | ||||
| 46952 | int8_t rvalDecl; | ||||
| 46953 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDOMDependentByte", &rvalDecl)) { | ||||
| 46954 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46955 | return int8_t(0); | ||||
| 46956 | } | ||||
| 46957 | return rvalDecl; | ||||
| 46958 | } | ||||
| 46959 | |||||
| 46960 | int8_t | ||||
| 46961 | TestJSImplInterfaceJSImpl::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46962 | { | ||||
| 46963 | CallSetup s(this, aRv, "TestJSImplInterface.returnConstantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46964 | if (aRv.Failed()) { | ||||
| 46965 | return int8_t(0); | ||||
| 46966 | } | ||||
| 46967 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 46967); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 46967; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 46968 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 46969 | |||||
| 46970 | JS::Rooted<JS::Value> rval(cx); | ||||
| 46971 | |||||
| 46972 | JS::Rooted<JS::Value> callable(cx); | ||||
| 46973 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 46974 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 46975 | !InitIds(cx, atomsCache)) || | ||||
| 46976 | !GetCallableProperty(cx, atomsCache->returnConstantByte_id, &callable)) { | ||||
| 46977 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46978 | return int8_t(0); | ||||
| 46979 | } | ||||
| 46980 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 46981 | if (!JS::Call(cx, thisValue, callable, | ||||
| 46982 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 46983 | aRv.NoteJSContextException(cx); | ||||
| 46984 | return int8_t(0); | ||||
| 46985 | } | ||||
| 46986 | int8_t rvalDecl; | ||||
| 46987 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnConstantByte", &rvalDecl)) { | ||||
| 46988 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 46989 | return int8_t(0); | ||||
| 46990 | } | ||||
| 46991 | return rvalDecl; | ||||
| 46992 | } | ||||
| 46993 | |||||
| 46994 | int8_t | ||||
| 46995 | TestJSImplInterfaceJSImpl::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 46996 | { | ||||
| 46997 | CallSetup s(this, aRv, "TestJSImplInterface.returnDeviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 46998 | if (aRv.Failed()) { | ||||
| 46999 | return int8_t(0); | ||||
| 47000 | } | ||||
| 47001 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47001); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47001; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47002 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47003 | |||||
| 47004 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47005 | |||||
| 47006 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47007 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47008 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47009 | !InitIds(cx, atomsCache)) || | ||||
| 47010 | !GetCallableProperty(cx, atomsCache->returnDeviceStateDependentByte_id, &callable)) { | ||||
| 47011 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47012 | return int8_t(0); | ||||
| 47013 | } | ||||
| 47014 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47015 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47016 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47017 | aRv.NoteJSContextException(cx); | ||||
| 47018 | return int8_t(0); | ||||
| 47019 | } | ||||
| 47020 | int8_t rvalDecl; | ||||
| 47021 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDeviceStateDependentByte", &rvalDecl)) { | ||||
| 47022 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47023 | return int8_t(0); | ||||
| 47024 | } | ||||
| 47025 | return rvalDecl; | ||||
| 47026 | } | ||||
| 47027 | |||||
| 47028 | void | ||||
| 47029 | TestJSImplInterfaceJSImpl::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47030 | { | ||||
| 47031 | CallSetup s(this, aRv, "TestJSImplInterface.passShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47032 | if (aRv.Failed()) { | ||||
| 47033 | return; | ||||
| 47034 | } | ||||
| 47035 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47035); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47035; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47036 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47037 | |||||
| 47038 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47039 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47040 | if (!argv.resize(1)) { | ||||
| 47041 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47042 | // the right thing with that. | ||||
| 47043 | return; | ||||
| 47044 | } | ||||
| 47045 | unsigned argc = 1; | ||||
| 47046 | |||||
| 47047 | do { | ||||
| 47048 | argv[0].setInt32(int32_t(arg)); | ||||
| 47049 | break; | ||||
| 47050 | } while (false); | ||||
| 47051 | |||||
| 47052 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47053 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47054 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47055 | !InitIds(cx, atomsCache)) || | ||||
| 47056 | !GetCallableProperty(cx, atomsCache->passShort_id, &callable)) { | ||||
| 47057 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47058 | return; | ||||
| 47059 | } | ||||
| 47060 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47061 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47062 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47063 | aRv.NoteJSContextException(cx); | ||||
| 47064 | return; | ||||
| 47065 | } | ||||
| 47066 | } | ||||
| 47067 | |||||
| 47068 | int16_t | ||||
| 47069 | TestJSImplInterfaceJSImpl::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47070 | { | ||||
| 47071 | CallSetup s(this, aRv, "TestJSImplInterface.receiveShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47072 | if (aRv.Failed()) { | ||||
| 47073 | return int16_t(0); | ||||
| 47074 | } | ||||
| 47075 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47075); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47075; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47076 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47077 | |||||
| 47078 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47079 | |||||
| 47080 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47081 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47082 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47083 | !InitIds(cx, atomsCache)) || | ||||
| 47084 | !GetCallableProperty(cx, atomsCache->receiveShort_id, &callable)) { | ||||
| 47085 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47086 | return int16_t(0); | ||||
| 47087 | } | ||||
| 47088 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47089 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47090 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47091 | aRv.NoteJSContextException(cx); | ||||
| 47092 | return int16_t(0); | ||||
| 47093 | } | ||||
| 47094 | int16_t rvalDecl; | ||||
| 47095 | if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveShort", &rvalDecl)) { | ||||
| 47096 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47097 | return int16_t(0); | ||||
| 47098 | } | ||||
| 47099 | return rvalDecl; | ||||
| 47100 | } | ||||
| 47101 | |||||
| 47102 | void | ||||
| 47103 | TestJSImplInterfaceJSImpl::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47104 | { | ||||
| 47105 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47106 | if (aRv.Failed()) { | ||||
| 47107 | return; | ||||
| 47108 | } | ||||
| 47109 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47109); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47109; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47110 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47111 | |||||
| 47112 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47113 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47114 | if (!argv.resize(1)) { | ||||
| 47115 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47116 | // the right thing with that. | ||||
| 47117 | return; | ||||
| 47118 | } | ||||
| 47119 | unsigned argc = 1; | ||||
| 47120 | |||||
| 47121 | do { | ||||
| 47122 | if (arg.WasPassed()) { | ||||
| 47123 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 47124 | break; | ||||
| 47125 | } else if (argc == 1) { | ||||
| 47126 | // This is our current trailing argument; reduce argc | ||||
| 47127 | --argc; | ||||
| 47128 | } else { | ||||
| 47129 | argv[0].setUndefined(); | ||||
| 47130 | } | ||||
| 47131 | } while (false); | ||||
| 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->passOptionalShort_id, &callable)) { | ||||
| 47138 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47139 | return; | ||||
| 47140 | } | ||||
| 47141 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47142 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47143 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47144 | aRv.NoteJSContextException(cx); | ||||
| 47145 | return; | ||||
| 47146 | } | ||||
| 47147 | } | ||||
| 47148 | |||||
| 47149 | void | ||||
| 47150 | TestJSImplInterfaceJSImpl::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47151 | { | ||||
| 47152 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47153 | if (aRv.Failed()) { | ||||
| 47154 | return; | ||||
| 47155 | } | ||||
| 47156 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47156); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47156; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47157 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47158 | |||||
| 47159 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47160 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47161 | if (!argv.resize(1)) { | ||||
| 47162 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47163 | // the right thing with that. | ||||
| 47164 | return; | ||||
| 47165 | } | ||||
| 47166 | unsigned argc = 1; | ||||
| 47167 | |||||
| 47168 | do { | ||||
| 47169 | argv[0].setInt32(int32_t(arg)); | ||||
| 47170 | break; | ||||
| 47171 | } while (false); | ||||
| 47172 | |||||
| 47173 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47174 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47175 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47176 | !InitIds(cx, atomsCache)) || | ||||
| 47177 | !GetCallableProperty(cx, atomsCache->passOptionalShortWithDefault_id, &callable)) { | ||||
| 47178 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47179 | return; | ||||
| 47180 | } | ||||
| 47181 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47182 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47183 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47184 | aRv.NoteJSContextException(cx); | ||||
| 47185 | return; | ||||
| 47186 | } | ||||
| 47187 | } | ||||
| 47188 | |||||
| 47189 | void | ||||
| 47190 | TestJSImplInterfaceJSImpl::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47191 | { | ||||
| 47192 | CallSetup s(this, aRv, "TestJSImplInterface.passLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47193 | if (aRv.Failed()) { | ||||
| 47194 | return; | ||||
| 47195 | } | ||||
| 47196 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47196); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47196; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47197 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47198 | |||||
| 47199 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47200 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47201 | if (!argv.resize(1)) { | ||||
| 47202 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47203 | // the right thing with that. | ||||
| 47204 | return; | ||||
| 47205 | } | ||||
| 47206 | unsigned argc = 1; | ||||
| 47207 | |||||
| 47208 | do { | ||||
| 47209 | argv[0].setInt32(int32_t(arg)); | ||||
| 47210 | break; | ||||
| 47211 | } while (false); | ||||
| 47212 | |||||
| 47213 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47214 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47215 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47216 | !InitIds(cx, atomsCache)) || | ||||
| 47217 | !GetCallableProperty(cx, atomsCache->passLong_id, &callable)) { | ||||
| 47218 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47219 | return; | ||||
| 47220 | } | ||||
| 47221 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47222 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47223 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47224 | aRv.NoteJSContextException(cx); | ||||
| 47225 | return; | ||||
| 47226 | } | ||||
| 47227 | } | ||||
| 47228 | |||||
| 47229 | int32_t | ||||
| 47230 | TestJSImplInterfaceJSImpl::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47231 | { | ||||
| 47232 | CallSetup s(this, aRv, "TestJSImplInterface.receiveLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47233 | if (aRv.Failed()) { | ||||
| 47234 | return int32_t(0); | ||||
| 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 { *((volatile int *)__null) = 47236; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47237 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47238 | |||||
| 47239 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47240 | |||||
| 47241 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47242 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47243 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47244 | !InitIds(cx, atomsCache)) || | ||||
| 47245 | !GetCallableProperty(cx, atomsCache->receiveLong_id, &callable)) { | ||||
| 47246 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47247 | return int32_t(0); | ||||
| 47248 | } | ||||
| 47249 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47250 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47251 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47252 | aRv.NoteJSContextException(cx); | ||||
| 47253 | return int32_t(0); | ||||
| 47254 | } | ||||
| 47255 | int32_t rvalDecl; | ||||
| 47256 | if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLong", &rvalDecl)) { | ||||
| 47257 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47258 | return int32_t(0); | ||||
| 47259 | } | ||||
| 47260 | return rvalDecl; | ||||
| 47261 | } | ||||
| 47262 | |||||
| 47263 | void | ||||
| 47264 | TestJSImplInterfaceJSImpl::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47265 | { | ||||
| 47266 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47267 | if (aRv.Failed()) { | ||||
| 47268 | return; | ||||
| 47269 | } | ||||
| 47270 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47270); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47270; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47271 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47272 | |||||
| 47273 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47274 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47275 | if (!argv.resize(1)) { | ||||
| 47276 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47277 | // the right thing with that. | ||||
| 47278 | return; | ||||
| 47279 | } | ||||
| 47280 | unsigned argc = 1; | ||||
| 47281 | |||||
| 47282 | do { | ||||
| 47283 | if (arg.WasPassed()) { | ||||
| 47284 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 47285 | break; | ||||
| 47286 | } else if (argc == 1) { | ||||
| 47287 | // This is our current trailing argument; reduce argc | ||||
| 47288 | --argc; | ||||
| 47289 | } else { | ||||
| 47290 | argv[0].setUndefined(); | ||||
| 47291 | } | ||||
| 47292 | } while (false); | ||||
| 47293 | |||||
| 47294 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47295 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47296 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47297 | !InitIds(cx, atomsCache)) || | ||||
| 47298 | !GetCallableProperty(cx, atomsCache->passOptionalLong_id, &callable)) { | ||||
| 47299 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47300 | return; | ||||
| 47301 | } | ||||
| 47302 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47303 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47304 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47305 | aRv.NoteJSContextException(cx); | ||||
| 47306 | return; | ||||
| 47307 | } | ||||
| 47308 | } | ||||
| 47309 | |||||
| 47310 | void | ||||
| 47311 | TestJSImplInterfaceJSImpl::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47312 | { | ||||
| 47313 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47314 | if (aRv.Failed()) { | ||||
| 47315 | return; | ||||
| 47316 | } | ||||
| 47317 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47317); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47317; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47318 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47319 | |||||
| 47320 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47321 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47322 | if (!argv.resize(1)) { | ||||
| 47323 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47324 | // the right thing with that. | ||||
| 47325 | return; | ||||
| 47326 | } | ||||
| 47327 | unsigned argc = 1; | ||||
| 47328 | |||||
| 47329 | do { | ||||
| 47330 | argv[0].setInt32(int32_t(arg)); | ||||
| 47331 | break; | ||||
| 47332 | } while (false); | ||||
| 47333 | |||||
| 47334 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47335 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47336 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47337 | !InitIds(cx, atomsCache)) || | ||||
| 47338 | !GetCallableProperty(cx, atomsCache->passOptionalLongWithDefault_id, &callable)) { | ||||
| 47339 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47340 | return; | ||||
| 47341 | } | ||||
| 47342 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47343 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47344 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47345 | aRv.NoteJSContextException(cx); | ||||
| 47346 | return; | ||||
| 47347 | } | ||||
| 47348 | } | ||||
| 47349 | |||||
| 47350 | void | ||||
| 47351 | TestJSImplInterfaceJSImpl::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47352 | { | ||||
| 47353 | CallSetup s(this, aRv, "TestJSImplInterface.passLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47354 | if (aRv.Failed()) { | ||||
| 47355 | return; | ||||
| 47356 | } | ||||
| 47357 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47357); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47357; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47358 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47359 | |||||
| 47360 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47361 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47362 | if (!argv.resize(1)) { | ||||
| 47363 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47364 | // the right thing with that. | ||||
| 47365 | return; | ||||
| 47366 | } | ||||
| 47367 | unsigned argc = 1; | ||||
| 47368 | |||||
| 47369 | do { | ||||
| 47370 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 47371 | break; | ||||
| 47372 | } while (false); | ||||
| 47373 | |||||
| 47374 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47375 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47376 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47377 | !InitIds(cx, atomsCache)) || | ||||
| 47378 | !GetCallableProperty(cx, atomsCache->passLongLong_id, &callable)) { | ||||
| 47379 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47380 | return; | ||||
| 47381 | } | ||||
| 47382 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47383 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47384 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47385 | aRv.NoteJSContextException(cx); | ||||
| 47386 | return; | ||||
| 47387 | } | ||||
| 47388 | } | ||||
| 47389 | |||||
| 47390 | int64_t | ||||
| 47391 | TestJSImplInterfaceJSImpl::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47392 | { | ||||
| 47393 | CallSetup s(this, aRv, "TestJSImplInterface.receiveLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47394 | if (aRv.Failed()) { | ||||
| 47395 | return int64_t(0); | ||||
| 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 { *((volatile int *)__null) = 47397; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47398 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47399 | |||||
| 47400 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47401 | |||||
| 47402 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47403 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47404 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47405 | !InitIds(cx, atomsCache)) || | ||||
| 47406 | !GetCallableProperty(cx, atomsCache->receiveLongLong_id, &callable)) { | ||||
| 47407 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47408 | return int64_t(0); | ||||
| 47409 | } | ||||
| 47410 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47411 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47412 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47413 | aRv.NoteJSContextException(cx); | ||||
| 47414 | return int64_t(0); | ||||
| 47415 | } | ||||
| 47416 | int64_t rvalDecl; | ||||
| 47417 | if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLongLong", &rvalDecl)) { | ||||
| 47418 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47419 | return int64_t(0); | ||||
| 47420 | } | ||||
| 47421 | return rvalDecl; | ||||
| 47422 | } | ||||
| 47423 | |||||
| 47424 | void | ||||
| 47425 | TestJSImplInterfaceJSImpl::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47426 | { | ||||
| 47427 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47428 | if (aRv.Failed()) { | ||||
| 47429 | return; | ||||
| 47430 | } | ||||
| 47431 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47431); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47431; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47432 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47433 | |||||
| 47434 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47435 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47436 | if (!argv.resize(1)) { | ||||
| 47437 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47438 | // the right thing with that. | ||||
| 47439 | return; | ||||
| 47440 | } | ||||
| 47441 | unsigned argc = 1; | ||||
| 47442 | |||||
| 47443 | do { | ||||
| 47444 | if (arg.WasPassed()) { | ||||
| 47445 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 47446 | break; | ||||
| 47447 | } else if (argc == 1) { | ||||
| 47448 | // This is our current trailing argument; reduce argc | ||||
| 47449 | --argc; | ||||
| 47450 | } else { | ||||
| 47451 | argv[0].setUndefined(); | ||||
| 47452 | } | ||||
| 47453 | } while (false); | ||||
| 47454 | |||||
| 47455 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47456 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47457 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47458 | !InitIds(cx, atomsCache)) || | ||||
| 47459 | !GetCallableProperty(cx, atomsCache->passOptionalLongLong_id, &callable)) { | ||||
| 47460 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47461 | return; | ||||
| 47462 | } | ||||
| 47463 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47464 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47465 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47466 | aRv.NoteJSContextException(cx); | ||||
| 47467 | return; | ||||
| 47468 | } | ||||
| 47469 | } | ||||
| 47470 | |||||
| 47471 | void | ||||
| 47472 | TestJSImplInterfaceJSImpl::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47473 | { | ||||
| 47474 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47475 | if (aRv.Failed()) { | ||||
| 47476 | return; | ||||
| 47477 | } | ||||
| 47478 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47478); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47478; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47479 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47480 | |||||
| 47481 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47482 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47483 | if (!argv.resize(1)) { | ||||
| 47484 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47485 | // the right thing with that. | ||||
| 47486 | return; | ||||
| 47487 | } | ||||
| 47488 | unsigned argc = 1; | ||||
| 47489 | |||||
| 47490 | do { | ||||
| 47491 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 47492 | break; | ||||
| 47493 | } while (false); | ||||
| 47494 | |||||
| 47495 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47496 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47497 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47498 | !InitIds(cx, atomsCache)) || | ||||
| 47499 | !GetCallableProperty(cx, atomsCache->passOptionalLongLongWithDefault_id, &callable)) { | ||||
| 47500 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47501 | return; | ||||
| 47502 | } | ||||
| 47503 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47504 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47505 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47506 | aRv.NoteJSContextException(cx); | ||||
| 47507 | return; | ||||
| 47508 | } | ||||
| 47509 | } | ||||
| 47510 | |||||
| 47511 | void | ||||
| 47512 | TestJSImplInterfaceJSImpl::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47513 | { | ||||
| 47514 | CallSetup s(this, aRv, "TestJSImplInterface.passOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47515 | if (aRv.Failed()) { | ||||
| 47516 | return; | ||||
| 47517 | } | ||||
| 47518 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47518); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47518; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47519 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47520 | |||||
| 47521 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47522 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47523 | if (!argv.resize(1)) { | ||||
| 47524 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47525 | // the right thing with that. | ||||
| 47526 | return; | ||||
| 47527 | } | ||||
| 47528 | unsigned argc = 1; | ||||
| 47529 | |||||
| 47530 | do { | ||||
| 47531 | argv[0].setInt32(int32_t(arg)); | ||||
| 47532 | break; | ||||
| 47533 | } while (false); | ||||
| 47534 | |||||
| 47535 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47536 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47537 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47538 | !InitIds(cx, atomsCache)) || | ||||
| 47539 | !GetCallableProperty(cx, atomsCache->passOctet_id, &callable)) { | ||||
| 47540 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47541 | return; | ||||
| 47542 | } | ||||
| 47543 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47544 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47545 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47546 | aRv.NoteJSContextException(cx); | ||||
| 47547 | return; | ||||
| 47548 | } | ||||
| 47549 | } | ||||
| 47550 | |||||
| 47551 | uint8_t | ||||
| 47552 | TestJSImplInterfaceJSImpl::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47553 | { | ||||
| 47554 | CallSetup s(this, aRv, "TestJSImplInterface.receiveOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47555 | if (aRv.Failed()) { | ||||
| 47556 | return uint8_t(0); | ||||
| 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 { *((volatile int *)__null) = 47558; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47559 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47560 | |||||
| 47561 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47562 | |||||
| 47563 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47564 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47565 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47566 | !InitIds(cx, atomsCache)) || | ||||
| 47567 | !GetCallableProperty(cx, atomsCache->receiveOctet_id, &callable)) { | ||||
| 47568 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47569 | return uint8_t(0); | ||||
| 47570 | } | ||||
| 47571 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47572 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47573 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47574 | aRv.NoteJSContextException(cx); | ||||
| 47575 | return uint8_t(0); | ||||
| 47576 | } | ||||
| 47577 | uint8_t rvalDecl; | ||||
| 47578 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveOctet", &rvalDecl)) { | ||||
| 47579 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47580 | return uint8_t(0); | ||||
| 47581 | } | ||||
| 47582 | return rvalDecl; | ||||
| 47583 | } | ||||
| 47584 | |||||
| 47585 | void | ||||
| 47586 | TestJSImplInterfaceJSImpl::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47587 | { | ||||
| 47588 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47589 | if (aRv.Failed()) { | ||||
| 47590 | return; | ||||
| 47591 | } | ||||
| 47592 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47592); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47592; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47593 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47594 | |||||
| 47595 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47596 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47597 | if (!argv.resize(1)) { | ||||
| 47598 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47599 | // the right thing with that. | ||||
| 47600 | return; | ||||
| 47601 | } | ||||
| 47602 | unsigned argc = 1; | ||||
| 47603 | |||||
| 47604 | do { | ||||
| 47605 | if (arg.WasPassed()) { | ||||
| 47606 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 47607 | break; | ||||
| 47608 | } else if (argc == 1) { | ||||
| 47609 | // This is our current trailing argument; reduce argc | ||||
| 47610 | --argc; | ||||
| 47611 | } else { | ||||
| 47612 | argv[0].setUndefined(); | ||||
| 47613 | } | ||||
| 47614 | } while (false); | ||||
| 47615 | |||||
| 47616 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47617 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47618 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47619 | !InitIds(cx, atomsCache)) || | ||||
| 47620 | !GetCallableProperty(cx, atomsCache->passOptionalOctet_id, &callable)) { | ||||
| 47621 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47622 | return; | ||||
| 47623 | } | ||||
| 47624 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47625 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47626 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47627 | aRv.NoteJSContextException(cx); | ||||
| 47628 | return; | ||||
| 47629 | } | ||||
| 47630 | } | ||||
| 47631 | |||||
| 47632 | void | ||||
| 47633 | TestJSImplInterfaceJSImpl::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47634 | { | ||||
| 47635 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctetWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47636 | if (aRv.Failed()) { | ||||
| 47637 | return; | ||||
| 47638 | } | ||||
| 47639 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47639); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47639; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47640 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47641 | |||||
| 47642 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47643 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47644 | if (!argv.resize(1)) { | ||||
| 47645 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47646 | // the right thing with that. | ||||
| 47647 | return; | ||||
| 47648 | } | ||||
| 47649 | unsigned argc = 1; | ||||
| 47650 | |||||
| 47651 | do { | ||||
| 47652 | argv[0].setInt32(int32_t(arg)); | ||||
| 47653 | break; | ||||
| 47654 | } while (false); | ||||
| 47655 | |||||
| 47656 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47657 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47658 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47659 | !InitIds(cx, atomsCache)) || | ||||
| 47660 | !GetCallableProperty(cx, atomsCache->passOptionalOctetWithDefault_id, &callable)) { | ||||
| 47661 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47662 | return; | ||||
| 47663 | } | ||||
| 47664 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47665 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47666 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47667 | aRv.NoteJSContextException(cx); | ||||
| 47668 | return; | ||||
| 47669 | } | ||||
| 47670 | } | ||||
| 47671 | |||||
| 47672 | void | ||||
| 47673 | TestJSImplInterfaceJSImpl::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47674 | { | ||||
| 47675 | CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47676 | if (aRv.Failed()) { | ||||
| 47677 | return; | ||||
| 47678 | } | ||||
| 47679 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47679); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47679; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47680 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47681 | |||||
| 47682 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47683 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47684 | if (!argv.resize(1)) { | ||||
| 47685 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47686 | // the right thing with that. | ||||
| 47687 | return; | ||||
| 47688 | } | ||||
| 47689 | unsigned argc = 1; | ||||
| 47690 | |||||
| 47691 | do { | ||||
| 47692 | argv[0].setInt32(int32_t(arg)); | ||||
| 47693 | break; | ||||
| 47694 | } while (false); | ||||
| 47695 | |||||
| 47696 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47697 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47698 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47699 | !InitIds(cx, atomsCache)) || | ||||
| 47700 | !GetCallableProperty(cx, atomsCache->passUnsignedShort_id, &callable)) { | ||||
| 47701 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47702 | return; | ||||
| 47703 | } | ||||
| 47704 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47705 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47706 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47707 | aRv.NoteJSContextException(cx); | ||||
| 47708 | return; | ||||
| 47709 | } | ||||
| 47710 | } | ||||
| 47711 | |||||
| 47712 | uint16_t | ||||
| 47713 | TestJSImplInterfaceJSImpl::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47714 | { | ||||
| 47715 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47716 | if (aRv.Failed()) { | ||||
| 47717 | return uint16_t(0); | ||||
| 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 { *((volatile int *)__null) = 47719; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47720 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47721 | |||||
| 47722 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47723 | |||||
| 47724 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47725 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47726 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47727 | !InitIds(cx, atomsCache)) || | ||||
| 47728 | !GetCallableProperty(cx, atomsCache->receiveUnsignedShort_id, &callable)) { | ||||
| 47729 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47730 | return uint16_t(0); | ||||
| 47731 | } | ||||
| 47732 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47733 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47734 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47735 | aRv.NoteJSContextException(cx); | ||||
| 47736 | return uint16_t(0); | ||||
| 47737 | } | ||||
| 47738 | uint16_t rvalDecl; | ||||
| 47739 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedShort", &rvalDecl)) { | ||||
| 47740 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47741 | return uint16_t(0); | ||||
| 47742 | } | ||||
| 47743 | return rvalDecl; | ||||
| 47744 | } | ||||
| 47745 | |||||
| 47746 | void | ||||
| 47747 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47748 | { | ||||
| 47749 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47750 | if (aRv.Failed()) { | ||||
| 47751 | return; | ||||
| 47752 | } | ||||
| 47753 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47753); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47753; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47754 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47755 | |||||
| 47756 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47757 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47758 | if (!argv.resize(1)) { | ||||
| 47759 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47760 | // the right thing with that. | ||||
| 47761 | return; | ||||
| 47762 | } | ||||
| 47763 | unsigned argc = 1; | ||||
| 47764 | |||||
| 47765 | do { | ||||
| 47766 | if (arg.WasPassed()) { | ||||
| 47767 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 47768 | break; | ||||
| 47769 | } else if (argc == 1) { | ||||
| 47770 | // This is our current trailing argument; reduce argc | ||||
| 47771 | --argc; | ||||
| 47772 | } else { | ||||
| 47773 | argv[0].setUndefined(); | ||||
| 47774 | } | ||||
| 47775 | } while (false); | ||||
| 47776 | |||||
| 47777 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47778 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47779 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47780 | !InitIds(cx, atomsCache)) || | ||||
| 47781 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShort_id, &callable)) { | ||||
| 47782 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47783 | return; | ||||
| 47784 | } | ||||
| 47785 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47786 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47787 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47788 | aRv.NoteJSContextException(cx); | ||||
| 47789 | return; | ||||
| 47790 | } | ||||
| 47791 | } | ||||
| 47792 | |||||
| 47793 | void | ||||
| 47794 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47795 | { | ||||
| 47796 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47797 | if (aRv.Failed()) { | ||||
| 47798 | return; | ||||
| 47799 | } | ||||
| 47800 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47800); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47800; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47801 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47802 | |||||
| 47803 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47804 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47805 | if (!argv.resize(1)) { | ||||
| 47806 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47807 | // the right thing with that. | ||||
| 47808 | return; | ||||
| 47809 | } | ||||
| 47810 | unsigned argc = 1; | ||||
| 47811 | |||||
| 47812 | do { | ||||
| 47813 | argv[0].setInt32(int32_t(arg)); | ||||
| 47814 | break; | ||||
| 47815 | } while (false); | ||||
| 47816 | |||||
| 47817 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47818 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47819 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47820 | !InitIds(cx, atomsCache)) || | ||||
| 47821 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShortWithDefault_id, &callable)) { | ||||
| 47822 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47823 | return; | ||||
| 47824 | } | ||||
| 47825 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47826 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47827 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47828 | aRv.NoteJSContextException(cx); | ||||
| 47829 | return; | ||||
| 47830 | } | ||||
| 47831 | } | ||||
| 47832 | |||||
| 47833 | void | ||||
| 47834 | TestJSImplInterfaceJSImpl::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47835 | { | ||||
| 47836 | CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47837 | if (aRv.Failed()) { | ||||
| 47838 | return; | ||||
| 47839 | } | ||||
| 47840 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47840); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47840; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47841 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47842 | |||||
| 47843 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47844 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47845 | if (!argv.resize(1)) { | ||||
| 47846 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47847 | // the right thing with that. | ||||
| 47848 | return; | ||||
| 47849 | } | ||||
| 47850 | unsigned argc = 1; | ||||
| 47851 | |||||
| 47852 | do { | ||||
| 47853 | argv[0].setNumber(arg); | ||||
| 47854 | break; | ||||
| 47855 | } while (false); | ||||
| 47856 | |||||
| 47857 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47858 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47859 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47860 | !InitIds(cx, atomsCache)) || | ||||
| 47861 | !GetCallableProperty(cx, atomsCache->passUnsignedLong_id, &callable)) { | ||||
| 47862 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47863 | return; | ||||
| 47864 | } | ||||
| 47865 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47866 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47867 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47868 | aRv.NoteJSContextException(cx); | ||||
| 47869 | return; | ||||
| 47870 | } | ||||
| 47871 | } | ||||
| 47872 | |||||
| 47873 | uint32_t | ||||
| 47874 | TestJSImplInterfaceJSImpl::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47875 | { | ||||
| 47876 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47877 | if (aRv.Failed()) { | ||||
| 47878 | return uint32_t(0); | ||||
| 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 { *((volatile int *)__null) = 47880; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47881 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47882 | |||||
| 47883 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47884 | |||||
| 47885 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47886 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47887 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47888 | !InitIds(cx, atomsCache)) || | ||||
| 47889 | !GetCallableProperty(cx, atomsCache->receiveUnsignedLong_id, &callable)) { | ||||
| 47890 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47891 | return uint32_t(0); | ||||
| 47892 | } | ||||
| 47893 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47894 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47895 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 47896 | aRv.NoteJSContextException(cx); | ||||
| 47897 | return uint32_t(0); | ||||
| 47898 | } | ||||
| 47899 | uint32_t rvalDecl; | ||||
| 47900 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLong", &rvalDecl)) { | ||||
| 47901 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47902 | return uint32_t(0); | ||||
| 47903 | } | ||||
| 47904 | return rvalDecl; | ||||
| 47905 | } | ||||
| 47906 | |||||
| 47907 | void | ||||
| 47908 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47909 | { | ||||
| 47910 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47911 | if (aRv.Failed()) { | ||||
| 47912 | return; | ||||
| 47913 | } | ||||
| 47914 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47914); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47914; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47915 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47916 | |||||
| 47917 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47918 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47919 | if (!argv.resize(1)) { | ||||
| 47920 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47921 | // the right thing with that. | ||||
| 47922 | return; | ||||
| 47923 | } | ||||
| 47924 | unsigned argc = 1; | ||||
| 47925 | |||||
| 47926 | do { | ||||
| 47927 | if (arg.WasPassed()) { | ||||
| 47928 | argv[0].setNumber(arg.Value()); | ||||
| 47929 | break; | ||||
| 47930 | } else if (argc == 1) { | ||||
| 47931 | // This is our current trailing argument; reduce argc | ||||
| 47932 | --argc; | ||||
| 47933 | } else { | ||||
| 47934 | argv[0].setUndefined(); | ||||
| 47935 | } | ||||
| 47936 | } while (false); | ||||
| 47937 | |||||
| 47938 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47939 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47940 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47941 | !InitIds(cx, atomsCache)) || | ||||
| 47942 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLong_id, &callable)) { | ||||
| 47943 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47944 | return; | ||||
| 47945 | } | ||||
| 47946 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47947 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47948 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47949 | aRv.NoteJSContextException(cx); | ||||
| 47950 | return; | ||||
| 47951 | } | ||||
| 47952 | } | ||||
| 47953 | |||||
| 47954 | void | ||||
| 47955 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47956 | { | ||||
| 47957 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47958 | if (aRv.Failed()) { | ||||
| 47959 | return; | ||||
| 47960 | } | ||||
| 47961 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 47961); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 47961; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 47962 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 47963 | |||||
| 47964 | JS::Rooted<JS::Value> rval(cx); | ||||
| 47965 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 47966 | if (!argv.resize(1)) { | ||||
| 47967 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 47968 | // the right thing with that. | ||||
| 47969 | return; | ||||
| 47970 | } | ||||
| 47971 | unsigned argc = 1; | ||||
| 47972 | |||||
| 47973 | do { | ||||
| 47974 | argv[0].setNumber(arg); | ||||
| 47975 | break; | ||||
| 47976 | } while (false); | ||||
| 47977 | |||||
| 47978 | JS::Rooted<JS::Value> callable(cx); | ||||
| 47979 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 47980 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 47981 | !InitIds(cx, atomsCache)) || | ||||
| 47982 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongWithDefault_id, &callable)) { | ||||
| 47983 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 47984 | return; | ||||
| 47985 | } | ||||
| 47986 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 47987 | if (!JS::Call(cx, thisValue, callable, | ||||
| 47988 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 47989 | aRv.NoteJSContextException(cx); | ||||
| 47990 | return; | ||||
| 47991 | } | ||||
| 47992 | } | ||||
| 47993 | |||||
| 47994 | void | ||||
| 47995 | TestJSImplInterfaceJSImpl::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 47996 | { | ||||
| 47997 | CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 47998 | if (aRv.Failed()) { | ||||
| 47999 | return; | ||||
| 48000 | } | ||||
| 48001 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48001); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48001; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48002 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48003 | |||||
| 48004 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48005 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 48006 | if (!argv.resize(1)) { | ||||
| 48007 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 48008 | // the right thing with that. | ||||
| 48009 | return; | ||||
| 48010 | } | ||||
| 48011 | unsigned argc = 1; | ||||
| 48012 | |||||
| 48013 | do { | ||||
| 48014 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 48015 | break; | ||||
| 48016 | } while (false); | ||||
| 48017 | |||||
| 48018 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48019 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48020 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48021 | !InitIds(cx, atomsCache)) || | ||||
| 48022 | !GetCallableProperty(cx, atomsCache->passUnsignedLongLong_id, &callable)) { | ||||
| 48023 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48024 | return; | ||||
| 48025 | } | ||||
| 48026 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48027 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48028 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 48029 | aRv.NoteJSContextException(cx); | ||||
| 48030 | return; | ||||
| 48031 | } | ||||
| 48032 | } | ||||
| 48033 | |||||
| 48034 | uint64_t | ||||
| 48035 | TestJSImplInterfaceJSImpl::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48036 | { | ||||
| 48037 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48038 | if (aRv.Failed()) { | ||||
| 48039 | return uint64_t(0); | ||||
| 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 { *((volatile int *)__null) = 48041; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48042 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48043 | |||||
| 48044 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48045 | |||||
| 48046 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48047 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48048 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48049 | !InitIds(cx, atomsCache)) || | ||||
| 48050 | !GetCallableProperty(cx, atomsCache->receiveUnsignedLongLong_id, &callable)) { | ||||
| 48051 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48052 | return uint64_t(0); | ||||
| 48053 | } | ||||
| 48054 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48055 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48056 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 48057 | aRv.NoteJSContextException(cx); | ||||
| 48058 | return uint64_t(0); | ||||
| 48059 | } | ||||
| 48060 | uint64_t rvalDecl; | ||||
| 48061 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLongLong", &rvalDecl)) { | ||||
| 48062 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48063 | return uint64_t(0); | ||||
| 48064 | } | ||||
| 48065 | return rvalDecl; | ||||
| 48066 | } | ||||
| 48067 | |||||
| 48068 | void | ||||
| 48069 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48070 | { | ||||
| 48071 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48072 | if (aRv.Failed()) { | ||||
| 48073 | return; | ||||
| 48074 | } | ||||
| 48075 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48075); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48075; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48076 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48077 | |||||
| 48078 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48079 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 48080 | if (!argv.resize(1)) { | ||||
| 48081 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 48082 | // the right thing with that. | ||||
| 48083 | return; | ||||
| 48084 | } | ||||
| 48085 | unsigned argc = 1; | ||||
| 48086 | |||||
| 48087 | do { | ||||
| 48088 | if (arg.WasPassed()) { | ||||
| 48089 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 48090 | break; | ||||
| 48091 | } else if (argc == 1) { | ||||
| 48092 | // This is our current trailing argument; reduce argc | ||||
| 48093 | --argc; | ||||
| 48094 | } else { | ||||
| 48095 | argv[0].setUndefined(); | ||||
| 48096 | } | ||||
| 48097 | } while (false); | ||||
| 48098 | |||||
| 48099 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48100 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48101 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48102 | !InitIds(cx, atomsCache)) || | ||||
| 48103 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLong_id, &callable)) { | ||||
| 48104 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48105 | return; | ||||
| 48106 | } | ||||
| 48107 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48108 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48109 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 48110 | aRv.NoteJSContextException(cx); | ||||
| 48111 | return; | ||||
| 48112 | } | ||||
| 48113 | } | ||||
| 48114 | |||||
| 48115 | void | ||||
| 48116 | TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48117 | { | ||||
| 48118 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48119 | if (aRv.Failed()) { | ||||
| 48120 | return; | ||||
| 48121 | } | ||||
| 48122 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48122); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48122; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48123 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48124 | |||||
| 48125 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48126 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 48127 | if (!argv.resize(1)) { | ||||
| 48128 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 48129 | // the right thing with that. | ||||
| 48130 | return; | ||||
| 48131 | } | ||||
| 48132 | unsigned argc = 1; | ||||
| 48133 | |||||
| 48134 | do { | ||||
| 48135 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 48136 | break; | ||||
| 48137 | } while (false); | ||||
| 48138 | |||||
| 48139 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48140 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48141 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48142 | !InitIds(cx, atomsCache)) || | ||||
| 48143 | !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLongWithDefault_id, &callable)) { | ||||
| 48144 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48145 | return; | ||||
| 48146 | } | ||||
| 48147 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48148 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48149 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 48150 | aRv.NoteJSContextException(cx); | ||||
| 48151 | return; | ||||
| 48152 | } | ||||
| 48153 | } | ||||
| 48154 | |||||
| 48155 | void | ||||
| 48156 | TestJSImplInterfaceJSImpl::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) | ||||
| 48157 | { | ||||
| 48158 | CallSetup s(this, aRv, "TestJSImplInterface.passFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48159 | if (aRv.Failed()) { | ||||
| 48160 | return; | ||||
| 48161 | } | ||||
| 48162 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48162); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48162; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48163 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48164 | |||||
| 48165 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48166 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 48167 | if (!argv.resize(16)) { | ||||
| 48168 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 48169 | // the right thing with that. | ||||
| 48170 | return; | ||||
| 48171 | } | ||||
| 48172 | unsigned argc = 16; | ||||
| 48173 | |||||
| 48174 | do { | ||||
| 48175 | |||||
| 48176 | uint32_t length = arg16.Length(); | ||||
| 48177 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48178 | if (!returnArray) { | ||||
| 48179 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48180 | return; | ||||
| 48181 | } | ||||
| 48182 | // Scope for 'tmp' | ||||
| 48183 | { | ||||
| 48184 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48185 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48186 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48187 | // are different ways to succeed at wrapping the object. | ||||
| 48188 | do { | ||||
| 48189 | if (arg16[sequenceIdx0].IsNull()) { | ||||
| 48190 | tmp.setNull(); | ||||
| 48191 | break; | ||||
| 48192 | } | ||||
| 48193 | tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value()))); | ||||
| 48194 | break; | ||||
| 48195 | } while (false); | ||||
| 48196 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48197 | JSPROP_ENUMERATE)) { | ||||
| 48198 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48199 | return; | ||||
| 48200 | } | ||||
| 48201 | } | ||||
| 48202 | } | ||||
| 48203 | argv[15].setObject(*returnArray); | ||||
| 48204 | break; | ||||
| 48205 | } while (false); | ||||
| 48206 | |||||
| 48207 | do { | ||||
| 48208 | |||||
| 48209 | uint32_t length = arg15.Length(); | ||||
| 48210 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48211 | if (!returnArray) { | ||||
| 48212 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48213 | return; | ||||
| 48214 | } | ||||
| 48215 | // Scope for 'tmp' | ||||
| 48216 | { | ||||
| 48217 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48218 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48219 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48220 | // are different ways to succeed at wrapping the object. | ||||
| 48221 | do { | ||||
| 48222 | if (arg15[sequenceIdx0].IsNull()) { | ||||
| 48223 | tmp.setNull(); | ||||
| 48224 | break; | ||||
| 48225 | } | ||||
| 48226 | tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value()))); | ||||
| 48227 | break; | ||||
| 48228 | } while (false); | ||||
| 48229 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48230 | JSPROP_ENUMERATE)) { | ||||
| 48231 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48232 | return; | ||||
| 48233 | } | ||||
| 48234 | } | ||||
| 48235 | } | ||||
| 48236 | argv[14].setObject(*returnArray); | ||||
| 48237 | break; | ||||
| 48238 | } while (false); | ||||
| 48239 | |||||
| 48240 | do { | ||||
| 48241 | |||||
| 48242 | uint32_t length = arg14.Length(); | ||||
| 48243 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48244 | if (!returnArray) { | ||||
| 48245 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48246 | return; | ||||
| 48247 | } | ||||
| 48248 | // Scope for 'tmp' | ||||
| 48249 | { | ||||
| 48250 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48251 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48252 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48253 | // are different ways to succeed at wrapping the object. | ||||
| 48254 | do { | ||||
| 48255 | tmp.set(JS_NumberValue(double(arg14[sequenceIdx0]))); | ||||
| 48256 | break; | ||||
| 48257 | } while (false); | ||||
| 48258 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48259 | JSPROP_ENUMERATE)) { | ||||
| 48260 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48261 | return; | ||||
| 48262 | } | ||||
| 48263 | } | ||||
| 48264 | } | ||||
| 48265 | argv[13].setObject(*returnArray); | ||||
| 48266 | break; | ||||
| 48267 | } while (false); | ||||
| 48268 | |||||
| 48269 | do { | ||||
| 48270 | |||||
| 48271 | uint32_t length = arg13.Length(); | ||||
| 48272 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48273 | if (!returnArray) { | ||||
| 48274 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48275 | return; | ||||
| 48276 | } | ||||
| 48277 | // Scope for 'tmp' | ||||
| 48278 | { | ||||
| 48279 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48280 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48281 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48282 | // are different ways to succeed at wrapping the object. | ||||
| 48283 | do { | ||||
| 48284 | tmp.set(JS_NumberValue(double(arg13[sequenceIdx0]))); | ||||
| 48285 | break; | ||||
| 48286 | } while (false); | ||||
| 48287 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48288 | JSPROP_ENUMERATE)) { | ||||
| 48289 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48290 | return; | ||||
| 48291 | } | ||||
| 48292 | } | ||||
| 48293 | } | ||||
| 48294 | argv[12].setObject(*returnArray); | ||||
| 48295 | break; | ||||
| 48296 | } while (false); | ||||
| 48297 | |||||
| 48298 | do { | ||||
| 48299 | |||||
| 48300 | uint32_t length = arg12.Length(); | ||||
| 48301 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48302 | if (!returnArray) { | ||||
| 48303 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48304 | return; | ||||
| 48305 | } | ||||
| 48306 | // Scope for 'tmp' | ||||
| 48307 | { | ||||
| 48308 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48309 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48310 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48311 | // are different ways to succeed at wrapping the object. | ||||
| 48312 | do { | ||||
| 48313 | if (arg12[sequenceIdx0].IsNull()) { | ||||
| 48314 | tmp.setNull(); | ||||
| 48315 | break; | ||||
| 48316 | } | ||||
| 48317 | tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value()))); | ||||
| 48318 | break; | ||||
| 48319 | } while (false); | ||||
| 48320 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48321 | JSPROP_ENUMERATE)) { | ||||
| 48322 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48323 | return; | ||||
| 48324 | } | ||||
| 48325 | } | ||||
| 48326 | } | ||||
| 48327 | argv[11].setObject(*returnArray); | ||||
| 48328 | break; | ||||
| 48329 | } while (false); | ||||
| 48330 | |||||
| 48331 | do { | ||||
| 48332 | |||||
| 48333 | uint32_t length = arg11.Length(); | ||||
| 48334 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48335 | if (!returnArray) { | ||||
| 48336 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48337 | return; | ||||
| 48338 | } | ||||
| 48339 | // Scope for 'tmp' | ||||
| 48340 | { | ||||
| 48341 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48342 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48343 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48344 | // are different ways to succeed at wrapping the object. | ||||
| 48345 | do { | ||||
| 48346 | if (arg11[sequenceIdx0].IsNull()) { | ||||
| 48347 | tmp.setNull(); | ||||
| 48348 | break; | ||||
| 48349 | } | ||||
| 48350 | tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value()))); | ||||
| 48351 | break; | ||||
| 48352 | } while (false); | ||||
| 48353 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48354 | JSPROP_ENUMERATE)) { | ||||
| 48355 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48356 | return; | ||||
| 48357 | } | ||||
| 48358 | } | ||||
| 48359 | } | ||||
| 48360 | argv[10].setObject(*returnArray); | ||||
| 48361 | break; | ||||
| 48362 | } while (false); | ||||
| 48363 | |||||
| 48364 | do { | ||||
| 48365 | |||||
| 48366 | uint32_t length = arg10.Length(); | ||||
| 48367 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48368 | if (!returnArray) { | ||||
| 48369 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48370 | return; | ||||
| 48371 | } | ||||
| 48372 | // Scope for 'tmp' | ||||
| 48373 | { | ||||
| 48374 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48375 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48376 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48377 | // are different ways to succeed at wrapping the object. | ||||
| 48378 | do { | ||||
| 48379 | tmp.set(JS_NumberValue(double(arg10[sequenceIdx0]))); | ||||
| 48380 | break; | ||||
| 48381 | } while (false); | ||||
| 48382 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48383 | JSPROP_ENUMERATE)) { | ||||
| 48384 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48385 | return; | ||||
| 48386 | } | ||||
| 48387 | } | ||||
| 48388 | } | ||||
| 48389 | argv[9].setObject(*returnArray); | ||||
| 48390 | break; | ||||
| 48391 | } while (false); | ||||
| 48392 | |||||
| 48393 | do { | ||||
| 48394 | |||||
| 48395 | uint32_t length = arg9.Length(); | ||||
| 48396 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48397 | if (!returnArray) { | ||||
| 48398 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48399 | return; | ||||
| 48400 | } | ||||
| 48401 | // Scope for 'tmp' | ||||
| 48402 | { | ||||
| 48403 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48404 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48405 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48406 | // are different ways to succeed at wrapping the object. | ||||
| 48407 | do { | ||||
| 48408 | tmp.set(JS_NumberValue(double(arg9[sequenceIdx0]))); | ||||
| 48409 | break; | ||||
| 48410 | } while (false); | ||||
| 48411 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48412 | JSPROP_ENUMERATE)) { | ||||
| 48413 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48414 | return; | ||||
| 48415 | } | ||||
| 48416 | } | ||||
| 48417 | } | ||||
| 48418 | argv[8].setObject(*returnArray); | ||||
| 48419 | break; | ||||
| 48420 | } while (false); | ||||
| 48421 | |||||
| 48422 | do { | ||||
| 48423 | if (arg8.IsNull()) { | ||||
| 48424 | argv[7].setNull(); | ||||
| 48425 | break; | ||||
| 48426 | } | ||||
| 48427 | argv[7].set(JS_NumberValue(double(arg8.Value()))); | ||||
| 48428 | break; | ||||
| 48429 | } while (false); | ||||
| 48430 | |||||
| 48431 | do { | ||||
| 48432 | if (arg7.IsNull()) { | ||||
| 48433 | argv[6].setNull(); | ||||
| 48434 | break; | ||||
| 48435 | } | ||||
| 48436 | argv[6].set(JS_NumberValue(double(arg7.Value()))); | ||||
| 48437 | break; | ||||
| 48438 | } while (false); | ||||
| 48439 | |||||
| 48440 | do { | ||||
| 48441 | argv[5].set(JS_NumberValue(double(arg6))); | ||||
| 48442 | break; | ||||
| 48443 | } while (false); | ||||
| 48444 | |||||
| 48445 | do { | ||||
| 48446 | argv[4].set(JS_NumberValue(double(arg5))); | ||||
| 48447 | break; | ||||
| 48448 | } while (false); | ||||
| 48449 | |||||
| 48450 | do { | ||||
| 48451 | if (arg4.IsNull()) { | ||||
| 48452 | argv[3].setNull(); | ||||
| 48453 | break; | ||||
| 48454 | } | ||||
| 48455 | argv[3].set(JS_NumberValue(double(arg4.Value()))); | ||||
| 48456 | break; | ||||
| 48457 | } while (false); | ||||
| 48458 | |||||
| 48459 | do { | ||||
| 48460 | if (arg3.IsNull()) { | ||||
| 48461 | argv[2].setNull(); | ||||
| 48462 | break; | ||||
| 48463 | } | ||||
| 48464 | argv[2].set(JS_NumberValue(double(arg3.Value()))); | ||||
| 48465 | break; | ||||
| 48466 | } while (false); | ||||
| 48467 | |||||
| 48468 | do { | ||||
| 48469 | argv[1].set(JS_NumberValue(double(arg2))); | ||||
| 48470 | break; | ||||
| 48471 | } while (false); | ||||
| 48472 | |||||
| 48473 | do { | ||||
| 48474 | argv[0].set(JS_NumberValue(double(arg1))); | ||||
| 48475 | break; | ||||
| 48476 | } while (false); | ||||
| 48477 | |||||
| 48478 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48479 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48480 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48481 | !InitIds(cx, atomsCache)) || | ||||
| 48482 | !GetCallableProperty(cx, atomsCache->passFloat_id, &callable)) { | ||||
| 48483 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48484 | return; | ||||
| 48485 | } | ||||
| 48486 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48487 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48488 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 48489 | aRv.NoteJSContextException(cx); | ||||
| 48490 | return; | ||||
| 48491 | } | ||||
| 48492 | } | ||||
| 48493 | |||||
| 48494 | void | ||||
| 48495 | TestJSImplInterfaceJSImpl::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) | ||||
| 48496 | { | ||||
| 48497 | CallSetup s(this, aRv, "TestJSImplInterface.passLenientFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48498 | if (aRv.Failed()) { | ||||
| 48499 | return; | ||||
| 48500 | } | ||||
| 48501 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48501); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48501; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48502 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48503 | |||||
| 48504 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48505 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 48506 | if (!argv.resize(16)) { | ||||
| 48507 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 48508 | // the right thing with that. | ||||
| 48509 | return; | ||||
| 48510 | } | ||||
| 48511 | unsigned argc = 16; | ||||
| 48512 | |||||
| 48513 | do { | ||||
| 48514 | |||||
| 48515 | uint32_t length = arg16.Length(); | ||||
| 48516 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48517 | if (!returnArray) { | ||||
| 48518 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48519 | return; | ||||
| 48520 | } | ||||
| 48521 | // Scope for 'tmp' | ||||
| 48522 | { | ||||
| 48523 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48524 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48525 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48526 | // are different ways to succeed at wrapping the object. | ||||
| 48527 | do { | ||||
| 48528 | if (arg16[sequenceIdx0].IsNull()) { | ||||
| 48529 | tmp.setNull(); | ||||
| 48530 | break; | ||||
| 48531 | } | ||||
| 48532 | tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value()))); | ||||
| 48533 | break; | ||||
| 48534 | } while (false); | ||||
| 48535 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48536 | JSPROP_ENUMERATE)) { | ||||
| 48537 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48538 | return; | ||||
| 48539 | } | ||||
| 48540 | } | ||||
| 48541 | } | ||||
| 48542 | argv[15].setObject(*returnArray); | ||||
| 48543 | break; | ||||
| 48544 | } while (false); | ||||
| 48545 | |||||
| 48546 | do { | ||||
| 48547 | |||||
| 48548 | uint32_t length = arg15.Length(); | ||||
| 48549 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48550 | if (!returnArray) { | ||||
| 48551 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48552 | return; | ||||
| 48553 | } | ||||
| 48554 | // Scope for 'tmp' | ||||
| 48555 | { | ||||
| 48556 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48557 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48558 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48559 | // are different ways to succeed at wrapping the object. | ||||
| 48560 | do { | ||||
| 48561 | if (arg15[sequenceIdx0].IsNull()) { | ||||
| 48562 | tmp.setNull(); | ||||
| 48563 | break; | ||||
| 48564 | } | ||||
| 48565 | tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value()))); | ||||
| 48566 | break; | ||||
| 48567 | } while (false); | ||||
| 48568 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48569 | JSPROP_ENUMERATE)) { | ||||
| 48570 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48571 | return; | ||||
| 48572 | } | ||||
| 48573 | } | ||||
| 48574 | } | ||||
| 48575 | argv[14].setObject(*returnArray); | ||||
| 48576 | break; | ||||
| 48577 | } while (false); | ||||
| 48578 | |||||
| 48579 | do { | ||||
| 48580 | |||||
| 48581 | uint32_t length = arg14.Length(); | ||||
| 48582 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48583 | if (!returnArray) { | ||||
| 48584 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48585 | return; | ||||
| 48586 | } | ||||
| 48587 | // Scope for 'tmp' | ||||
| 48588 | { | ||||
| 48589 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48590 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48591 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48592 | // are different ways to succeed at wrapping the object. | ||||
| 48593 | do { | ||||
| 48594 | tmp.set(JS_NumberValue(double(arg14[sequenceIdx0]))); | ||||
| 48595 | break; | ||||
| 48596 | } while (false); | ||||
| 48597 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48598 | JSPROP_ENUMERATE)) { | ||||
| 48599 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48600 | return; | ||||
| 48601 | } | ||||
| 48602 | } | ||||
| 48603 | } | ||||
| 48604 | argv[13].setObject(*returnArray); | ||||
| 48605 | break; | ||||
| 48606 | } while (false); | ||||
| 48607 | |||||
| 48608 | do { | ||||
| 48609 | |||||
| 48610 | uint32_t length = arg13.Length(); | ||||
| 48611 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48612 | if (!returnArray) { | ||||
| 48613 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48614 | return; | ||||
| 48615 | } | ||||
| 48616 | // Scope for 'tmp' | ||||
| 48617 | { | ||||
| 48618 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48619 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48620 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48621 | // are different ways to succeed at wrapping the object. | ||||
| 48622 | do { | ||||
| 48623 | tmp.set(JS_NumberValue(double(arg13[sequenceIdx0]))); | ||||
| 48624 | break; | ||||
| 48625 | } while (false); | ||||
| 48626 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48627 | JSPROP_ENUMERATE)) { | ||||
| 48628 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48629 | return; | ||||
| 48630 | } | ||||
| 48631 | } | ||||
| 48632 | } | ||||
| 48633 | argv[12].setObject(*returnArray); | ||||
| 48634 | break; | ||||
| 48635 | } while (false); | ||||
| 48636 | |||||
| 48637 | do { | ||||
| 48638 | |||||
| 48639 | uint32_t length = arg12.Length(); | ||||
| 48640 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48641 | if (!returnArray) { | ||||
| 48642 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48643 | return; | ||||
| 48644 | } | ||||
| 48645 | // Scope for 'tmp' | ||||
| 48646 | { | ||||
| 48647 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48648 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48649 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48650 | // are different ways to succeed at wrapping the object. | ||||
| 48651 | do { | ||||
| 48652 | if (arg12[sequenceIdx0].IsNull()) { | ||||
| 48653 | tmp.setNull(); | ||||
| 48654 | break; | ||||
| 48655 | } | ||||
| 48656 | tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value()))); | ||||
| 48657 | break; | ||||
| 48658 | } while (false); | ||||
| 48659 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48660 | JSPROP_ENUMERATE)) { | ||||
| 48661 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48662 | return; | ||||
| 48663 | } | ||||
| 48664 | } | ||||
| 48665 | } | ||||
| 48666 | argv[11].setObject(*returnArray); | ||||
| 48667 | break; | ||||
| 48668 | } while (false); | ||||
| 48669 | |||||
| 48670 | do { | ||||
| 48671 | |||||
| 48672 | uint32_t length = arg11.Length(); | ||||
| 48673 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48674 | if (!returnArray) { | ||||
| 48675 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48676 | return; | ||||
| 48677 | } | ||||
| 48678 | // Scope for 'tmp' | ||||
| 48679 | { | ||||
| 48680 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48681 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48682 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48683 | // are different ways to succeed at wrapping the object. | ||||
| 48684 | do { | ||||
| 48685 | if (arg11[sequenceIdx0].IsNull()) { | ||||
| 48686 | tmp.setNull(); | ||||
| 48687 | break; | ||||
| 48688 | } | ||||
| 48689 | tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value()))); | ||||
| 48690 | break; | ||||
| 48691 | } while (false); | ||||
| 48692 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48693 | JSPROP_ENUMERATE)) { | ||||
| 48694 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48695 | return; | ||||
| 48696 | } | ||||
| 48697 | } | ||||
| 48698 | } | ||||
| 48699 | argv[10].setObject(*returnArray); | ||||
| 48700 | break; | ||||
| 48701 | } while (false); | ||||
| 48702 | |||||
| 48703 | do { | ||||
| 48704 | |||||
| 48705 | uint32_t length = arg10.Length(); | ||||
| 48706 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48707 | if (!returnArray) { | ||||
| 48708 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48709 | return; | ||||
| 48710 | } | ||||
| 48711 | // Scope for 'tmp' | ||||
| 48712 | { | ||||
| 48713 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48714 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48715 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48716 | // are different ways to succeed at wrapping the object. | ||||
| 48717 | do { | ||||
| 48718 | tmp.set(JS_NumberValue(double(arg10[sequenceIdx0]))); | ||||
| 48719 | break; | ||||
| 48720 | } while (false); | ||||
| 48721 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48722 | JSPROP_ENUMERATE)) { | ||||
| 48723 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48724 | return; | ||||
| 48725 | } | ||||
| 48726 | } | ||||
| 48727 | } | ||||
| 48728 | argv[9].setObject(*returnArray); | ||||
| 48729 | break; | ||||
| 48730 | } while (false); | ||||
| 48731 | |||||
| 48732 | do { | ||||
| 48733 | |||||
| 48734 | uint32_t length = arg9.Length(); | ||||
| 48735 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 48736 | if (!returnArray) { | ||||
| 48737 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48738 | return; | ||||
| 48739 | } | ||||
| 48740 | // Scope for 'tmp' | ||||
| 48741 | { | ||||
| 48742 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 48743 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 48744 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 48745 | // are different ways to succeed at wrapping the object. | ||||
| 48746 | do { | ||||
| 48747 | tmp.set(JS_NumberValue(double(arg9[sequenceIdx0]))); | ||||
| 48748 | break; | ||||
| 48749 | } while (false); | ||||
| 48750 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 48751 | JSPROP_ENUMERATE)) { | ||||
| 48752 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48753 | return; | ||||
| 48754 | } | ||||
| 48755 | } | ||||
| 48756 | } | ||||
| 48757 | argv[8].setObject(*returnArray); | ||||
| 48758 | break; | ||||
| 48759 | } while (false); | ||||
| 48760 | |||||
| 48761 | do { | ||||
| 48762 | if (arg8.IsNull()) { | ||||
| 48763 | argv[7].setNull(); | ||||
| 48764 | break; | ||||
| 48765 | } | ||||
| 48766 | argv[7].set(JS_NumberValue(double(arg8.Value()))); | ||||
| 48767 | break; | ||||
| 48768 | } while (false); | ||||
| 48769 | |||||
| 48770 | do { | ||||
| 48771 | if (arg7.IsNull()) { | ||||
| 48772 | argv[6].setNull(); | ||||
| 48773 | break; | ||||
| 48774 | } | ||||
| 48775 | argv[6].set(JS_NumberValue(double(arg7.Value()))); | ||||
| 48776 | break; | ||||
| 48777 | } while (false); | ||||
| 48778 | |||||
| 48779 | do { | ||||
| 48780 | argv[5].set(JS_NumberValue(double(arg6))); | ||||
| 48781 | break; | ||||
| 48782 | } while (false); | ||||
| 48783 | |||||
| 48784 | do { | ||||
| 48785 | argv[4].set(JS_NumberValue(double(arg5))); | ||||
| 48786 | break; | ||||
| 48787 | } while (false); | ||||
| 48788 | |||||
| 48789 | do { | ||||
| 48790 | if (arg4.IsNull()) { | ||||
| 48791 | argv[3].setNull(); | ||||
| 48792 | break; | ||||
| 48793 | } | ||||
| 48794 | argv[3].set(JS_NumberValue(double(arg4.Value()))); | ||||
| 48795 | break; | ||||
| 48796 | } while (false); | ||||
| 48797 | |||||
| 48798 | do { | ||||
| 48799 | if (arg3.IsNull()) { | ||||
| 48800 | argv[2].setNull(); | ||||
| 48801 | break; | ||||
| 48802 | } | ||||
| 48803 | argv[2].set(JS_NumberValue(double(arg3.Value()))); | ||||
| 48804 | break; | ||||
| 48805 | } while (false); | ||||
| 48806 | |||||
| 48807 | do { | ||||
| 48808 | argv[1].set(JS_NumberValue(double(arg2))); | ||||
| 48809 | break; | ||||
| 48810 | } while (false); | ||||
| 48811 | |||||
| 48812 | do { | ||||
| 48813 | argv[0].set(JS_NumberValue(double(arg1))); | ||||
| 48814 | break; | ||||
| 48815 | } while (false); | ||||
| 48816 | |||||
| 48817 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48818 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48819 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48820 | !InitIds(cx, atomsCache)) || | ||||
| 48821 | !GetCallableProperty(cx, atomsCache->passLenientFloat_id, &callable)) { | ||||
| 48822 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48823 | return; | ||||
| 48824 | } | ||||
| 48825 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48826 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48827 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 48828 | aRv.NoteJSContextException(cx); | ||||
| 48829 | return; | ||||
| 48830 | } | ||||
| 48831 | } | ||||
| 48832 | |||||
| 48833 | already_AddRefed<TestJSImplInterface> | ||||
| 48834 | TestJSImplInterfaceJSImpl::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48835 | { | ||||
| 48836 | CallSetup s(this, aRv, "TestJSImplInterface.receiveSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48837 | if (aRv.Failed()) { | ||||
| 48838 | return nullptr; | ||||
| 48839 | } | ||||
| 48840 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48840); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48840; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48841 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48842 | |||||
| 48843 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48844 | |||||
| 48845 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48846 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48847 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48848 | !InitIds(cx, atomsCache)) || | ||||
| 48849 | !GetCallableProperty(cx, atomsCache->receiveSelf_id, &callable)) { | ||||
| 48850 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48851 | return nullptr; | ||||
| 48852 | } | ||||
| 48853 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48854 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48855 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 48856 | aRv.NoteJSContextException(cx); | ||||
| 48857 | return nullptr; | ||||
| 48858 | } | ||||
| 48859 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 48860 | if (rval.isObject()) { | ||||
| 48861 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 48862 | { | ||||
| 48863 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 48864 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 48865 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 48866 | // Be careful to not wrap random DOM objects here, even if | ||||
| 48867 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 48868 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 48869 | // that already has a content reflection... | ||||
| 48870 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 48871 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 48872 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 48873 | if (!callback || | ||||
| 48874 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 48875 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48876 | return nullptr; | ||||
| 48877 | } | ||||
| 48878 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 48879 | 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", 48880); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 48880; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 48880 | "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", 48880); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 48880; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 48881 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 48882 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 48883 | } else { | ||||
| 48884 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveSelf", "TestJSImplInterface"); | ||||
| 48885 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48886 | return nullptr; | ||||
| 48887 | } | ||||
| 48888 | } | ||||
| 48889 | } | ||||
| 48890 | } else { | ||||
| 48891 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveSelf"); | ||||
| 48892 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48893 | return nullptr; | ||||
| 48894 | } | ||||
| 48895 | return rvalDecl.forget(); | ||||
| 48896 | } | ||||
| 48897 | |||||
| 48898 | already_AddRefed<TestJSImplInterface> | ||||
| 48899 | TestJSImplInterfaceJSImpl::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48900 | { | ||||
| 48901 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48902 | if (aRv.Failed()) { | ||||
| 48903 | return nullptr; | ||||
| 48904 | } | ||||
| 48905 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48905); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48905; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48906 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48907 | |||||
| 48908 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48909 | |||||
| 48910 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48911 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48912 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48913 | !InitIds(cx, atomsCache)) || | ||||
| 48914 | !GetCallableProperty(cx, atomsCache->receiveNullableSelf_id, &callable)) { | ||||
| 48915 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48916 | return nullptr; | ||||
| 48917 | } | ||||
| 48918 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48919 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48920 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 48921 | aRv.NoteJSContextException(cx); | ||||
| 48922 | return nullptr; | ||||
| 48923 | } | ||||
| 48924 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 48925 | if (rval.isObject()) { | ||||
| 48926 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 48927 | { | ||||
| 48928 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 48929 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 48930 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 48931 | // Be careful to not wrap random DOM objects here, even if | ||||
| 48932 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 48933 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 48934 | // that already has a content reflection... | ||||
| 48935 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 48936 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 48937 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 48938 | if (!callback || | ||||
| 48939 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 48940 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48941 | return nullptr; | ||||
| 48942 | } | ||||
| 48943 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 48944 | 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", 48945); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 48945; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 48945 | "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", 48945); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 48945; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 48946 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 48947 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 48948 | } else { | ||||
| 48949 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableSelf", "TestJSImplInterface"); | ||||
| 48950 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48951 | return nullptr; | ||||
| 48952 | } | ||||
| 48953 | } | ||||
| 48954 | } | ||||
| 48955 | } else if (rval.isNullOrUndefined()) { | ||||
| 48956 | rvalDecl = nullptr; | ||||
| 48957 | } else { | ||||
| 48958 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableSelf"); | ||||
| 48959 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48960 | return nullptr; | ||||
| 48961 | } | ||||
| 48962 | return rvalDecl.forget(); | ||||
| 48963 | } | ||||
| 48964 | |||||
| 48965 | already_AddRefed<TestJSImplInterface> | ||||
| 48966 | TestJSImplInterfaceJSImpl::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 48967 | { | ||||
| 48968 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 48969 | if (aRv.Failed()) { | ||||
| 48970 | return nullptr; | ||||
| 48971 | } | ||||
| 48972 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 48972); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 48972; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 48973 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 48974 | |||||
| 48975 | JS::Rooted<JS::Value> rval(cx); | ||||
| 48976 | |||||
| 48977 | JS::Rooted<JS::Value> callable(cx); | ||||
| 48978 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 48979 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 48980 | !InitIds(cx, atomsCache)) || | ||||
| 48981 | !GetCallableProperty(cx, atomsCache->receiveWeakSelf_id, &callable)) { | ||||
| 48982 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 48983 | return nullptr; | ||||
| 48984 | } | ||||
| 48985 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 48986 | if (!JS::Call(cx, thisValue, callable, | ||||
| 48987 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 48988 | aRv.NoteJSContextException(cx); | ||||
| 48989 | return nullptr; | ||||
| 48990 | } | ||||
| 48991 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 48992 | if (rval.isObject()) { | ||||
| 48993 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 48994 | { | ||||
| 48995 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 48996 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 48997 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 48998 | // Be careful to not wrap random DOM objects here, even if | ||||
| 48999 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 49000 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 49001 | // that already has a content reflection... | ||||
| 49002 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 49003 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 49004 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 49005 | if (!callback || | ||||
| 49006 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 49007 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49008 | return nullptr; | ||||
| 49009 | } | ||||
| 49010 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 49011 | 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", 49012); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 49012; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 49012 | "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", 49012); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 49012; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 49013 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 49014 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 49015 | } else { | ||||
| 49016 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakSelf", "TestJSImplInterface"); | ||||
| 49017 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49018 | return nullptr; | ||||
| 49019 | } | ||||
| 49020 | } | ||||
| 49021 | } | ||||
| 49022 | } else { | ||||
| 49023 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakSelf"); | ||||
| 49024 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49025 | return nullptr; | ||||
| 49026 | } | ||||
| 49027 | return rvalDecl.forget(); | ||||
| 49028 | } | ||||
| 49029 | |||||
| 49030 | already_AddRefed<TestJSImplInterface> | ||||
| 49031 | TestJSImplInterfaceJSImpl::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49032 | { | ||||
| 49033 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49034 | if (aRv.Failed()) { | ||||
| 49035 | return nullptr; | ||||
| 49036 | } | ||||
| 49037 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49037; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49038 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49039 | |||||
| 49040 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49041 | |||||
| 49042 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49043 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49044 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49045 | !InitIds(cx, atomsCache)) || | ||||
| 49046 | !GetCallableProperty(cx, atomsCache->receiveWeakNullableSelf_id, &callable)) { | ||||
| 49047 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49048 | return nullptr; | ||||
| 49049 | } | ||||
| 49050 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49051 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49052 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49053 | aRv.NoteJSContextException(cx); | ||||
| 49054 | return nullptr; | ||||
| 49055 | } | ||||
| 49056 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 49057 | if (rval.isObject()) { | ||||
| 49058 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 49059 | { | ||||
| 49060 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49061 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 49062 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49063 | // Be careful to not wrap random DOM objects here, even if | ||||
| 49064 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 49065 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 49066 | // that already has a content reflection... | ||||
| 49067 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 49068 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 49069 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 49070 | if (!callback || | ||||
| 49071 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 49072 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49073 | return nullptr; | ||||
| 49074 | } | ||||
| 49075 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 49076 | 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", 49077); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 49077; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 49077 | "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", 49077); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 49077; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 49078 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 49079 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 49080 | } else { | ||||
| 49081 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableSelf", "TestJSImplInterface"); | ||||
| 49082 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49083 | return nullptr; | ||||
| 49084 | } | ||||
| 49085 | } | ||||
| 49086 | } | ||||
| 49087 | } else if (rval.isNullOrUndefined()) { | ||||
| 49088 | rvalDecl = nullptr; | ||||
| 49089 | } else { | ||||
| 49090 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableSelf"); | ||||
| 49091 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49092 | return nullptr; | ||||
| 49093 | } | ||||
| 49094 | return rvalDecl.forget(); | ||||
| 49095 | } | ||||
| 49096 | |||||
| 49097 | void | ||||
| 49098 | TestJSImplInterfaceJSImpl::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49099 | { | ||||
| 49100 | CallSetup s(this, aRv, "TestJSImplInterface.passSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49101 | if (aRv.Failed()) { | ||||
| 49102 | return; | ||||
| 49103 | } | ||||
| 49104 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49104); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49104; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49105 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49106 | |||||
| 49107 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49108 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49109 | if (!argv.resize(1)) { | ||||
| 49110 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49111 | // the right thing with that. | ||||
| 49112 | return; | ||||
| 49113 | } | ||||
| 49114 | unsigned argc = 1; | ||||
| 49115 | |||||
| 49116 | do { | ||||
| 49117 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 49118 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 49118); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 49118; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49119 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49120 | return; | ||||
| 49121 | } | ||||
| 49122 | break; | ||||
| 49123 | } while (false); | ||||
| 49124 | |||||
| 49125 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49126 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49127 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49128 | !InitIds(cx, atomsCache)) || | ||||
| 49129 | !GetCallableProperty(cx, atomsCache->passSelf_id, &callable)) { | ||||
| 49130 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49131 | return; | ||||
| 49132 | } | ||||
| 49133 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49134 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49135 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 49136 | aRv.NoteJSContextException(cx); | ||||
| 49137 | return; | ||||
| 49138 | } | ||||
| 49139 | } | ||||
| 49140 | |||||
| 49141 | void | ||||
| 49142 | TestJSImplInterfaceJSImpl::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49143 | { | ||||
| 49144 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49145 | if (aRv.Failed()) { | ||||
| 49146 | return; | ||||
| 49147 | } | ||||
| 49148 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49148); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49148; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49149 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49150 | |||||
| 49151 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49152 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49153 | if (!argv.resize(1)) { | ||||
| 49154 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49155 | // the right thing with that. | ||||
| 49156 | return; | ||||
| 49157 | } | ||||
| 49158 | unsigned argc = 1; | ||||
| 49159 | |||||
| 49160 | do { | ||||
| 49161 | if (!arg) { | ||||
| 49162 | argv[0].setNull(); | ||||
| 49163 | break; | ||||
| 49164 | } | ||||
| 49165 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 49166 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 49166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 49166; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49167 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49168 | return; | ||||
| 49169 | } | ||||
| 49170 | break; | ||||
| 49171 | } while (false); | ||||
| 49172 | |||||
| 49173 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49174 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49175 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49176 | !InitIds(cx, atomsCache)) || | ||||
| 49177 | !GetCallableProperty(cx, atomsCache->passNullableSelf_id, &callable)) { | ||||
| 49178 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49179 | return; | ||||
| 49180 | } | ||||
| 49181 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49182 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49183 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 49184 | aRv.NoteJSContextException(cx); | ||||
| 49185 | return; | ||||
| 49186 | } | ||||
| 49187 | } | ||||
| 49188 | |||||
| 49189 | void | ||||
| 49190 | TestJSImplInterfaceJSImpl::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49191 | { | ||||
| 49192 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49193 | if (aRv.Failed()) { | ||||
| 49194 | return; | ||||
| 49195 | } | ||||
| 49196 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49196); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49196; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49197 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49198 | |||||
| 49199 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49200 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49201 | if (!argv.resize(1)) { | ||||
| 49202 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49203 | // the right thing with that. | ||||
| 49204 | return; | ||||
| 49205 | } | ||||
| 49206 | unsigned argc = 1; | ||||
| 49207 | |||||
| 49208 | do { | ||||
| 49209 | if (arg.WasPassed()) { | ||||
| 49210 | if (!arg.Value()) { | ||||
| 49211 | argv[0].setNull(); | ||||
| 49212 | break; | ||||
| 49213 | } | ||||
| 49214 | if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) { | ||||
| 49215 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 49215); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 49215; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49216 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49217 | return; | ||||
| 49218 | } | ||||
| 49219 | break; | ||||
| 49220 | } else if (argc == 1) { | ||||
| 49221 | // This is our current trailing argument; reduce argc | ||||
| 49222 | --argc; | ||||
| 49223 | } else { | ||||
| 49224 | argv[0].setUndefined(); | ||||
| 49225 | } | ||||
| 49226 | } while (false); | ||||
| 49227 | |||||
| 49228 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49229 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49230 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49231 | !InitIds(cx, atomsCache)) || | ||||
| 49232 | !GetCallableProperty(cx, atomsCache->passOptionalSelf_id, &callable)) { | ||||
| 49233 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49234 | return; | ||||
| 49235 | } | ||||
| 49236 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49237 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49238 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 49239 | aRv.NoteJSContextException(cx); | ||||
| 49240 | return; | ||||
| 49241 | } | ||||
| 49242 | } | ||||
| 49243 | |||||
| 49244 | void | ||||
| 49245 | TestJSImplInterfaceJSImpl::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49246 | { | ||||
| 49247 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49248 | if (aRv.Failed()) { | ||||
| 49249 | return; | ||||
| 49250 | } | ||||
| 49251 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49251); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49251; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49252 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49253 | |||||
| 49254 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49255 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49256 | if (!argv.resize(1)) { | ||||
| 49257 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49258 | // the right thing with that. | ||||
| 49259 | return; | ||||
| 49260 | } | ||||
| 49261 | unsigned argc = 1; | ||||
| 49262 | |||||
| 49263 | do { | ||||
| 49264 | if (arg.WasPassed()) { | ||||
| 49265 | if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) { | ||||
| 49266 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 49266); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 49266; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49267 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49268 | return; | ||||
| 49269 | } | ||||
| 49270 | break; | ||||
| 49271 | } else if (argc == 1) { | ||||
| 49272 | // This is our current trailing argument; reduce argc | ||||
| 49273 | --argc; | ||||
| 49274 | } else { | ||||
| 49275 | argv[0].setUndefined(); | ||||
| 49276 | } | ||||
| 49277 | } while (false); | ||||
| 49278 | |||||
| 49279 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49280 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49281 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49282 | !InitIds(cx, atomsCache)) || | ||||
| 49283 | !GetCallableProperty(cx, atomsCache->passOptionalNonNullSelf_id, &callable)) { | ||||
| 49284 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49285 | return; | ||||
| 49286 | } | ||||
| 49287 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49288 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49289 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 49290 | aRv.NoteJSContextException(cx); | ||||
| 49291 | return; | ||||
| 49292 | } | ||||
| 49293 | } | ||||
| 49294 | |||||
| 49295 | void | ||||
| 49296 | TestJSImplInterfaceJSImpl::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49297 | { | ||||
| 49298 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelfWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49299 | if (aRv.Failed()) { | ||||
| 49300 | return; | ||||
| 49301 | } | ||||
| 49302 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49302); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49302; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49303 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49304 | |||||
| 49305 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49306 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49307 | if (!argv.resize(1)) { | ||||
| 49308 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49309 | // the right thing with that. | ||||
| 49310 | return; | ||||
| 49311 | } | ||||
| 49312 | unsigned argc = 1; | ||||
| 49313 | |||||
| 49314 | do { | ||||
| 49315 | if (!arg) { | ||||
| 49316 | argv[0].setNull(); | ||||
| 49317 | break; | ||||
| 49318 | } | ||||
| 49319 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 49320 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 49320); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 49320; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49321 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49322 | return; | ||||
| 49323 | } | ||||
| 49324 | break; | ||||
| 49325 | } while (false); | ||||
| 49326 | |||||
| 49327 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49328 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49329 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49330 | !InitIds(cx, atomsCache)) || | ||||
| 49331 | !GetCallableProperty(cx, atomsCache->passOptionalSelfWithDefault_id, &callable)) { | ||||
| 49332 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49333 | return; | ||||
| 49334 | } | ||||
| 49335 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49336 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49337 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 49338 | aRv.NoteJSContextException(cx); | ||||
| 49339 | return; | ||||
| 49340 | } | ||||
| 49341 | } | ||||
| 49342 | |||||
| 49343 | already_AddRefed<TestNonWrapperCacheInterface> | ||||
| 49344 | TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49345 | { | ||||
| 49346 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49347 | if (aRv.Failed()) { | ||||
| 49348 | return nullptr; | ||||
| 49349 | } | ||||
| 49350 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49350); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49350; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49351 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49352 | |||||
| 49353 | JS::Rooted<JS::Value> rval(cx); | ||||
| 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->receiveNonWrapperCacheInterface_id, &callable)) { | ||||
| 49360 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49361 | return nullptr; | ||||
| 49362 | } | ||||
| 49363 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49364 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49365 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49366 | aRv.NoteJSContextException(cx); | ||||
| 49367 | return nullptr; | ||||
| 49368 | } | ||||
| 49369 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl; | ||||
| 49370 | if (rval.isObject()) { | ||||
| 49371 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49372 | { | ||||
| 49373 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49374 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx); | ||||
| 49375 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49376 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface", "TestNonWrapperCacheInterface"); | ||||
| 49377 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49378 | return nullptr; | ||||
| 49379 | } | ||||
| 49380 | } | ||||
| 49381 | } else { | ||||
| 49382 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface"); | ||||
| 49383 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49384 | return nullptr; | ||||
| 49385 | } | ||||
| 49386 | return rvalDecl.forget(); | ||||
| 49387 | } | ||||
| 49388 | |||||
| 49389 | already_AddRefed<TestNonWrapperCacheInterface> | ||||
| 49390 | TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49391 | { | ||||
| 49392 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49393 | if (aRv.Failed()) { | ||||
| 49394 | return nullptr; | ||||
| 49395 | } | ||||
| 49396 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49396); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49396; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49397 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49398 | |||||
| 49399 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49400 | |||||
| 49401 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49402 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49403 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49404 | !InitIds(cx, atomsCache)) || | ||||
| 49405 | !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterface_id, &callable)) { | ||||
| 49406 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49407 | return nullptr; | ||||
| 49408 | } | ||||
| 49409 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49410 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49411 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49412 | aRv.NoteJSContextException(cx); | ||||
| 49413 | return nullptr; | ||||
| 49414 | } | ||||
| 49415 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl; | ||||
| 49416 | if (rval.isObject()) { | ||||
| 49417 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49418 | { | ||||
| 49419 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49420 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx); | ||||
| 49421 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49422 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface", "TestNonWrapperCacheInterface"); | ||||
| 49423 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49424 | return nullptr; | ||||
| 49425 | } | ||||
| 49426 | } | ||||
| 49427 | } else if (rval.isNullOrUndefined()) { | ||||
| 49428 | rvalDecl = nullptr; | ||||
| 49429 | } else { | ||||
| 49430 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface"); | ||||
| 49431 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49432 | return nullptr; | ||||
| 49433 | } | ||||
| 49434 | return rvalDecl.forget(); | ||||
| 49435 | } | ||||
| 49436 | |||||
| 49437 | void | ||||
| 49438 | TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49439 | { | ||||
| 49440 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49441 | if (aRv.Failed()) { | ||||
| 49442 | return; | ||||
| 49443 | } | ||||
| 49444 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49444); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49444; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49445 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49446 | |||||
| 49447 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49448 | |||||
| 49449 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49450 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49451 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49452 | !InitIds(cx, atomsCache)) || | ||||
| 49453 | !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceSequence_id, &callable)) { | ||||
| 49454 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49455 | return; | ||||
| 49456 | } | ||||
| 49457 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49458 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49459 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49460 | aRv.NoteJSContextException(cx); | ||||
| 49461 | return; | ||||
| 49462 | } | ||||
| 49463 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl; | ||||
| 49464 | if (rval.isObject()) { | ||||
| 49465 | JS::ForOfIterator iter(cx); | ||||
| 49466 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 49467 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49468 | return; | ||||
| 49469 | } | ||||
| 49470 | if (!iter.valueIsIterable()) { | ||||
| 49471 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence"); | ||||
| 49472 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49473 | return; | ||||
| 49474 | } | ||||
| 49475 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl; | ||||
| 49476 | JS::Rooted<JS::Value> temp(cx); | ||||
| 49477 | while (true) { | ||||
| 49478 | bool done; | ||||
| 49479 | if (!iter.next(&temp, &done)) { | ||||
| 49480 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49481 | return; | ||||
| 49482 | } | ||||
| 49483 | if (done) { | ||||
| 49484 | break; | ||||
| 49485 | } | ||||
| 49486 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 49487 | if (!slotPtr) { | ||||
| 49488 | JS_ReportOutOfMemory(cx); | ||||
| 49489 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49490 | return; | ||||
| 49491 | } | ||||
| 49492 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr; | ||||
| 49493 | if (temp.isObject()) { | ||||
| 49494 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49495 | { | ||||
| 49496 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49497 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx); | ||||
| 49498 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49499 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface"); | ||||
| 49500 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49501 | return; | ||||
| 49502 | } | ||||
| 49503 | } | ||||
| 49504 | } else { | ||||
| 49505 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence"); | ||||
| 49506 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49507 | return; | ||||
| 49508 | } | ||||
| 49509 | } | ||||
| 49510 | } else { | ||||
| 49511 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence"); | ||||
| 49512 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49513 | return; | ||||
| 49514 | } | ||||
| 49515 | aRetVal = std::move(rvalDecl); | ||||
| 49516 | } | ||||
| 49517 | |||||
| 49518 | void | ||||
| 49519 | TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49520 | { | ||||
| 49521 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49522 | if (aRv.Failed()) { | ||||
| 49523 | return; | ||||
| 49524 | } | ||||
| 49525 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49525); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49525; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49526 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49527 | |||||
| 49528 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49529 | |||||
| 49530 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49531 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49532 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49533 | !InitIds(cx, atomsCache)) || | ||||
| 49534 | !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id, &callable)) { | ||||
| 49535 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49536 | return; | ||||
| 49537 | } | ||||
| 49538 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49539 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49540 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49541 | aRv.NoteJSContextException(cx); | ||||
| 49542 | return; | ||||
| 49543 | } | ||||
| 49544 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl; | ||||
| 49545 | if (rval.isObject()) { | ||||
| 49546 | JS::ForOfIterator iter(cx); | ||||
| 49547 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 49548 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49549 | return; | ||||
| 49550 | } | ||||
| 49551 | if (!iter.valueIsIterable()) { | ||||
| 49552 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence"); | ||||
| 49553 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49554 | return; | ||||
| 49555 | } | ||||
| 49556 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl; | ||||
| 49557 | JS::Rooted<JS::Value> temp(cx); | ||||
| 49558 | while (true) { | ||||
| 49559 | bool done; | ||||
| 49560 | if (!iter.next(&temp, &done)) { | ||||
| 49561 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49562 | return; | ||||
| 49563 | } | ||||
| 49564 | if (done) { | ||||
| 49565 | break; | ||||
| 49566 | } | ||||
| 49567 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 49568 | if (!slotPtr) { | ||||
| 49569 | JS_ReportOutOfMemory(cx); | ||||
| 49570 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49571 | return; | ||||
| 49572 | } | ||||
| 49573 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr; | ||||
| 49574 | if (temp.isObject()) { | ||||
| 49575 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49576 | { | ||||
| 49577 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49578 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx); | ||||
| 49579 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49580 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface"); | ||||
| 49581 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49582 | return; | ||||
| 49583 | } | ||||
| 49584 | } | ||||
| 49585 | } else if (temp.isNullOrUndefined()) { | ||||
| 49586 | slot = nullptr; | ||||
| 49587 | } else { | ||||
| 49588 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence"); | ||||
| 49589 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49590 | return; | ||||
| 49591 | } | ||||
| 49592 | } | ||||
| 49593 | } else { | ||||
| 49594 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence"); | ||||
| 49595 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49596 | return; | ||||
| 49597 | } | ||||
| 49598 | aRetVal = std::move(rvalDecl); | ||||
| 49599 | } | ||||
| 49600 | |||||
| 49601 | void | ||||
| 49602 | TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49603 | { | ||||
| 49604 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49605 | if (aRv.Failed()) { | ||||
| 49606 | return; | ||||
| 49607 | } | ||||
| 49608 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49608); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49608; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49609 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49610 | |||||
| 49611 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49612 | |||||
| 49613 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49614 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49615 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49616 | !InitIds(cx, atomsCache)) || | ||||
| 49617 | !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id, &callable)) { | ||||
| 49618 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49619 | return; | ||||
| 49620 | } | ||||
| 49621 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49622 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49623 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49624 | aRv.NoteJSContextException(cx); | ||||
| 49625 | return; | ||||
| 49626 | } | ||||
| 49627 | Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl; | ||||
| 49628 | if (rval.isObject()) { | ||||
| 49629 | JS::ForOfIterator iter(cx); | ||||
| 49630 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 49631 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49632 | return; | ||||
| 49633 | } | ||||
| 49634 | if (!iter.valueIsIterable()) { | ||||
| 49635 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence"); | ||||
| 49636 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49637 | return; | ||||
| 49638 | } | ||||
| 49639 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue(); | ||||
| 49640 | JS::Rooted<JS::Value> temp(cx); | ||||
| 49641 | while (true) { | ||||
| 49642 | bool done; | ||||
| 49643 | if (!iter.next(&temp, &done)) { | ||||
| 49644 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49645 | return; | ||||
| 49646 | } | ||||
| 49647 | if (done) { | ||||
| 49648 | break; | ||||
| 49649 | } | ||||
| 49650 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 49651 | if (!slotPtr) { | ||||
| 49652 | JS_ReportOutOfMemory(cx); | ||||
| 49653 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49654 | return; | ||||
| 49655 | } | ||||
| 49656 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr; | ||||
| 49657 | if (temp.isObject()) { | ||||
| 49658 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49659 | { | ||||
| 49660 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49661 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx); | ||||
| 49662 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49663 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface"); | ||||
| 49664 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49665 | return; | ||||
| 49666 | } | ||||
| 49667 | } | ||||
| 49668 | } else { | ||||
| 49669 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence"); | ||||
| 49670 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49671 | return; | ||||
| 49672 | } | ||||
| 49673 | } | ||||
| 49674 | } else if (rval.isNullOrUndefined()) { | ||||
| 49675 | rvalDecl.SetNull(); | ||||
| 49676 | } else { | ||||
| 49677 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence"); | ||||
| 49678 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49679 | return; | ||||
| 49680 | } | ||||
| 49681 | if (rvalDecl.IsNull()) { | ||||
| 49682 | aRetVal.SetNull(); | ||||
| 49683 | } else { | ||||
| 49684 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 49685 | } | ||||
| 49686 | } | ||||
| 49687 | |||||
| 49688 | void | ||||
| 49689 | TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49690 | { | ||||
| 49691 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49692 | if (aRv.Failed()) { | ||||
| 49693 | return; | ||||
| 49694 | } | ||||
| 49695 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49695); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49695; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49696 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49697 | |||||
| 49698 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49699 | |||||
| 49700 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49701 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49702 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49703 | !InitIds(cx, atomsCache)) || | ||||
| 49704 | !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id, &callable)) { | ||||
| 49705 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49706 | return; | ||||
| 49707 | } | ||||
| 49708 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49709 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49710 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49711 | aRv.NoteJSContextException(cx); | ||||
| 49712 | return; | ||||
| 49713 | } | ||||
| 49714 | Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl; | ||||
| 49715 | if (rval.isObject()) { | ||||
| 49716 | JS::ForOfIterator iter(cx); | ||||
| 49717 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 49718 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49719 | return; | ||||
| 49720 | } | ||||
| 49721 | if (!iter.valueIsIterable()) { | ||||
| 49722 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence"); | ||||
| 49723 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49724 | return; | ||||
| 49725 | } | ||||
| 49726 | Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue(); | ||||
| 49727 | JS::Rooted<JS::Value> temp(cx); | ||||
| 49728 | while (true) { | ||||
| 49729 | bool done; | ||||
| 49730 | if (!iter.next(&temp, &done)) { | ||||
| 49731 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49732 | return; | ||||
| 49733 | } | ||||
| 49734 | if (done) { | ||||
| 49735 | break; | ||||
| 49736 | } | ||||
| 49737 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 49738 | if (!slotPtr) { | ||||
| 49739 | JS_ReportOutOfMemory(cx); | ||||
| 49740 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49741 | return; | ||||
| 49742 | } | ||||
| 49743 | RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr; | ||||
| 49744 | if (temp.isObject()) { | ||||
| 49745 | static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes."); | ||||
| 49746 | { | ||||
| 49747 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 49748 | nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx); | ||||
| 49749 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 49750 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface"); | ||||
| 49751 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49752 | return; | ||||
| 49753 | } | ||||
| 49754 | } | ||||
| 49755 | } else if (temp.isNullOrUndefined()) { | ||||
| 49756 | slot = nullptr; | ||||
| 49757 | } else { | ||||
| 49758 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence"); | ||||
| 49759 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49760 | return; | ||||
| 49761 | } | ||||
| 49762 | } | ||||
| 49763 | } else if (rval.isNullOrUndefined()) { | ||||
| 49764 | rvalDecl.SetNull(); | ||||
| 49765 | } else { | ||||
| 49766 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence"); | ||||
| 49767 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49768 | return; | ||||
| 49769 | } | ||||
| 49770 | if (rvalDecl.IsNull()) { | ||||
| 49771 | aRetVal.SetNull(); | ||||
| 49772 | } else { | ||||
| 49773 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 49774 | } | ||||
| 49775 | } | ||||
| 49776 | |||||
| 49777 | already_AddRefed<TestExternalInterface> | ||||
| 49778 | TestJSImplInterfaceJSImpl::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49779 | { | ||||
| 49780 | CallSetup s(this, aRv, "TestJSImplInterface.receiveExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49781 | if (aRv.Failed()) { | ||||
| 49782 | return nullptr; | ||||
| 49783 | } | ||||
| 49784 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49784); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49784; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49785 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49786 | |||||
| 49787 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49788 | |||||
| 49789 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49790 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49791 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49792 | !InitIds(cx, atomsCache)) || | ||||
| 49793 | !GetCallableProperty(cx, atomsCache->receiveExternal_id, &callable)) { | ||||
| 49794 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49795 | return nullptr; | ||||
| 49796 | } | ||||
| 49797 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49798 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49799 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49800 | aRv.NoteJSContextException(cx); | ||||
| 49801 | return nullptr; | ||||
| 49802 | } | ||||
| 49803 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 49804 | if (rval.isObject()) { | ||||
| 49805 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 49806 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 49807 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 49808 | 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)))) { | ||||
| 49809 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveExternal", "TestExternalInterface"); | ||||
| 49810 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49811 | return nullptr; | ||||
| 49812 | } | ||||
| 49813 | 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" , 49813); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 49813; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49814 | rvalDecl = rvalHolder; | ||||
| 49815 | } else { | ||||
| 49816 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveExternal"); | ||||
| 49817 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49818 | return nullptr; | ||||
| 49819 | } | ||||
| 49820 | return rvalDecl.forget(); | ||||
| 49821 | } | ||||
| 49822 | |||||
| 49823 | already_AddRefed<TestExternalInterface> | ||||
| 49824 | TestJSImplInterfaceJSImpl::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49825 | { | ||||
| 49826 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49827 | if (aRv.Failed()) { | ||||
| 49828 | return nullptr; | ||||
| 49829 | } | ||||
| 49830 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49830); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49830; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49831 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49832 | |||||
| 49833 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49834 | |||||
| 49835 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49836 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49837 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49838 | !InitIds(cx, atomsCache)) || | ||||
| 49839 | !GetCallableProperty(cx, atomsCache->receiveNullableExternal_id, &callable)) { | ||||
| 49840 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49841 | return nullptr; | ||||
| 49842 | } | ||||
| 49843 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49844 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49845 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49846 | aRv.NoteJSContextException(cx); | ||||
| 49847 | return nullptr; | ||||
| 49848 | } | ||||
| 49849 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 49850 | if (rval.isObject()) { | ||||
| 49851 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 49852 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 49853 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 49854 | 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)))) { | ||||
| 49855 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableExternal", "TestExternalInterface"); | ||||
| 49856 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49857 | return nullptr; | ||||
| 49858 | } | ||||
| 49859 | 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" , 49859); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 49859; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49860 | rvalDecl = rvalHolder; | ||||
| 49861 | } else if (rval.isNullOrUndefined()) { | ||||
| 49862 | rvalDecl = nullptr; | ||||
| 49863 | } else { | ||||
| 49864 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableExternal"); | ||||
| 49865 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49866 | return nullptr; | ||||
| 49867 | } | ||||
| 49868 | return rvalDecl.forget(); | ||||
| 49869 | } | ||||
| 49870 | |||||
| 49871 | already_AddRefed<TestExternalInterface> | ||||
| 49872 | TestJSImplInterfaceJSImpl::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49873 | { | ||||
| 49874 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49875 | if (aRv.Failed()) { | ||||
| 49876 | return nullptr; | ||||
| 49877 | } | ||||
| 49878 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49878); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49878; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49879 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49880 | |||||
| 49881 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49882 | |||||
| 49883 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49884 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49885 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49886 | !InitIds(cx, atomsCache)) || | ||||
| 49887 | !GetCallableProperty(cx, atomsCache->receiveWeakExternal_id, &callable)) { | ||||
| 49888 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49889 | return nullptr; | ||||
| 49890 | } | ||||
| 49891 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49892 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49893 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49894 | aRv.NoteJSContextException(cx); | ||||
| 49895 | return nullptr; | ||||
| 49896 | } | ||||
| 49897 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 49898 | if (rval.isObject()) { | ||||
| 49899 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 49900 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 49901 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 49902 | 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)))) { | ||||
| 49903 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakExternal", "TestExternalInterface"); | ||||
| 49904 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49905 | return nullptr; | ||||
| 49906 | } | ||||
| 49907 | 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" , 49907); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 49907; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49908 | rvalDecl = rvalHolder; | ||||
| 49909 | } else { | ||||
| 49910 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakExternal"); | ||||
| 49911 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49912 | return nullptr; | ||||
| 49913 | } | ||||
| 49914 | return rvalDecl.forget(); | ||||
| 49915 | } | ||||
| 49916 | |||||
| 49917 | already_AddRefed<TestExternalInterface> | ||||
| 49918 | TestJSImplInterfaceJSImpl::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49919 | { | ||||
| 49920 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49921 | if (aRv.Failed()) { | ||||
| 49922 | return nullptr; | ||||
| 49923 | } | ||||
| 49924 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49924); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49924; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49925 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49926 | |||||
| 49927 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49928 | |||||
| 49929 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49930 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49931 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49932 | !InitIds(cx, atomsCache)) || | ||||
| 49933 | !GetCallableProperty(cx, atomsCache->receiveWeakNullableExternal_id, &callable)) { | ||||
| 49934 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49935 | return nullptr; | ||||
| 49936 | } | ||||
| 49937 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 49938 | if (!JS::Call(cx, thisValue, callable, | ||||
| 49939 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 49940 | aRv.NoteJSContextException(cx); | ||||
| 49941 | return nullptr; | ||||
| 49942 | } | ||||
| 49943 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 49944 | if (rval.isObject()) { | ||||
| 49945 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 49946 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 49947 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 49948 | 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)))) { | ||||
| 49949 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableExternal", "TestExternalInterface"); | ||||
| 49950 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49951 | return nullptr; | ||||
| 49952 | } | ||||
| 49953 | 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" , 49953); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 49953; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49954 | rvalDecl = rvalHolder; | ||||
| 49955 | } else if (rval.isNullOrUndefined()) { | ||||
| 49956 | rvalDecl = nullptr; | ||||
| 49957 | } else { | ||||
| 49958 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableExternal"); | ||||
| 49959 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49960 | return nullptr; | ||||
| 49961 | } | ||||
| 49962 | return rvalDecl.forget(); | ||||
| 49963 | } | ||||
| 49964 | |||||
| 49965 | void | ||||
| 49966 | TestJSImplInterfaceJSImpl::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 49967 | { | ||||
| 49968 | CallSetup s(this, aRv, "TestJSImplInterface.passExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 49969 | if (aRv.Failed()) { | ||||
| 49970 | return; | ||||
| 49971 | } | ||||
| 49972 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 49972); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 49972; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 49973 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 49974 | |||||
| 49975 | JS::Rooted<JS::Value> rval(cx); | ||||
| 49976 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 49977 | if (!argv.resize(1)) { | ||||
| 49978 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 49979 | // the right thing with that. | ||||
| 49980 | return; | ||||
| 49981 | } | ||||
| 49982 | unsigned argc = 1; | ||||
| 49983 | |||||
| 49984 | do { | ||||
| 49985 | if (!WrapObject(cx, arg, argv[0])) { | ||||
| 49986 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49987 | return; | ||||
| 49988 | } | ||||
| 49989 | break; | ||||
| 49990 | } while (false); | ||||
| 49991 | |||||
| 49992 | JS::Rooted<JS::Value> callable(cx); | ||||
| 49993 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 49994 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 49995 | !InitIds(cx, atomsCache)) || | ||||
| 49996 | !GetCallableProperty(cx, atomsCache->passExternal_id, &callable)) { | ||||
| 49997 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 49998 | return; | ||||
| 49999 | } | ||||
| 50000 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50001 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50002 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50003 | aRv.NoteJSContextException(cx); | ||||
| 50004 | return; | ||||
| 50005 | } | ||||
| 50006 | } | ||||
| 50007 | |||||
| 50008 | void | ||||
| 50009 | TestJSImplInterfaceJSImpl::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50010 | { | ||||
| 50011 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50012 | if (aRv.Failed()) { | ||||
| 50013 | return; | ||||
| 50014 | } | ||||
| 50015 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50015); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50015; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50016 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50017 | |||||
| 50018 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50019 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50020 | if (!argv.resize(1)) { | ||||
| 50021 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50022 | // the right thing with that. | ||||
| 50023 | return; | ||||
| 50024 | } | ||||
| 50025 | unsigned argc = 1; | ||||
| 50026 | |||||
| 50027 | do { | ||||
| 50028 | if (!arg) { | ||||
| 50029 | argv[0].setNull(); | ||||
| 50030 | break; | ||||
| 50031 | } | ||||
| 50032 | if (!WrapObject(cx, arg, argv[0])) { | ||||
| 50033 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50034 | return; | ||||
| 50035 | } | ||||
| 50036 | break; | ||||
| 50037 | } while (false); | ||||
| 50038 | |||||
| 50039 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50040 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50041 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50042 | !InitIds(cx, atomsCache)) || | ||||
| 50043 | !GetCallableProperty(cx, atomsCache->passNullableExternal_id, &callable)) { | ||||
| 50044 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50045 | return; | ||||
| 50046 | } | ||||
| 50047 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50048 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50049 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50050 | aRv.NoteJSContextException(cx); | ||||
| 50051 | return; | ||||
| 50052 | } | ||||
| 50053 | } | ||||
| 50054 | |||||
| 50055 | void | ||||
| 50056 | TestJSImplInterfaceJSImpl::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50057 | { | ||||
| 50058 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50059 | if (aRv.Failed()) { | ||||
| 50060 | return; | ||||
| 50061 | } | ||||
| 50062 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50062); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50062; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50063 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50064 | |||||
| 50065 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50066 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50067 | if (!argv.resize(1)) { | ||||
| 50068 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50069 | // the right thing with that. | ||||
| 50070 | return; | ||||
| 50071 | } | ||||
| 50072 | unsigned argc = 1; | ||||
| 50073 | |||||
| 50074 | do { | ||||
| 50075 | if (arg.WasPassed()) { | ||||
| 50076 | if (!arg.Value()) { | ||||
| 50077 | argv[0].setNull(); | ||||
| 50078 | break; | ||||
| 50079 | } | ||||
| 50080 | if (!WrapObject(cx, arg.Value(), argv[0])) { | ||||
| 50081 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50082 | return; | ||||
| 50083 | } | ||||
| 50084 | break; | ||||
| 50085 | } else if (argc == 1) { | ||||
| 50086 | // This is our current trailing argument; reduce argc | ||||
| 50087 | --argc; | ||||
| 50088 | } else { | ||||
| 50089 | argv[0].setUndefined(); | ||||
| 50090 | } | ||||
| 50091 | } while (false); | ||||
| 50092 | |||||
| 50093 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50094 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50095 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50096 | !InitIds(cx, atomsCache)) || | ||||
| 50097 | !GetCallableProperty(cx, atomsCache->passOptionalExternal_id, &callable)) { | ||||
| 50098 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50099 | return; | ||||
| 50100 | } | ||||
| 50101 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50102 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50103 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50104 | aRv.NoteJSContextException(cx); | ||||
| 50105 | return; | ||||
| 50106 | } | ||||
| 50107 | } | ||||
| 50108 | |||||
| 50109 | void | ||||
| 50110 | TestJSImplInterfaceJSImpl::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50111 | { | ||||
| 50112 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50113 | if (aRv.Failed()) { | ||||
| 50114 | return; | ||||
| 50115 | } | ||||
| 50116 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50116; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50117 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50118 | |||||
| 50119 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50120 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50121 | if (!argv.resize(1)) { | ||||
| 50122 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50123 | // the right thing with that. | ||||
| 50124 | return; | ||||
| 50125 | } | ||||
| 50126 | unsigned argc = 1; | ||||
| 50127 | |||||
| 50128 | do { | ||||
| 50129 | if (arg.WasPassed()) { | ||||
| 50130 | if (!WrapObject(cx, arg.Value(), argv[0])) { | ||||
| 50131 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50132 | return; | ||||
| 50133 | } | ||||
| 50134 | break; | ||||
| 50135 | } else if (argc == 1) { | ||||
| 50136 | // This is our current trailing argument; reduce argc | ||||
| 50137 | --argc; | ||||
| 50138 | } else { | ||||
| 50139 | argv[0].setUndefined(); | ||||
| 50140 | } | ||||
| 50141 | } while (false); | ||||
| 50142 | |||||
| 50143 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50144 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50145 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50146 | !InitIds(cx, atomsCache)) || | ||||
| 50147 | !GetCallableProperty(cx, atomsCache->passOptionalNonNullExternal_id, &callable)) { | ||||
| 50148 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50149 | return; | ||||
| 50150 | } | ||||
| 50151 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50152 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50153 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50154 | aRv.NoteJSContextException(cx); | ||||
| 50155 | return; | ||||
| 50156 | } | ||||
| 50157 | } | ||||
| 50158 | |||||
| 50159 | void | ||||
| 50160 | TestJSImplInterfaceJSImpl::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50161 | { | ||||
| 50162 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternalWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50163 | if (aRv.Failed()) { | ||||
| 50164 | return; | ||||
| 50165 | } | ||||
| 50166 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50166; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50167 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50168 | |||||
| 50169 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50170 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50171 | if (!argv.resize(1)) { | ||||
| 50172 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50173 | // the right thing with that. | ||||
| 50174 | return; | ||||
| 50175 | } | ||||
| 50176 | unsigned argc = 1; | ||||
| 50177 | |||||
| 50178 | do { | ||||
| 50179 | if (!arg) { | ||||
| 50180 | argv[0].setNull(); | ||||
| 50181 | break; | ||||
| 50182 | } | ||||
| 50183 | if (!WrapObject(cx, arg, argv[0])) { | ||||
| 50184 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50185 | return; | ||||
| 50186 | } | ||||
| 50187 | break; | ||||
| 50188 | } while (false); | ||||
| 50189 | |||||
| 50190 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50191 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50192 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50193 | !InitIds(cx, atomsCache)) || | ||||
| 50194 | !GetCallableProperty(cx, atomsCache->passOptionalExternalWithDefault_id, &callable)) { | ||||
| 50195 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50196 | return; | ||||
| 50197 | } | ||||
| 50198 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50199 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50200 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50201 | aRv.NoteJSContextException(cx); | ||||
| 50202 | return; | ||||
| 50203 | } | ||||
| 50204 | } | ||||
| 50205 | |||||
| 50206 | already_AddRefed<TestCallbackInterface> | ||||
| 50207 | TestJSImplInterfaceJSImpl::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50208 | { | ||||
| 50209 | CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50210 | if (aRv.Failed()) { | ||||
| 50211 | return nullptr; | ||||
| 50212 | } | ||||
| 50213 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50213); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50213; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50214 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50215 | |||||
| 50216 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50217 | |||||
| 50218 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50219 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50220 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50221 | !InitIds(cx, atomsCache)) || | ||||
| 50222 | !GetCallableProperty(cx, atomsCache->receiveCallbackInterface_id, &callable)) { | ||||
| 50223 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50224 | return nullptr; | ||||
| 50225 | } | ||||
| 50226 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50227 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50228 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50229 | aRv.NoteJSContextException(cx); | ||||
| 50230 | return nullptr; | ||||
| 50231 | } | ||||
| 50232 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 50233 | if (rval.isObject()) { | ||||
| 50234 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 50235 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 50236 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 50237 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 50238 | } | ||||
| 50239 | } else { | ||||
| 50240 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallbackInterface"); | ||||
| 50241 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50242 | return nullptr; | ||||
| 50243 | } | ||||
| 50244 | return rvalDecl.forget(); | ||||
| 50245 | } | ||||
| 50246 | |||||
| 50247 | already_AddRefed<TestCallbackInterface> | ||||
| 50248 | TestJSImplInterfaceJSImpl::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50249 | { | ||||
| 50250 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50251 | if (aRv.Failed()) { | ||||
| 50252 | return nullptr; | ||||
| 50253 | } | ||||
| 50254 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50254); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50254; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50255 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50256 | |||||
| 50257 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50258 | |||||
| 50259 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50260 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50261 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50262 | !InitIds(cx, atomsCache)) || | ||||
| 50263 | !GetCallableProperty(cx, atomsCache->receiveNullableCallbackInterface_id, &callable)) { | ||||
| 50264 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50265 | return nullptr; | ||||
| 50266 | } | ||||
| 50267 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50268 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50269 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50270 | aRv.NoteJSContextException(cx); | ||||
| 50271 | return nullptr; | ||||
| 50272 | } | ||||
| 50273 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 50274 | if (rval.isObject()) { | ||||
| 50275 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 50276 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 50277 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 50278 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 50279 | } | ||||
| 50280 | } else if (rval.isNullOrUndefined()) { | ||||
| 50281 | rvalDecl = nullptr; | ||||
| 50282 | } else { | ||||
| 50283 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallbackInterface"); | ||||
| 50284 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50285 | return nullptr; | ||||
| 50286 | } | ||||
| 50287 | return rvalDecl.forget(); | ||||
| 50288 | } | ||||
| 50289 | |||||
| 50290 | already_AddRefed<TestCallbackInterface> | ||||
| 50291 | TestJSImplInterfaceJSImpl::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50292 | { | ||||
| 50293 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50294 | if (aRv.Failed()) { | ||||
| 50295 | return nullptr; | ||||
| 50296 | } | ||||
| 50297 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50297); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50297; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50298 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50299 | |||||
| 50300 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50301 | |||||
| 50302 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50303 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50304 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50305 | !InitIds(cx, atomsCache)) || | ||||
| 50306 | !GetCallableProperty(cx, atomsCache->receiveWeakCallbackInterface_id, &callable)) { | ||||
| 50307 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50308 | return nullptr; | ||||
| 50309 | } | ||||
| 50310 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50311 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50312 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50313 | aRv.NoteJSContextException(cx); | ||||
| 50314 | return nullptr; | ||||
| 50315 | } | ||||
| 50316 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 50317 | if (rval.isObject()) { | ||||
| 50318 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 50319 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 50320 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 50321 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 50322 | } | ||||
| 50323 | } else { | ||||
| 50324 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakCallbackInterface"); | ||||
| 50325 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50326 | return nullptr; | ||||
| 50327 | } | ||||
| 50328 | return rvalDecl.forget(); | ||||
| 50329 | } | ||||
| 50330 | |||||
| 50331 | already_AddRefed<TestCallbackInterface> | ||||
| 50332 | TestJSImplInterfaceJSImpl::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50333 | { | ||||
| 50334 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50335 | if (aRv.Failed()) { | ||||
| 50336 | return nullptr; | ||||
| 50337 | } | ||||
| 50338 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50338); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50338; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50339 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50340 | |||||
| 50341 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50342 | |||||
| 50343 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50344 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50345 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50346 | !InitIds(cx, atomsCache)) || | ||||
| 50347 | !GetCallableProperty(cx, atomsCache->receiveWeakNullableCallbackInterface_id, &callable)) { | ||||
| 50348 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50349 | return nullptr; | ||||
| 50350 | } | ||||
| 50351 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50352 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50353 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50354 | aRv.NoteJSContextException(cx); | ||||
| 50355 | return nullptr; | ||||
| 50356 | } | ||||
| 50357 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 50358 | if (rval.isObject()) { | ||||
| 50359 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 50360 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 50361 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 50362 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 50363 | } | ||||
| 50364 | } else if (rval.isNullOrUndefined()) { | ||||
| 50365 | rvalDecl = nullptr; | ||||
| 50366 | } else { | ||||
| 50367 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableCallbackInterface"); | ||||
| 50368 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50369 | return nullptr; | ||||
| 50370 | } | ||||
| 50371 | return rvalDecl.forget(); | ||||
| 50372 | } | ||||
| 50373 | |||||
| 50374 | void | ||||
| 50375 | TestJSImplInterfaceJSImpl::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50376 | { | ||||
| 50377 | CallSetup s(this, aRv, "TestJSImplInterface.passCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50378 | if (aRv.Failed()) { | ||||
| 50379 | return; | ||||
| 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 { *((volatile int *)__null) = 50381; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50382 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50383 | |||||
| 50384 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50385 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50386 | if (!argv.resize(1)) { | ||||
| 50387 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50388 | // the right thing with that. | ||||
| 50389 | return; | ||||
| 50390 | } | ||||
| 50391 | unsigned argc = 1; | ||||
| 50392 | |||||
| 50393 | do { | ||||
| 50394 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 50395 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 50396 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50397 | return; | ||||
| 50398 | } | ||||
| 50399 | break; | ||||
| 50400 | } while (false); | ||||
| 50401 | |||||
| 50402 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50403 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50404 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50405 | !InitIds(cx, atomsCache)) || | ||||
| 50406 | !GetCallableProperty(cx, atomsCache->passCallbackInterface_id, &callable)) { | ||||
| 50407 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50408 | return; | ||||
| 50409 | } | ||||
| 50410 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50411 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50412 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50413 | aRv.NoteJSContextException(cx); | ||||
| 50414 | return; | ||||
| 50415 | } | ||||
| 50416 | } | ||||
| 50417 | |||||
| 50418 | void | ||||
| 50419 | TestJSImplInterfaceJSImpl::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50420 | { | ||||
| 50421 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50422 | if (aRv.Failed()) { | ||||
| 50423 | return; | ||||
| 50424 | } | ||||
| 50425 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50425); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50425; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50426 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50427 | |||||
| 50428 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50429 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50430 | if (!argv.resize(1)) { | ||||
| 50431 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50432 | // the right thing with that. | ||||
| 50433 | return; | ||||
| 50434 | } | ||||
| 50435 | unsigned argc = 1; | ||||
| 50436 | |||||
| 50437 | do { | ||||
| 50438 | if (arg) { | ||||
| 50439 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 50440 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 50441 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50442 | return; | ||||
| 50443 | } | ||||
| 50444 | break; | ||||
| 50445 | } else { | ||||
| 50446 | argv[0].setNull(); | ||||
| 50447 | break; | ||||
| 50448 | } | ||||
| 50449 | } while (false); | ||||
| 50450 | |||||
| 50451 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50452 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50453 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50454 | !InitIds(cx, atomsCache)) || | ||||
| 50455 | !GetCallableProperty(cx, atomsCache->passNullableCallbackInterface_id, &callable)) { | ||||
| 50456 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50457 | return; | ||||
| 50458 | } | ||||
| 50459 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50460 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50461 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50462 | aRv.NoteJSContextException(cx); | ||||
| 50463 | return; | ||||
| 50464 | } | ||||
| 50465 | } | ||||
| 50466 | |||||
| 50467 | void | ||||
| 50468 | TestJSImplInterfaceJSImpl::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50469 | { | ||||
| 50470 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50471 | if (aRv.Failed()) { | ||||
| 50472 | return; | ||||
| 50473 | } | ||||
| 50474 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50474); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50474; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50475 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50476 | |||||
| 50477 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50478 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50479 | if (!argv.resize(1)) { | ||||
| 50480 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50481 | // the right thing with that. | ||||
| 50482 | return; | ||||
| 50483 | } | ||||
| 50484 | unsigned argc = 1; | ||||
| 50485 | |||||
| 50486 | do { | ||||
| 50487 | if (arg.WasPassed()) { | ||||
| 50488 | if (arg.Value()) { | ||||
| 50489 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value())); | ||||
| 50490 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 50491 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50492 | return; | ||||
| 50493 | } | ||||
| 50494 | break; | ||||
| 50495 | } else { | ||||
| 50496 | argv[0].setNull(); | ||||
| 50497 | break; | ||||
| 50498 | } | ||||
| 50499 | } else if (argc == 1) { | ||||
| 50500 | // This is our current trailing argument; reduce argc | ||||
| 50501 | --argc; | ||||
| 50502 | } else { | ||||
| 50503 | argv[0].setUndefined(); | ||||
| 50504 | } | ||||
| 50505 | } while (false); | ||||
| 50506 | |||||
| 50507 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50508 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50509 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50510 | !InitIds(cx, atomsCache)) || | ||||
| 50511 | !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterface_id, &callable)) { | ||||
| 50512 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50513 | return; | ||||
| 50514 | } | ||||
| 50515 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50516 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50517 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50518 | aRv.NoteJSContextException(cx); | ||||
| 50519 | return; | ||||
| 50520 | } | ||||
| 50521 | } | ||||
| 50522 | |||||
| 50523 | void | ||||
| 50524 | TestJSImplInterfaceJSImpl::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50525 | { | ||||
| 50526 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50527 | if (aRv.Failed()) { | ||||
| 50528 | return; | ||||
| 50529 | } | ||||
| 50530 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50530); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50530; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50531 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50532 | |||||
| 50533 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50534 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50535 | if (!argv.resize(1)) { | ||||
| 50536 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50537 | // the right thing with that. | ||||
| 50538 | return; | ||||
| 50539 | } | ||||
| 50540 | unsigned argc = 1; | ||||
| 50541 | |||||
| 50542 | do { | ||||
| 50543 | if (arg.WasPassed()) { | ||||
| 50544 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value())); | ||||
| 50545 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 50546 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50547 | return; | ||||
| 50548 | } | ||||
| 50549 | break; | ||||
| 50550 | } else if (argc == 1) { | ||||
| 50551 | // This is our current trailing argument; reduce argc | ||||
| 50552 | --argc; | ||||
| 50553 | } else { | ||||
| 50554 | argv[0].setUndefined(); | ||||
| 50555 | } | ||||
| 50556 | } while (false); | ||||
| 50557 | |||||
| 50558 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50559 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50560 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50561 | !InitIds(cx, atomsCache)) || | ||||
| 50562 | !GetCallableProperty(cx, atomsCache->passOptionalNonNullCallbackInterface_id, &callable)) { | ||||
| 50563 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50564 | return; | ||||
| 50565 | } | ||||
| 50566 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50567 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50568 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50569 | aRv.NoteJSContextException(cx); | ||||
| 50570 | return; | ||||
| 50571 | } | ||||
| 50572 | } | ||||
| 50573 | |||||
| 50574 | void | ||||
| 50575 | TestJSImplInterfaceJSImpl::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50576 | { | ||||
| 50577 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50578 | if (aRv.Failed()) { | ||||
| 50579 | return; | ||||
| 50580 | } | ||||
| 50581 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50581); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50581; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50582 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50583 | |||||
| 50584 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50585 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50586 | if (!argv.resize(1)) { | ||||
| 50587 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50588 | // the right thing with that. | ||||
| 50589 | return; | ||||
| 50590 | } | ||||
| 50591 | unsigned argc = 1; | ||||
| 50592 | |||||
| 50593 | do { | ||||
| 50594 | if (arg) { | ||||
| 50595 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 50596 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 50597 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50598 | return; | ||||
| 50599 | } | ||||
| 50600 | break; | ||||
| 50601 | } else { | ||||
| 50602 | argv[0].setNull(); | ||||
| 50603 | break; | ||||
| 50604 | } | ||||
| 50605 | } while (false); | ||||
| 50606 | |||||
| 50607 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50608 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50609 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50610 | !InitIds(cx, atomsCache)) || | ||||
| 50611 | !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterfaceWithDefault_id, &callable)) { | ||||
| 50612 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50613 | return; | ||||
| 50614 | } | ||||
| 50615 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50616 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50617 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50618 | aRv.NoteJSContextException(cx); | ||||
| 50619 | return; | ||||
| 50620 | } | ||||
| 50621 | } | ||||
| 50622 | |||||
| 50623 | void | ||||
| 50624 | TestJSImplInterfaceJSImpl::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50625 | { | ||||
| 50626 | CallSetup s(this, aRv, "TestJSImplInterface.receiveSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50627 | if (aRv.Failed()) { | ||||
| 50628 | return; | ||||
| 50629 | } | ||||
| 50630 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50630); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50630; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50631 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50632 | |||||
| 50633 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50634 | |||||
| 50635 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50636 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50637 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50638 | !InitIds(cx, atomsCache)) || | ||||
| 50639 | !GetCallableProperty(cx, atomsCache->receiveSequence_id, &callable)) { | ||||
| 50640 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50641 | return; | ||||
| 50642 | } | ||||
| 50643 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50644 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50645 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50646 | aRv.NoteJSContextException(cx); | ||||
| 50647 | return; | ||||
| 50648 | } | ||||
| 50649 | Sequence<int32_t> rvalDecl; | ||||
| 50650 | if (rval.isObject()) { | ||||
| 50651 | JS::ForOfIterator iter(cx); | ||||
| 50652 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 50653 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50654 | return; | ||||
| 50655 | } | ||||
| 50656 | if (!iter.valueIsIterable()) { | ||||
| 50657 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence"); | ||||
| 50658 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50659 | return; | ||||
| 50660 | } | ||||
| 50661 | Sequence<int32_t> &arr = rvalDecl; | ||||
| 50662 | JS::Rooted<JS::Value> temp(cx); | ||||
| 50663 | while (true) { | ||||
| 50664 | bool done; | ||||
| 50665 | if (!iter.next(&temp, &done)) { | ||||
| 50666 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50667 | return; | ||||
| 50668 | } | ||||
| 50669 | if (done) { | ||||
| 50670 | break; | ||||
| 50671 | } | ||||
| 50672 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 50673 | if (!slotPtr) { | ||||
| 50674 | JS_ReportOutOfMemory(cx); | ||||
| 50675 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50676 | return; | ||||
| 50677 | } | ||||
| 50678 | int32_t& slot = *slotPtr; | ||||
| 50679 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequence", &slot)) { | ||||
| 50680 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50681 | return; | ||||
| 50682 | } | ||||
| 50683 | } | ||||
| 50684 | } else { | ||||
| 50685 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence"); | ||||
| 50686 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50687 | return; | ||||
| 50688 | } | ||||
| 50689 | aRetVal = std::move(rvalDecl); | ||||
| 50690 | } | ||||
| 50691 | |||||
| 50692 | void | ||||
| 50693 | TestJSImplInterfaceJSImpl::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50694 | { | ||||
| 50695 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50696 | if (aRv.Failed()) { | ||||
| 50697 | return; | ||||
| 50698 | } | ||||
| 50699 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50699); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50699; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50700 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50701 | |||||
| 50702 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50703 | |||||
| 50704 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50705 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50706 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50707 | !InitIds(cx, atomsCache)) || | ||||
| 50708 | !GetCallableProperty(cx, atomsCache->receiveNullableSequence_id, &callable)) { | ||||
| 50709 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50710 | return; | ||||
| 50711 | } | ||||
| 50712 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50713 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50714 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50715 | aRv.NoteJSContextException(cx); | ||||
| 50716 | return; | ||||
| 50717 | } | ||||
| 50718 | Nullable<Sequence<int32_t>> rvalDecl; | ||||
| 50719 | if (rval.isObject()) { | ||||
| 50720 | JS::ForOfIterator iter(cx); | ||||
| 50721 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 50722 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50723 | return; | ||||
| 50724 | } | ||||
| 50725 | if (!iter.valueIsIterable()) { | ||||
| 50726 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence"); | ||||
| 50727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50728 | return; | ||||
| 50729 | } | ||||
| 50730 | Sequence<int32_t> &arr = rvalDecl.SetValue(); | ||||
| 50731 | JS::Rooted<JS::Value> temp(cx); | ||||
| 50732 | while (true) { | ||||
| 50733 | bool done; | ||||
| 50734 | if (!iter.next(&temp, &done)) { | ||||
| 50735 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50736 | return; | ||||
| 50737 | } | ||||
| 50738 | if (done) { | ||||
| 50739 | break; | ||||
| 50740 | } | ||||
| 50741 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 50742 | if (!slotPtr) { | ||||
| 50743 | JS_ReportOutOfMemory(cx); | ||||
| 50744 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50745 | return; | ||||
| 50746 | } | ||||
| 50747 | int32_t& slot = *slotPtr; | ||||
| 50748 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequence", &slot)) { | ||||
| 50749 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50750 | return; | ||||
| 50751 | } | ||||
| 50752 | } | ||||
| 50753 | } else if (rval.isNullOrUndefined()) { | ||||
| 50754 | rvalDecl.SetNull(); | ||||
| 50755 | } else { | ||||
| 50756 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence"); | ||||
| 50757 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50758 | return; | ||||
| 50759 | } | ||||
| 50760 | if (rvalDecl.IsNull()) { | ||||
| 50761 | aRetVal.SetNull(); | ||||
| 50762 | } else { | ||||
| 50763 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 50764 | } | ||||
| 50765 | } | ||||
| 50766 | |||||
| 50767 | void | ||||
| 50768 | TestJSImplInterfaceJSImpl::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50769 | { | ||||
| 50770 | CallSetup s(this, aRv, "TestJSImplInterface.receiveSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50771 | if (aRv.Failed()) { | ||||
| 50772 | return; | ||||
| 50773 | } | ||||
| 50774 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50774); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50774; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50775 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50776 | |||||
| 50777 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50778 | |||||
| 50779 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50780 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50781 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50782 | !InitIds(cx, atomsCache)) || | ||||
| 50783 | !GetCallableProperty(cx, atomsCache->receiveSequenceOfNullableInts_id, &callable)) { | ||||
| 50784 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50785 | return; | ||||
| 50786 | } | ||||
| 50787 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50788 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50789 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50790 | aRv.NoteJSContextException(cx); | ||||
| 50791 | return; | ||||
| 50792 | } | ||||
| 50793 | Sequence<Nullable<int32_t>> rvalDecl; | ||||
| 50794 | if (rval.isObject()) { | ||||
| 50795 | JS::ForOfIterator iter(cx); | ||||
| 50796 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 50797 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50798 | return; | ||||
| 50799 | } | ||||
| 50800 | if (!iter.valueIsIterable()) { | ||||
| 50801 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence"); | ||||
| 50802 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50803 | return; | ||||
| 50804 | } | ||||
| 50805 | Sequence<Nullable<int32_t>> &arr = rvalDecl; | ||||
| 50806 | JS::Rooted<JS::Value> temp(cx); | ||||
| 50807 | while (true) { | ||||
| 50808 | bool done; | ||||
| 50809 | if (!iter.next(&temp, &done)) { | ||||
| 50810 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50811 | return; | ||||
| 50812 | } | ||||
| 50813 | if (done) { | ||||
| 50814 | break; | ||||
| 50815 | } | ||||
| 50816 | Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 50817 | if (!slotPtr) { | ||||
| 50818 | JS_ReportOutOfMemory(cx); | ||||
| 50819 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50820 | return; | ||||
| 50821 | } | ||||
| 50822 | Nullable<int32_t>& slot = *slotPtr; | ||||
| 50823 | if (temp.isNullOrUndefined()) { | ||||
| 50824 | slot.SetNull(); | ||||
| 50825 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequenceOfNullableInts", &slot.SetValue())) { | ||||
| 50826 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50827 | return; | ||||
| 50828 | } | ||||
| 50829 | } | ||||
| 50830 | } else { | ||||
| 50831 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence"); | ||||
| 50832 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50833 | return; | ||||
| 50834 | } | ||||
| 50835 | aRetVal = std::move(rvalDecl); | ||||
| 50836 | } | ||||
| 50837 | |||||
| 50838 | void | ||||
| 50839 | TestJSImplInterfaceJSImpl::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50840 | { | ||||
| 50841 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50842 | if (aRv.Failed()) { | ||||
| 50843 | return; | ||||
| 50844 | } | ||||
| 50845 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50845); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50845; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50846 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50847 | |||||
| 50848 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50849 | |||||
| 50850 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50851 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50852 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50853 | !InitIds(cx, atomsCache)) || | ||||
| 50854 | !GetCallableProperty(cx, atomsCache->receiveNullableSequenceOfNullableInts_id, &callable)) { | ||||
| 50855 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50856 | return; | ||||
| 50857 | } | ||||
| 50858 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50859 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50860 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 50861 | aRv.NoteJSContextException(cx); | ||||
| 50862 | return; | ||||
| 50863 | } | ||||
| 50864 | Nullable<Sequence<Nullable<int32_t>>> rvalDecl; | ||||
| 50865 | if (rval.isObject()) { | ||||
| 50866 | JS::ForOfIterator iter(cx); | ||||
| 50867 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 50868 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50869 | return; | ||||
| 50870 | } | ||||
| 50871 | if (!iter.valueIsIterable()) { | ||||
| 50872 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence"); | ||||
| 50873 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50874 | return; | ||||
| 50875 | } | ||||
| 50876 | Sequence<Nullable<int32_t>> &arr = rvalDecl.SetValue(); | ||||
| 50877 | JS::Rooted<JS::Value> temp(cx); | ||||
| 50878 | while (true) { | ||||
| 50879 | bool done; | ||||
| 50880 | if (!iter.next(&temp, &done)) { | ||||
| 50881 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50882 | return; | ||||
| 50883 | } | ||||
| 50884 | if (done) { | ||||
| 50885 | break; | ||||
| 50886 | } | ||||
| 50887 | Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 50888 | if (!slotPtr) { | ||||
| 50889 | JS_ReportOutOfMemory(cx); | ||||
| 50890 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50891 | return; | ||||
| 50892 | } | ||||
| 50893 | Nullable<int32_t>& slot = *slotPtr; | ||||
| 50894 | if (temp.isNullOrUndefined()) { | ||||
| 50895 | slot.SetNull(); | ||||
| 50896 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", &slot.SetValue())) { | ||||
| 50897 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50898 | return; | ||||
| 50899 | } | ||||
| 50900 | } | ||||
| 50901 | } else if (rval.isNullOrUndefined()) { | ||||
| 50902 | rvalDecl.SetNull(); | ||||
| 50903 | } else { | ||||
| 50904 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence"); | ||||
| 50905 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50906 | return; | ||||
| 50907 | } | ||||
| 50908 | if (rvalDecl.IsNull()) { | ||||
| 50909 | aRetVal.SetNull(); | ||||
| 50910 | } else { | ||||
| 50911 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 50912 | } | ||||
| 50913 | } | ||||
| 50914 | |||||
| 50915 | void | ||||
| 50916 | TestJSImplInterfaceJSImpl::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50917 | { | ||||
| 50918 | CallSetup s(this, aRv, "TestJSImplInterface.passSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50919 | if (aRv.Failed()) { | ||||
| 50920 | return; | ||||
| 50921 | } | ||||
| 50922 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50922); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50922; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50923 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50924 | |||||
| 50925 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50926 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50927 | if (!argv.resize(1)) { | ||||
| 50928 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50929 | // the right thing with that. | ||||
| 50930 | return; | ||||
| 50931 | } | ||||
| 50932 | unsigned argc = 1; | ||||
| 50933 | |||||
| 50934 | do { | ||||
| 50935 | |||||
| 50936 | uint32_t length = arg.Length(); | ||||
| 50937 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 50938 | if (!returnArray) { | ||||
| 50939 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50940 | return; | ||||
| 50941 | } | ||||
| 50942 | // Scope for 'tmp' | ||||
| 50943 | { | ||||
| 50944 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 50945 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 50946 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 50947 | // are different ways to succeed at wrapping the object. | ||||
| 50948 | do { | ||||
| 50949 | tmp.setInt32(int32_t(arg[sequenceIdx0])); | ||||
| 50950 | break; | ||||
| 50951 | } while (false); | ||||
| 50952 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 50953 | JSPROP_ENUMERATE)) { | ||||
| 50954 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50955 | return; | ||||
| 50956 | } | ||||
| 50957 | } | ||||
| 50958 | } | ||||
| 50959 | argv[0].setObject(*returnArray); | ||||
| 50960 | break; | ||||
| 50961 | } while (false); | ||||
| 50962 | |||||
| 50963 | JS::Rooted<JS::Value> callable(cx); | ||||
| 50964 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 50965 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 50966 | !InitIds(cx, atomsCache)) || | ||||
| 50967 | !GetCallableProperty(cx, atomsCache->passSequence_id, &callable)) { | ||||
| 50968 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 50969 | return; | ||||
| 50970 | } | ||||
| 50971 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 50972 | if (!JS::Call(cx, thisValue, callable, | ||||
| 50973 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 50974 | aRv.NoteJSContextException(cx); | ||||
| 50975 | return; | ||||
| 50976 | } | ||||
| 50977 | } | ||||
| 50978 | |||||
| 50979 | void | ||||
| 50980 | TestJSImplInterfaceJSImpl::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 50981 | { | ||||
| 50982 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 50983 | if (aRv.Failed()) { | ||||
| 50984 | return; | ||||
| 50985 | } | ||||
| 50986 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 50986); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 50986; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 50987 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 50988 | |||||
| 50989 | JS::Rooted<JS::Value> rval(cx); | ||||
| 50990 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 50991 | if (!argv.resize(1)) { | ||||
| 50992 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 50993 | // the right thing with that. | ||||
| 50994 | return; | ||||
| 50995 | } | ||||
| 50996 | unsigned argc = 1; | ||||
| 50997 | |||||
| 50998 | do { | ||||
| 50999 | |||||
| 51000 | if (arg.IsNull()) { | ||||
| 51001 | argv[0].setNull(); | ||||
| 51002 | break; | ||||
| 51003 | } | ||||
| 51004 | |||||
| 51005 | uint32_t length = arg.Value().Length(); | ||||
| 51006 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 51007 | if (!returnArray) { | ||||
| 51008 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51009 | return; | ||||
| 51010 | } | ||||
| 51011 | // Scope for 'tmp' | ||||
| 51012 | { | ||||
| 51013 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 51014 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 51015 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 51016 | // are different ways to succeed at wrapping the object. | ||||
| 51017 | do { | ||||
| 51018 | tmp.setInt32(int32_t(arg.Value()[sequenceIdx0])); | ||||
| 51019 | break; | ||||
| 51020 | } while (false); | ||||
| 51021 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 51022 | JSPROP_ENUMERATE)) { | ||||
| 51023 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51024 | return; | ||||
| 51025 | } | ||||
| 51026 | } | ||||
| 51027 | } | ||||
| 51028 | argv[0].setObject(*returnArray); | ||||
| 51029 | break; | ||||
| 51030 | } while (false); | ||||
| 51031 | |||||
| 51032 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51033 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51034 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51035 | !InitIds(cx, atomsCache)) || | ||||
| 51036 | !GetCallableProperty(cx, atomsCache->passNullableSequence_id, &callable)) { | ||||
| 51037 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51038 | return; | ||||
| 51039 | } | ||||
| 51040 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51041 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51042 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 51043 | aRv.NoteJSContextException(cx); | ||||
| 51044 | return; | ||||
| 51045 | } | ||||
| 51046 | } | ||||
| 51047 | |||||
| 51048 | void | ||||
| 51049 | TestJSImplInterfaceJSImpl::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51050 | { | ||||
| 51051 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51052 | if (aRv.Failed()) { | ||||
| 51053 | return; | ||||
| 51054 | } | ||||
| 51055 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51055); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51055; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51056 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51057 | |||||
| 51058 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51059 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 51060 | if (!argv.resize(1)) { | ||||
| 51061 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 51062 | // the right thing with that. | ||||
| 51063 | return; | ||||
| 51064 | } | ||||
| 51065 | unsigned argc = 1; | ||||
| 51066 | |||||
| 51067 | do { | ||||
| 51068 | |||||
| 51069 | uint32_t length = arg.Length(); | ||||
| 51070 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 51071 | if (!returnArray) { | ||||
| 51072 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51073 | return; | ||||
| 51074 | } | ||||
| 51075 | // Scope for 'tmp' | ||||
| 51076 | { | ||||
| 51077 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 51078 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 51079 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 51080 | // are different ways to succeed at wrapping the object. | ||||
| 51081 | do { | ||||
| 51082 | if (arg[sequenceIdx0].IsNull()) { | ||||
| 51083 | tmp.setNull(); | ||||
| 51084 | break; | ||||
| 51085 | } | ||||
| 51086 | tmp.setInt32(int32_t(arg[sequenceIdx0].Value())); | ||||
| 51087 | break; | ||||
| 51088 | } while (false); | ||||
| 51089 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 51090 | JSPROP_ENUMERATE)) { | ||||
| 51091 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51092 | return; | ||||
| 51093 | } | ||||
| 51094 | } | ||||
| 51095 | } | ||||
| 51096 | argv[0].setObject(*returnArray); | ||||
| 51097 | break; | ||||
| 51098 | } while (false); | ||||
| 51099 | |||||
| 51100 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51101 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51102 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51103 | !InitIds(cx, atomsCache)) || | ||||
| 51104 | !GetCallableProperty(cx, atomsCache->passSequenceOfNullableInts_id, &callable)) { | ||||
| 51105 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51106 | return; | ||||
| 51107 | } | ||||
| 51108 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51109 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51110 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 51111 | aRv.NoteJSContextException(cx); | ||||
| 51112 | return; | ||||
| 51113 | } | ||||
| 51114 | } | ||||
| 51115 | |||||
| 51116 | void | ||||
| 51117 | TestJSImplInterfaceJSImpl::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51118 | { | ||||
| 51119 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51120 | if (aRv.Failed()) { | ||||
| 51121 | return; | ||||
| 51122 | } | ||||
| 51123 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51123); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51123; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51124 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51125 | |||||
| 51126 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51127 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 51128 | if (!argv.resize(1)) { | ||||
| 51129 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 51130 | // the right thing with that. | ||||
| 51131 | return; | ||||
| 51132 | } | ||||
| 51133 | unsigned argc = 1; | ||||
| 51134 | |||||
| 51135 | do { | ||||
| 51136 | if (arg.WasPassed()) { | ||||
| 51137 | |||||
| 51138 | uint32_t length = arg.Value().Length(); | ||||
| 51139 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 51140 | if (!returnArray) { | ||||
| 51141 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51142 | return; | ||||
| 51143 | } | ||||
| 51144 | // Scope for 'tmp' | ||||
| 51145 | { | ||||
| 51146 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 51147 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 51148 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 51149 | // are different ways to succeed at wrapping the object. | ||||
| 51150 | do { | ||||
| 51151 | if (arg.Value()[sequenceIdx0].IsNull()) { | ||||
| 51152 | tmp.setNull(); | ||||
| 51153 | break; | ||||
| 51154 | } | ||||
| 51155 | tmp.setInt32(int32_t(arg.Value()[sequenceIdx0].Value())); | ||||
| 51156 | break; | ||||
| 51157 | } while (false); | ||||
| 51158 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 51159 | JSPROP_ENUMERATE)) { | ||||
| 51160 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51161 | return; | ||||
| 51162 | } | ||||
| 51163 | } | ||||
| 51164 | } | ||||
| 51165 | argv[0].setObject(*returnArray); | ||||
| 51166 | break; | ||||
| 51167 | } else if (argc == 1) { | ||||
| 51168 | // This is our current trailing argument; reduce argc | ||||
| 51169 | --argc; | ||||
| 51170 | } else { | ||||
| 51171 | argv[0].setUndefined(); | ||||
| 51172 | } | ||||
| 51173 | } while (false); | ||||
| 51174 | |||||
| 51175 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51176 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51177 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51178 | !InitIds(cx, atomsCache)) || | ||||
| 51179 | !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfNullableInts_id, &callable)) { | ||||
| 51180 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51181 | return; | ||||
| 51182 | } | ||||
| 51183 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51184 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51185 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 51186 | aRv.NoteJSContextException(cx); | ||||
| 51187 | return; | ||||
| 51188 | } | ||||
| 51189 | } | ||||
| 51190 | |||||
| 51191 | void | ||||
| 51192 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51193 | { | ||||
| 51194 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51195 | if (aRv.Failed()) { | ||||
| 51196 | return; | ||||
| 51197 | } | ||||
| 51198 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51198); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51198; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51199 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51200 | |||||
| 51201 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51202 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 51203 | if (!argv.resize(1)) { | ||||
| 51204 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 51205 | // the right thing with that. | ||||
| 51206 | return; | ||||
| 51207 | } | ||||
| 51208 | unsigned argc = 1; | ||||
| 51209 | |||||
| 51210 | do { | ||||
| 51211 | if (arg.WasPassed()) { | ||||
| 51212 | |||||
| 51213 | if (arg.Value().IsNull()) { | ||||
| 51214 | argv[0].setNull(); | ||||
| 51215 | break; | ||||
| 51216 | } | ||||
| 51217 | |||||
| 51218 | uint32_t length = arg.Value().Value().Length(); | ||||
| 51219 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 51220 | if (!returnArray) { | ||||
| 51221 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51222 | return; | ||||
| 51223 | } | ||||
| 51224 | // Scope for 'tmp' | ||||
| 51225 | { | ||||
| 51226 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 51227 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 51228 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 51229 | // are different ways to succeed at wrapping the object. | ||||
| 51230 | do { | ||||
| 51231 | if (arg.Value().Value()[sequenceIdx0].IsNull()) { | ||||
| 51232 | tmp.setNull(); | ||||
| 51233 | break; | ||||
| 51234 | } | ||||
| 51235 | tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0].Value())); | ||||
| 51236 | break; | ||||
| 51237 | } while (false); | ||||
| 51238 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 51239 | JSPROP_ENUMERATE)) { | ||||
| 51240 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51241 | return; | ||||
| 51242 | } | ||||
| 51243 | } | ||||
| 51244 | } | ||||
| 51245 | argv[0].setObject(*returnArray); | ||||
| 51246 | break; | ||||
| 51247 | } else if (argc == 1) { | ||||
| 51248 | // This is our current trailing argument; reduce argc | ||||
| 51249 | --argc; | ||||
| 51250 | } else { | ||||
| 51251 | argv[0].setUndefined(); | ||||
| 51252 | } | ||||
| 51253 | } while (false); | ||||
| 51254 | |||||
| 51255 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51256 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51257 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51258 | !InitIds(cx, atomsCache)) || | ||||
| 51259 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableInts_id, &callable)) { | ||||
| 51260 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51261 | return; | ||||
| 51262 | } | ||||
| 51263 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51264 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51265 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 51266 | aRv.NoteJSContextException(cx); | ||||
| 51267 | return; | ||||
| 51268 | } | ||||
| 51269 | } | ||||
| 51270 | |||||
| 51271 | void | ||||
| 51272 | TestJSImplInterfaceJSImpl::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51273 | { | ||||
| 51274 | CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51275 | if (aRv.Failed()) { | ||||
| 51276 | return; | ||||
| 51277 | } | ||||
| 51278 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51278); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51278; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51279 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51280 | |||||
| 51281 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51282 | |||||
| 51283 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51284 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51285 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51286 | !InitIds(cx, atomsCache)) || | ||||
| 51287 | !GetCallableProperty(cx, atomsCache->receiveCastableObjectSequence_id, &callable)) { | ||||
| 51288 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51289 | return; | ||||
| 51290 | } | ||||
| 51291 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51292 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51293 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51294 | aRv.NoteJSContextException(cx); | ||||
| 51295 | return; | ||||
| 51296 | } | ||||
| 51297 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl; | ||||
| 51298 | if (rval.isObject()) { | ||||
| 51299 | JS::ForOfIterator iter(cx); | ||||
| 51300 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51301 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51302 | return; | ||||
| 51303 | } | ||||
| 51304 | if (!iter.valueIsIterable()) { | ||||
| 51305 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence"); | ||||
| 51306 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51307 | return; | ||||
| 51308 | } | ||||
| 51309 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl; | ||||
| 51310 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51311 | while (true) { | ||||
| 51312 | bool done; | ||||
| 51313 | if (!iter.next(&temp, &done)) { | ||||
| 51314 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51315 | return; | ||||
| 51316 | } | ||||
| 51317 | if (done) { | ||||
| 51318 | break; | ||||
| 51319 | } | ||||
| 51320 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51321 | if (!slotPtr) { | ||||
| 51322 | JS_ReportOutOfMemory(cx); | ||||
| 51323 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51324 | return; | ||||
| 51325 | } | ||||
| 51326 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51327 | if (temp.isObject()) { | ||||
| 51328 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51329 | { | ||||
| 51330 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 51331 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 51332 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 51333 | // Be careful to not wrap random DOM objects here, even if | ||||
| 51334 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 51335 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 51336 | // that already has a content reflection... | ||||
| 51337 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 51338 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 51339 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 51340 | if (!callback || | ||||
| 51341 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 51342 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51343 | return; | ||||
| 51344 | } | ||||
| 51345 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 51346 | 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", 51347); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51347; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 51347 | "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", 51347); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51347; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 51348 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 51349 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 51350 | } else { | ||||
| 51351 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence", "TestJSImplInterface"); | ||||
| 51352 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51353 | return; | ||||
| 51354 | } | ||||
| 51355 | } | ||||
| 51356 | } | ||||
| 51357 | } else { | ||||
| 51358 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence"); | ||||
| 51359 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51360 | return; | ||||
| 51361 | } | ||||
| 51362 | } | ||||
| 51363 | } else { | ||||
| 51364 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence"); | ||||
| 51365 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51366 | return; | ||||
| 51367 | } | ||||
| 51368 | aRetVal = std::move(rvalDecl); | ||||
| 51369 | } | ||||
| 51370 | |||||
| 51371 | void | ||||
| 51372 | TestJSImplInterfaceJSImpl::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51373 | { | ||||
| 51374 | CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51375 | if (aRv.Failed()) { | ||||
| 51376 | return; | ||||
| 51377 | } | ||||
| 51378 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51378; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51379 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51380 | |||||
| 51381 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51382 | |||||
| 51383 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51384 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51385 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51386 | !InitIds(cx, atomsCache)) || | ||||
| 51387 | !GetCallableProperty(cx, atomsCache->receiveCallbackObjectSequence_id, &callable)) { | ||||
| 51388 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51389 | return; | ||||
| 51390 | } | ||||
| 51391 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51392 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51393 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51394 | aRv.NoteJSContextException(cx); | ||||
| 51395 | return; | ||||
| 51396 | } | ||||
| 51397 | Sequence<RefPtr<TestCallbackInterface>> rvalDecl; | ||||
| 51398 | if (rval.isObject()) { | ||||
| 51399 | JS::ForOfIterator iter(cx); | ||||
| 51400 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51401 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51402 | return; | ||||
| 51403 | } | ||||
| 51404 | if (!iter.valueIsIterable()) { | ||||
| 51405 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence"); | ||||
| 51406 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51407 | return; | ||||
| 51408 | } | ||||
| 51409 | Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl; | ||||
| 51410 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51411 | while (true) { | ||||
| 51412 | bool done; | ||||
| 51413 | if (!iter.next(&temp, &done)) { | ||||
| 51414 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51415 | return; | ||||
| 51416 | } | ||||
| 51417 | if (done) { | ||||
| 51418 | break; | ||||
| 51419 | } | ||||
| 51420 | RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51421 | if (!slotPtr) { | ||||
| 51422 | JS_ReportOutOfMemory(cx); | ||||
| 51423 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51424 | return; | ||||
| 51425 | } | ||||
| 51426 | RefPtr<TestCallbackInterface>& slot = *slotPtr; | ||||
| 51427 | if (temp.isObject()) { | ||||
| 51428 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 51429 | JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject()); | ||||
| 51430 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 51431 | slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 51432 | } | ||||
| 51433 | } else { | ||||
| 51434 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCallbackObjectSequence"); | ||||
| 51435 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51436 | return; | ||||
| 51437 | } | ||||
| 51438 | } | ||||
| 51439 | } else { | ||||
| 51440 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence"); | ||||
| 51441 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51442 | return; | ||||
| 51443 | } | ||||
| 51444 | aRetVal = std::move(rvalDecl); | ||||
| 51445 | } | ||||
| 51446 | |||||
| 51447 | void | ||||
| 51448 | TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51449 | { | ||||
| 51450 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51451 | if (aRv.Failed()) { | ||||
| 51452 | return; | ||||
| 51453 | } | ||||
| 51454 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51454); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51454; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51455 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51456 | |||||
| 51457 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51458 | |||||
| 51459 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51460 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51461 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51462 | !InitIds(cx, atomsCache)) || | ||||
| 51463 | !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectSequence_id, &callable)) { | ||||
| 51464 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51465 | return; | ||||
| 51466 | } | ||||
| 51467 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51468 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51469 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51470 | aRv.NoteJSContextException(cx); | ||||
| 51471 | return; | ||||
| 51472 | } | ||||
| 51473 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl; | ||||
| 51474 | if (rval.isObject()) { | ||||
| 51475 | JS::ForOfIterator iter(cx); | ||||
| 51476 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51477 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51478 | return; | ||||
| 51479 | } | ||||
| 51480 | if (!iter.valueIsIterable()) { | ||||
| 51481 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence"); | ||||
| 51482 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51483 | return; | ||||
| 51484 | } | ||||
| 51485 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl; | ||||
| 51486 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51487 | while (true) { | ||||
| 51488 | bool done; | ||||
| 51489 | if (!iter.next(&temp, &done)) { | ||||
| 51490 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51491 | return; | ||||
| 51492 | } | ||||
| 51493 | if (done) { | ||||
| 51494 | break; | ||||
| 51495 | } | ||||
| 51496 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51497 | if (!slotPtr) { | ||||
| 51498 | JS_ReportOutOfMemory(cx); | ||||
| 51499 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51500 | return; | ||||
| 51501 | } | ||||
| 51502 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51503 | if (temp.isObject()) { | ||||
| 51504 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51505 | { | ||||
| 51506 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 51507 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 51508 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 51509 | // Be careful to not wrap random DOM objects here, even if | ||||
| 51510 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 51511 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 51512 | // that already has a content reflection... | ||||
| 51513 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 51514 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 51515 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 51516 | if (!callback || | ||||
| 51517 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 51518 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51519 | return; | ||||
| 51520 | } | ||||
| 51521 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 51522 | 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", 51523); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51523; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 51523 | "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", 51523); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51523; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 51524 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 51525 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 51526 | } else { | ||||
| 51527 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "TestJSImplInterface"); | ||||
| 51528 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51529 | return; | ||||
| 51530 | } | ||||
| 51531 | } | ||||
| 51532 | } | ||||
| 51533 | } else if (temp.isNullOrUndefined()) { | ||||
| 51534 | slot = nullptr; | ||||
| 51535 | } else { | ||||
| 51536 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence"); | ||||
| 51537 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51538 | return; | ||||
| 51539 | } | ||||
| 51540 | } | ||||
| 51541 | } else { | ||||
| 51542 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence"); | ||||
| 51543 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51544 | return; | ||||
| 51545 | } | ||||
| 51546 | aRetVal = std::move(rvalDecl); | ||||
| 51547 | } | ||||
| 51548 | |||||
| 51549 | void | ||||
| 51550 | TestJSImplInterfaceJSImpl::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51551 | { | ||||
| 51552 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51553 | if (aRv.Failed()) { | ||||
| 51554 | return; | ||||
| 51555 | } | ||||
| 51556 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51556); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51556; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51557 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51558 | |||||
| 51559 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51560 | |||||
| 51561 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51562 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51563 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51564 | !InitIds(cx, atomsCache)) || | ||||
| 51565 | !GetCallableProperty(cx, atomsCache->receiveNullableCallbackObjectSequence_id, &callable)) { | ||||
| 51566 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51567 | return; | ||||
| 51568 | } | ||||
| 51569 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51570 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51571 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51572 | aRv.NoteJSContextException(cx); | ||||
| 51573 | return; | ||||
| 51574 | } | ||||
| 51575 | Sequence<RefPtr<TestCallbackInterface>> rvalDecl; | ||||
| 51576 | if (rval.isObject()) { | ||||
| 51577 | JS::ForOfIterator iter(cx); | ||||
| 51578 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51579 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51580 | return; | ||||
| 51581 | } | ||||
| 51582 | if (!iter.valueIsIterable()) { | ||||
| 51583 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence"); | ||||
| 51584 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51585 | return; | ||||
| 51586 | } | ||||
| 51587 | Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl; | ||||
| 51588 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51589 | while (true) { | ||||
| 51590 | bool done; | ||||
| 51591 | if (!iter.next(&temp, &done)) { | ||||
| 51592 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51593 | return; | ||||
| 51594 | } | ||||
| 51595 | if (done) { | ||||
| 51596 | break; | ||||
| 51597 | } | ||||
| 51598 | RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51599 | if (!slotPtr) { | ||||
| 51600 | JS_ReportOutOfMemory(cx); | ||||
| 51601 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51602 | return; | ||||
| 51603 | } | ||||
| 51604 | RefPtr<TestCallbackInterface>& slot = *slotPtr; | ||||
| 51605 | if (temp.isObject()) { | ||||
| 51606 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 51607 | JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject()); | ||||
| 51608 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 51609 | slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 51610 | } | ||||
| 51611 | } else if (temp.isNullOrUndefined()) { | ||||
| 51612 | slot = nullptr; | ||||
| 51613 | } else { | ||||
| 51614 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCallbackObjectSequence"); | ||||
| 51615 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51616 | return; | ||||
| 51617 | } | ||||
| 51618 | } | ||||
| 51619 | } else { | ||||
| 51620 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence"); | ||||
| 51621 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51622 | return; | ||||
| 51623 | } | ||||
| 51624 | aRetVal = std::move(rvalDecl); | ||||
| 51625 | } | ||||
| 51626 | |||||
| 51627 | void | ||||
| 51628 | TestJSImplInterfaceJSImpl::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51629 | { | ||||
| 51630 | CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51631 | if (aRv.Failed()) { | ||||
| 51632 | return; | ||||
| 51633 | } | ||||
| 51634 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51634); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51634; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51635 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51636 | |||||
| 51637 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51638 | |||||
| 51639 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51640 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51641 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51642 | !InitIds(cx, atomsCache)) || | ||||
| 51643 | !GetCallableProperty(cx, atomsCache->receiveCastableObjectNullableSequence_id, &callable)) { | ||||
| 51644 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51645 | return; | ||||
| 51646 | } | ||||
| 51647 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51648 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51649 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51650 | aRv.NoteJSContextException(cx); | ||||
| 51651 | return; | ||||
| 51652 | } | ||||
| 51653 | Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl; | ||||
| 51654 | if (rval.isObject()) { | ||||
| 51655 | JS::ForOfIterator iter(cx); | ||||
| 51656 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51657 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51658 | return; | ||||
| 51659 | } | ||||
| 51660 | if (!iter.valueIsIterable()) { | ||||
| 51661 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence"); | ||||
| 51662 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51663 | return; | ||||
| 51664 | } | ||||
| 51665 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue(); | ||||
| 51666 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51667 | while (true) { | ||||
| 51668 | bool done; | ||||
| 51669 | if (!iter.next(&temp, &done)) { | ||||
| 51670 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51671 | return; | ||||
| 51672 | } | ||||
| 51673 | if (done) { | ||||
| 51674 | break; | ||||
| 51675 | } | ||||
| 51676 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51677 | if (!slotPtr) { | ||||
| 51678 | JS_ReportOutOfMemory(cx); | ||||
| 51679 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51680 | return; | ||||
| 51681 | } | ||||
| 51682 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51683 | if (temp.isObject()) { | ||||
| 51684 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51685 | { | ||||
| 51686 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 51687 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 51688 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 51689 | // Be careful to not wrap random DOM objects here, even if | ||||
| 51690 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 51691 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 51692 | // that already has a content reflection... | ||||
| 51693 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 51694 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 51695 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 51696 | if (!callback || | ||||
| 51697 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 51698 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51699 | return; | ||||
| 51700 | } | ||||
| 51701 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 51702 | 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", 51703); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51703; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 51703 | "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", 51703); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51703; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 51704 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 51705 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 51706 | } else { | ||||
| 51707 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "TestJSImplInterface"); | ||||
| 51708 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51709 | return; | ||||
| 51710 | } | ||||
| 51711 | } | ||||
| 51712 | } | ||||
| 51713 | } else { | ||||
| 51714 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence"); | ||||
| 51715 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51716 | return; | ||||
| 51717 | } | ||||
| 51718 | } | ||||
| 51719 | } else if (rval.isNullOrUndefined()) { | ||||
| 51720 | rvalDecl.SetNull(); | ||||
| 51721 | } else { | ||||
| 51722 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence"); | ||||
| 51723 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51724 | return; | ||||
| 51725 | } | ||||
| 51726 | if (rvalDecl.IsNull()) { | ||||
| 51727 | aRetVal.SetNull(); | ||||
| 51728 | } else { | ||||
| 51729 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 51730 | } | ||||
| 51731 | } | ||||
| 51732 | |||||
| 51733 | void | ||||
| 51734 | TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51735 | { | ||||
| 51736 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51737 | if (aRv.Failed()) { | ||||
| 51738 | return; | ||||
| 51739 | } | ||||
| 51740 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51740); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51740; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51741 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51742 | |||||
| 51743 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51744 | |||||
| 51745 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51746 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51747 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51748 | !InitIds(cx, atomsCache)) || | ||||
| 51749 | !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectNullableSequence_id, &callable)) { | ||||
| 51750 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51751 | return; | ||||
| 51752 | } | ||||
| 51753 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51754 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51755 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51756 | aRv.NoteJSContextException(cx); | ||||
| 51757 | return; | ||||
| 51758 | } | ||||
| 51759 | Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl; | ||||
| 51760 | if (rval.isObject()) { | ||||
| 51761 | JS::ForOfIterator iter(cx); | ||||
| 51762 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51763 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51764 | return; | ||||
| 51765 | } | ||||
| 51766 | if (!iter.valueIsIterable()) { | ||||
| 51767 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence"); | ||||
| 51768 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51769 | return; | ||||
| 51770 | } | ||||
| 51771 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue(); | ||||
| 51772 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51773 | while (true) { | ||||
| 51774 | bool done; | ||||
| 51775 | if (!iter.next(&temp, &done)) { | ||||
| 51776 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51777 | return; | ||||
| 51778 | } | ||||
| 51779 | if (done) { | ||||
| 51780 | break; | ||||
| 51781 | } | ||||
| 51782 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51783 | if (!slotPtr) { | ||||
| 51784 | JS_ReportOutOfMemory(cx); | ||||
| 51785 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51786 | return; | ||||
| 51787 | } | ||||
| 51788 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51789 | if (temp.isObject()) { | ||||
| 51790 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51791 | { | ||||
| 51792 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 51793 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 51794 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 51795 | // Be careful to not wrap random DOM objects here, even if | ||||
| 51796 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 51797 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 51798 | // that already has a content reflection... | ||||
| 51799 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 51800 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 51801 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 51802 | if (!callback || | ||||
| 51803 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 51804 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51805 | return; | ||||
| 51806 | } | ||||
| 51807 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 51808 | 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", 51809); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51809; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 51809 | "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", 51809); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51809; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 51810 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 51811 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 51812 | } else { | ||||
| 51813 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "TestJSImplInterface"); | ||||
| 51814 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51815 | return; | ||||
| 51816 | } | ||||
| 51817 | } | ||||
| 51818 | } | ||||
| 51819 | } else if (temp.isNullOrUndefined()) { | ||||
| 51820 | slot = nullptr; | ||||
| 51821 | } else { | ||||
| 51822 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence"); | ||||
| 51823 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51824 | return; | ||||
| 51825 | } | ||||
| 51826 | } | ||||
| 51827 | } else if (rval.isNullOrUndefined()) { | ||||
| 51828 | rvalDecl.SetNull(); | ||||
| 51829 | } else { | ||||
| 51830 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence"); | ||||
| 51831 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51832 | return; | ||||
| 51833 | } | ||||
| 51834 | if (rvalDecl.IsNull()) { | ||||
| 51835 | aRetVal.SetNull(); | ||||
| 51836 | } else { | ||||
| 51837 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 51838 | } | ||||
| 51839 | } | ||||
| 51840 | |||||
| 51841 | void | ||||
| 51842 | TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51843 | { | ||||
| 51844 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51845 | if (aRv.Failed()) { | ||||
| 51846 | return; | ||||
| 51847 | } | ||||
| 51848 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51848); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51848; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51849 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51850 | |||||
| 51851 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51852 | |||||
| 51853 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51854 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51855 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51856 | !InitIds(cx, atomsCache)) || | ||||
| 51857 | !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectSequence_id, &callable)) { | ||||
| 51858 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51859 | return; | ||||
| 51860 | } | ||||
| 51861 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51862 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51863 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51864 | aRv.NoteJSContextException(cx); | ||||
| 51865 | return; | ||||
| 51866 | } | ||||
| 51867 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl; | ||||
| 51868 | if (rval.isObject()) { | ||||
| 51869 | JS::ForOfIterator iter(cx); | ||||
| 51870 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51871 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51872 | return; | ||||
| 51873 | } | ||||
| 51874 | if (!iter.valueIsIterable()) { | ||||
| 51875 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence"); | ||||
| 51876 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51877 | return; | ||||
| 51878 | } | ||||
| 51879 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl; | ||||
| 51880 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51881 | while (true) { | ||||
| 51882 | bool done; | ||||
| 51883 | if (!iter.next(&temp, &done)) { | ||||
| 51884 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51885 | return; | ||||
| 51886 | } | ||||
| 51887 | if (done) { | ||||
| 51888 | break; | ||||
| 51889 | } | ||||
| 51890 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51891 | if (!slotPtr) { | ||||
| 51892 | JS_ReportOutOfMemory(cx); | ||||
| 51893 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51894 | return; | ||||
| 51895 | } | ||||
| 51896 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51897 | if (temp.isObject()) { | ||||
| 51898 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51899 | { | ||||
| 51900 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 51901 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 51902 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 51903 | // Be careful to not wrap random DOM objects here, even if | ||||
| 51904 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 51905 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 51906 | // that already has a content reflection... | ||||
| 51907 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 51908 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 51909 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 51910 | if (!callback || | ||||
| 51911 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 51912 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51913 | return; | ||||
| 51914 | } | ||||
| 51915 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 51916 | 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", 51917); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51917; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 51917 | "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", 51917); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 51917; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 51918 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 51919 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 51920 | } else { | ||||
| 51921 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "TestJSImplInterface"); | ||||
| 51922 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51923 | return; | ||||
| 51924 | } | ||||
| 51925 | } | ||||
| 51926 | } | ||||
| 51927 | } else { | ||||
| 51928 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence"); | ||||
| 51929 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51930 | return; | ||||
| 51931 | } | ||||
| 51932 | } | ||||
| 51933 | } else { | ||||
| 51934 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence"); | ||||
| 51935 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51936 | return; | ||||
| 51937 | } | ||||
| 51938 | aRetVal = std::move(rvalDecl); | ||||
| 51939 | } | ||||
| 51940 | |||||
| 51941 | void | ||||
| 51942 | TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 51943 | { | ||||
| 51944 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 51945 | if (aRv.Failed()) { | ||||
| 51946 | return; | ||||
| 51947 | } | ||||
| 51948 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 51948); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 51948; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 51949 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 51950 | |||||
| 51951 | JS::Rooted<JS::Value> rval(cx); | ||||
| 51952 | |||||
| 51953 | JS::Rooted<JS::Value> callable(cx); | ||||
| 51954 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 51955 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 51956 | !InitIds(cx, atomsCache)) || | ||||
| 51957 | !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectSequence_id, &callable)) { | ||||
| 51958 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51959 | return; | ||||
| 51960 | } | ||||
| 51961 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 51962 | if (!JS::Call(cx, thisValue, callable, | ||||
| 51963 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 51964 | aRv.NoteJSContextException(cx); | ||||
| 51965 | return; | ||||
| 51966 | } | ||||
| 51967 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl; | ||||
| 51968 | if (rval.isObject()) { | ||||
| 51969 | JS::ForOfIterator iter(cx); | ||||
| 51970 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 51971 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51972 | return; | ||||
| 51973 | } | ||||
| 51974 | if (!iter.valueIsIterable()) { | ||||
| 51975 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence"); | ||||
| 51976 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51977 | return; | ||||
| 51978 | } | ||||
| 51979 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl; | ||||
| 51980 | JS::Rooted<JS::Value> temp(cx); | ||||
| 51981 | while (true) { | ||||
| 51982 | bool done; | ||||
| 51983 | if (!iter.next(&temp, &done)) { | ||||
| 51984 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51985 | return; | ||||
| 51986 | } | ||||
| 51987 | if (done) { | ||||
| 51988 | break; | ||||
| 51989 | } | ||||
| 51990 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 51991 | if (!slotPtr) { | ||||
| 51992 | JS_ReportOutOfMemory(cx); | ||||
| 51993 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 51994 | return; | ||||
| 51995 | } | ||||
| 51996 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 51997 | if (temp.isObject()) { | ||||
| 51998 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 51999 | { | ||||
| 52000 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 52001 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 52002 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 52003 | // Be careful to not wrap random DOM objects here, even if | ||||
| 52004 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 52005 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 52006 | // that already has a content reflection... | ||||
| 52007 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 52008 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 52009 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 52010 | if (!callback || | ||||
| 52011 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 52012 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52013 | return; | ||||
| 52014 | } | ||||
| 52015 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 52016 | 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", 52017); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52017; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 52017 | "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", 52017); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52017; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 52018 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 52019 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 52020 | } else { | ||||
| 52021 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "TestJSImplInterface"); | ||||
| 52022 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52023 | return; | ||||
| 52024 | } | ||||
| 52025 | } | ||||
| 52026 | } | ||||
| 52027 | } else if (temp.isNullOrUndefined()) { | ||||
| 52028 | slot = nullptr; | ||||
| 52029 | } else { | ||||
| 52030 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence"); | ||||
| 52031 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52032 | return; | ||||
| 52033 | } | ||||
| 52034 | } | ||||
| 52035 | } else { | ||||
| 52036 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence"); | ||||
| 52037 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52038 | return; | ||||
| 52039 | } | ||||
| 52040 | aRetVal = std::move(rvalDecl); | ||||
| 52041 | } | ||||
| 52042 | |||||
| 52043 | void | ||||
| 52044 | TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52045 | { | ||||
| 52046 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52047 | if (aRv.Failed()) { | ||||
| 52048 | return; | ||||
| 52049 | } | ||||
| 52050 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52050); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52050; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52051 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52052 | |||||
| 52053 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52054 | |||||
| 52055 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52056 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52057 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52058 | !InitIds(cx, atomsCache)) || | ||||
| 52059 | !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectNullableSequence_id, &callable)) { | ||||
| 52060 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52061 | return; | ||||
| 52062 | } | ||||
| 52063 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52064 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52065 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 52066 | aRv.NoteJSContextException(cx); | ||||
| 52067 | return; | ||||
| 52068 | } | ||||
| 52069 | Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl; | ||||
| 52070 | if (rval.isObject()) { | ||||
| 52071 | JS::ForOfIterator iter(cx); | ||||
| 52072 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 52073 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52074 | return; | ||||
| 52075 | } | ||||
| 52076 | if (!iter.valueIsIterable()) { | ||||
| 52077 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence"); | ||||
| 52078 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52079 | return; | ||||
| 52080 | } | ||||
| 52081 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue(); | ||||
| 52082 | JS::Rooted<JS::Value> temp(cx); | ||||
| 52083 | while (true) { | ||||
| 52084 | bool done; | ||||
| 52085 | if (!iter.next(&temp, &done)) { | ||||
| 52086 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52087 | return; | ||||
| 52088 | } | ||||
| 52089 | if (done) { | ||||
| 52090 | break; | ||||
| 52091 | } | ||||
| 52092 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 52093 | if (!slotPtr) { | ||||
| 52094 | JS_ReportOutOfMemory(cx); | ||||
| 52095 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52096 | return; | ||||
| 52097 | } | ||||
| 52098 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 52099 | if (temp.isObject()) { | ||||
| 52100 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 52101 | { | ||||
| 52102 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 52103 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 52104 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 52105 | // Be careful to not wrap random DOM objects here, even if | ||||
| 52106 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 52107 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 52108 | // that already has a content reflection... | ||||
| 52109 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 52110 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 52111 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 52112 | if (!callback || | ||||
| 52113 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 52114 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52115 | return; | ||||
| 52116 | } | ||||
| 52117 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 52118 | 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", 52119); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52119; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 52119 | "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", 52119); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52119; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 52120 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 52121 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 52122 | } else { | ||||
| 52123 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "TestJSImplInterface"); | ||||
| 52124 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52125 | return; | ||||
| 52126 | } | ||||
| 52127 | } | ||||
| 52128 | } | ||||
| 52129 | } else { | ||||
| 52130 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence"); | ||||
| 52131 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52132 | return; | ||||
| 52133 | } | ||||
| 52134 | } | ||||
| 52135 | } else if (rval.isNullOrUndefined()) { | ||||
| 52136 | rvalDecl.SetNull(); | ||||
| 52137 | } else { | ||||
| 52138 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence"); | ||||
| 52139 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52140 | return; | ||||
| 52141 | } | ||||
| 52142 | if (rvalDecl.IsNull()) { | ||||
| 52143 | aRetVal.SetNull(); | ||||
| 52144 | } else { | ||||
| 52145 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 52146 | } | ||||
| 52147 | } | ||||
| 52148 | |||||
| 52149 | void | ||||
| 52150 | TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52151 | { | ||||
| 52152 | CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52153 | if (aRv.Failed()) { | ||||
| 52154 | return; | ||||
| 52155 | } | ||||
| 52156 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52156); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52156; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52157 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52158 | |||||
| 52159 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52160 | |||||
| 52161 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52162 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52163 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52164 | !InitIds(cx, atomsCache)) || | ||||
| 52165 | !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectNullableSequence_id, &callable)) { | ||||
| 52166 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52167 | return; | ||||
| 52168 | } | ||||
| 52169 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52170 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52171 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 52172 | aRv.NoteJSContextException(cx); | ||||
| 52173 | return; | ||||
| 52174 | } | ||||
| 52175 | Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl; | ||||
| 52176 | if (rval.isObject()) { | ||||
| 52177 | JS::ForOfIterator iter(cx); | ||||
| 52178 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 52179 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52180 | return; | ||||
| 52181 | } | ||||
| 52182 | if (!iter.valueIsIterable()) { | ||||
| 52183 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence"); | ||||
| 52184 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52185 | return; | ||||
| 52186 | } | ||||
| 52187 | Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue(); | ||||
| 52188 | JS::Rooted<JS::Value> temp(cx); | ||||
| 52189 | while (true) { | ||||
| 52190 | bool done; | ||||
| 52191 | if (!iter.next(&temp, &done)) { | ||||
| 52192 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52193 | return; | ||||
| 52194 | } | ||||
| 52195 | if (done) { | ||||
| 52196 | break; | ||||
| 52197 | } | ||||
| 52198 | RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 52199 | if (!slotPtr) { | ||||
| 52200 | JS_ReportOutOfMemory(cx); | ||||
| 52201 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52202 | return; | ||||
| 52203 | } | ||||
| 52204 | RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr; | ||||
| 52205 | if (temp.isObject()) { | ||||
| 52206 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 52207 | { | ||||
| 52208 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 52209 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx); | ||||
| 52210 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 52211 | // Be careful to not wrap random DOM objects here, even if | ||||
| 52212 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 52213 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 52214 | // that already has a content reflection... | ||||
| 52215 | if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) { | ||||
| 52216 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 52217 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 52218 | if (!callback || | ||||
| 52219 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 52220 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52221 | return; | ||||
| 52222 | } | ||||
| 52223 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject()); | ||||
| 52224 | 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", 52225); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52225; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 52225 | "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", 52225); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 52225; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 52226 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 52227 | slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 52228 | } else { | ||||
| 52229 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "TestJSImplInterface"); | ||||
| 52230 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52231 | return; | ||||
| 52232 | } | ||||
| 52233 | } | ||||
| 52234 | } | ||||
| 52235 | } else if (temp.isNullOrUndefined()) { | ||||
| 52236 | slot = nullptr; | ||||
| 52237 | } else { | ||||
| 52238 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence"); | ||||
| 52239 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52240 | return; | ||||
| 52241 | } | ||||
| 52242 | } | ||||
| 52243 | } else if (rval.isNullOrUndefined()) { | ||||
| 52244 | rvalDecl.SetNull(); | ||||
| 52245 | } else { | ||||
| 52246 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence"); | ||||
| 52247 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52248 | return; | ||||
| 52249 | } | ||||
| 52250 | if (rvalDecl.IsNull()) { | ||||
| 52251 | aRetVal.SetNull(); | ||||
| 52252 | } else { | ||||
| 52253 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 52254 | } | ||||
| 52255 | } | ||||
| 52256 | |||||
| 52257 | void | ||||
| 52258 | TestJSImplInterfaceJSImpl::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52259 | { | ||||
| 52260 | CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52261 | if (aRv.Failed()) { | ||||
| 52262 | return; | ||||
| 52263 | } | ||||
| 52264 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52264); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52264; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52265 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52266 | |||||
| 52267 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52268 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52269 | if (!argv.resize(1)) { | ||||
| 52270 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52271 | // the right thing with that. | ||||
| 52272 | return; | ||||
| 52273 | } | ||||
| 52274 | unsigned argc = 1; | ||||
| 52275 | |||||
| 52276 | do { | ||||
| 52277 | |||||
| 52278 | uint32_t length = arg.Length(); | ||||
| 52279 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52280 | if (!returnArray) { | ||||
| 52281 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52282 | return; | ||||
| 52283 | } | ||||
| 52284 | // Scope for 'tmp' | ||||
| 52285 | { | ||||
| 52286 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52287 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52288 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52289 | // are different ways to succeed at wrapping the object. | ||||
| 52290 | do { | ||||
| 52291 | if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 52292 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 52292); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 52292; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52293 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52294 | return; | ||||
| 52295 | } | ||||
| 52296 | break; | ||||
| 52297 | } while (false); | ||||
| 52298 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52299 | JSPROP_ENUMERATE)) { | ||||
| 52300 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52301 | return; | ||||
| 52302 | } | ||||
| 52303 | } | ||||
| 52304 | } | ||||
| 52305 | argv[0].setObject(*returnArray); | ||||
| 52306 | break; | ||||
| 52307 | } while (false); | ||||
| 52308 | |||||
| 52309 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52310 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52311 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52312 | !InitIds(cx, atomsCache)) || | ||||
| 52313 | !GetCallableProperty(cx, atomsCache->passCastableObjectSequence_id, &callable)) { | ||||
| 52314 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52315 | return; | ||||
| 52316 | } | ||||
| 52317 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52318 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52319 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52320 | aRv.NoteJSContextException(cx); | ||||
| 52321 | return; | ||||
| 52322 | } | ||||
| 52323 | } | ||||
| 52324 | |||||
| 52325 | void | ||||
| 52326 | TestJSImplInterfaceJSImpl::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52327 | { | ||||
| 52328 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52329 | if (aRv.Failed()) { | ||||
| 52330 | return; | ||||
| 52331 | } | ||||
| 52332 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52332); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52332; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52333 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52334 | |||||
| 52335 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52336 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52337 | if (!argv.resize(1)) { | ||||
| 52338 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52339 | // the right thing with that. | ||||
| 52340 | return; | ||||
| 52341 | } | ||||
| 52342 | unsigned argc = 1; | ||||
| 52343 | |||||
| 52344 | do { | ||||
| 52345 | |||||
| 52346 | uint32_t length = arg.Length(); | ||||
| 52347 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52348 | if (!returnArray) { | ||||
| 52349 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52350 | return; | ||||
| 52351 | } | ||||
| 52352 | // Scope for 'tmp' | ||||
| 52353 | { | ||||
| 52354 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52355 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52356 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52357 | // are different ways to succeed at wrapping the object. | ||||
| 52358 | do { | ||||
| 52359 | if (!arg[sequenceIdx0]) { | ||||
| 52360 | tmp.setNull(); | ||||
| 52361 | break; | ||||
| 52362 | } | ||||
| 52363 | if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 52364 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 52364); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 52364; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52365 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52366 | return; | ||||
| 52367 | } | ||||
| 52368 | break; | ||||
| 52369 | } while (false); | ||||
| 52370 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52371 | JSPROP_ENUMERATE)) { | ||||
| 52372 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52373 | return; | ||||
| 52374 | } | ||||
| 52375 | } | ||||
| 52376 | } | ||||
| 52377 | argv[0].setObject(*returnArray); | ||||
| 52378 | break; | ||||
| 52379 | } while (false); | ||||
| 52380 | |||||
| 52381 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52382 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52383 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52384 | !InitIds(cx, atomsCache)) || | ||||
| 52385 | !GetCallableProperty(cx, atomsCache->passNullableCastableObjectSequence_id, &callable)) { | ||||
| 52386 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52387 | return; | ||||
| 52388 | } | ||||
| 52389 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52390 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52391 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52392 | aRv.NoteJSContextException(cx); | ||||
| 52393 | return; | ||||
| 52394 | } | ||||
| 52395 | } | ||||
| 52396 | |||||
| 52397 | void | ||||
| 52398 | TestJSImplInterfaceJSImpl::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52399 | { | ||||
| 52400 | CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52401 | if (aRv.Failed()) { | ||||
| 52402 | return; | ||||
| 52403 | } | ||||
| 52404 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52404); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52404; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52405 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52406 | |||||
| 52407 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52408 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52409 | if (!argv.resize(1)) { | ||||
| 52410 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52411 | // the right thing with that. | ||||
| 52412 | return; | ||||
| 52413 | } | ||||
| 52414 | unsigned argc = 1; | ||||
| 52415 | |||||
| 52416 | do { | ||||
| 52417 | |||||
| 52418 | if (arg.IsNull()) { | ||||
| 52419 | argv[0].setNull(); | ||||
| 52420 | break; | ||||
| 52421 | } | ||||
| 52422 | |||||
| 52423 | uint32_t length = arg.Value().Length(); | ||||
| 52424 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52425 | if (!returnArray) { | ||||
| 52426 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52427 | return; | ||||
| 52428 | } | ||||
| 52429 | // Scope for 'tmp' | ||||
| 52430 | { | ||||
| 52431 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52432 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52433 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52434 | // are different ways to succeed at wrapping the object. | ||||
| 52435 | do { | ||||
| 52436 | if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) { | ||||
| 52437 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 52437); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 52437; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52438 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52439 | return; | ||||
| 52440 | } | ||||
| 52441 | break; | ||||
| 52442 | } while (false); | ||||
| 52443 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52444 | JSPROP_ENUMERATE)) { | ||||
| 52445 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52446 | return; | ||||
| 52447 | } | ||||
| 52448 | } | ||||
| 52449 | } | ||||
| 52450 | argv[0].setObject(*returnArray); | ||||
| 52451 | break; | ||||
| 52452 | } while (false); | ||||
| 52453 | |||||
| 52454 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52455 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52456 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52457 | !InitIds(cx, atomsCache)) || | ||||
| 52458 | !GetCallableProperty(cx, atomsCache->passCastableObjectNullableSequence_id, &callable)) { | ||||
| 52459 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52460 | return; | ||||
| 52461 | } | ||||
| 52462 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52463 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52464 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52465 | aRv.NoteJSContextException(cx); | ||||
| 52466 | return; | ||||
| 52467 | } | ||||
| 52468 | } | ||||
| 52469 | |||||
| 52470 | void | ||||
| 52471 | TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52472 | { | ||||
| 52473 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52474 | if (aRv.Failed()) { | ||||
| 52475 | return; | ||||
| 52476 | } | ||||
| 52477 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52477); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52477; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52478 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52479 | |||||
| 52480 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52481 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52482 | if (!argv.resize(1)) { | ||||
| 52483 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52484 | // the right thing with that. | ||||
| 52485 | return; | ||||
| 52486 | } | ||||
| 52487 | unsigned argc = 1; | ||||
| 52488 | |||||
| 52489 | do { | ||||
| 52490 | |||||
| 52491 | if (arg.IsNull()) { | ||||
| 52492 | argv[0].setNull(); | ||||
| 52493 | break; | ||||
| 52494 | } | ||||
| 52495 | |||||
| 52496 | uint32_t length = arg.Value().Length(); | ||||
| 52497 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52498 | if (!returnArray) { | ||||
| 52499 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52500 | return; | ||||
| 52501 | } | ||||
| 52502 | // Scope for 'tmp' | ||||
| 52503 | { | ||||
| 52504 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52505 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52506 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52507 | // are different ways to succeed at wrapping the object. | ||||
| 52508 | do { | ||||
| 52509 | if (!arg.Value()[sequenceIdx0]) { | ||||
| 52510 | tmp.setNull(); | ||||
| 52511 | break; | ||||
| 52512 | } | ||||
| 52513 | if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) { | ||||
| 52514 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 52514); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 52514; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52515 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52516 | return; | ||||
| 52517 | } | ||||
| 52518 | break; | ||||
| 52519 | } while (false); | ||||
| 52520 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52521 | JSPROP_ENUMERATE)) { | ||||
| 52522 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52523 | return; | ||||
| 52524 | } | ||||
| 52525 | } | ||||
| 52526 | } | ||||
| 52527 | argv[0].setObject(*returnArray); | ||||
| 52528 | break; | ||||
| 52529 | } while (false); | ||||
| 52530 | |||||
| 52531 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52532 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52533 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52534 | !InitIds(cx, atomsCache)) || | ||||
| 52535 | !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableSequence_id, &callable)) { | ||||
| 52536 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52537 | return; | ||||
| 52538 | } | ||||
| 52539 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52540 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52541 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52542 | aRv.NoteJSContextException(cx); | ||||
| 52543 | return; | ||||
| 52544 | } | ||||
| 52545 | } | ||||
| 52546 | |||||
| 52547 | void | ||||
| 52548 | TestJSImplInterfaceJSImpl::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52549 | { | ||||
| 52550 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52551 | if (aRv.Failed()) { | ||||
| 52552 | return; | ||||
| 52553 | } | ||||
| 52554 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52554); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52554; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52555 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52556 | |||||
| 52557 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52558 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52559 | if (!argv.resize(1)) { | ||||
| 52560 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52561 | // the right thing with that. | ||||
| 52562 | return; | ||||
| 52563 | } | ||||
| 52564 | unsigned argc = 1; | ||||
| 52565 | |||||
| 52566 | do { | ||||
| 52567 | if (arg.WasPassed()) { | ||||
| 52568 | |||||
| 52569 | uint32_t length = arg.Value().Length(); | ||||
| 52570 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52571 | if (!returnArray) { | ||||
| 52572 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52573 | return; | ||||
| 52574 | } | ||||
| 52575 | // Scope for 'tmp' | ||||
| 52576 | { | ||||
| 52577 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52578 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52579 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52580 | // are different ways to succeed at wrapping the object. | ||||
| 52581 | do { | ||||
| 52582 | tmp.setInt32(int32_t(arg.Value()[sequenceIdx0])); | ||||
| 52583 | break; | ||||
| 52584 | } while (false); | ||||
| 52585 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52586 | JSPROP_ENUMERATE)) { | ||||
| 52587 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52588 | return; | ||||
| 52589 | } | ||||
| 52590 | } | ||||
| 52591 | } | ||||
| 52592 | argv[0].setObject(*returnArray); | ||||
| 52593 | break; | ||||
| 52594 | } else if (argc == 1) { | ||||
| 52595 | // This is our current trailing argument; reduce argc | ||||
| 52596 | --argc; | ||||
| 52597 | } else { | ||||
| 52598 | argv[0].setUndefined(); | ||||
| 52599 | } | ||||
| 52600 | } while (false); | ||||
| 52601 | |||||
| 52602 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52603 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52604 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52605 | !InitIds(cx, atomsCache)) || | ||||
| 52606 | !GetCallableProperty(cx, atomsCache->passOptionalSequence_id, &callable)) { | ||||
| 52607 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52608 | return; | ||||
| 52609 | } | ||||
| 52610 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52611 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52612 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52613 | aRv.NoteJSContextException(cx); | ||||
| 52614 | return; | ||||
| 52615 | } | ||||
| 52616 | } | ||||
| 52617 | |||||
| 52618 | void | ||||
| 52619 | TestJSImplInterfaceJSImpl::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52620 | { | ||||
| 52621 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52622 | if (aRv.Failed()) { | ||||
| 52623 | return; | ||||
| 52624 | } | ||||
| 52625 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52625); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52625; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52626 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52627 | |||||
| 52628 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52629 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52630 | if (!argv.resize(1)) { | ||||
| 52631 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52632 | // the right thing with that. | ||||
| 52633 | return; | ||||
| 52634 | } | ||||
| 52635 | unsigned argc = 1; | ||||
| 52636 | |||||
| 52637 | do { | ||||
| 52638 | |||||
| 52639 | uint32_t length = arg.Length(); | ||||
| 52640 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52641 | if (!returnArray) { | ||||
| 52642 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52643 | return; | ||||
| 52644 | } | ||||
| 52645 | // Scope for 'tmp' | ||||
| 52646 | { | ||||
| 52647 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52648 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52649 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52650 | // are different ways to succeed at wrapping the object. | ||||
| 52651 | do { | ||||
| 52652 | tmp.setInt32(int32_t(arg[sequenceIdx0])); | ||||
| 52653 | break; | ||||
| 52654 | } while (false); | ||||
| 52655 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52656 | JSPROP_ENUMERATE)) { | ||||
| 52657 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52658 | return; | ||||
| 52659 | } | ||||
| 52660 | } | ||||
| 52661 | } | ||||
| 52662 | argv[0].setObject(*returnArray); | ||||
| 52663 | break; | ||||
| 52664 | } while (false); | ||||
| 52665 | |||||
| 52666 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52667 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52668 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52669 | !InitIds(cx, atomsCache)) || | ||||
| 52670 | !GetCallableProperty(cx, atomsCache->passOptionalSequenceWithDefaultValue_id, &callable)) { | ||||
| 52671 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52672 | return; | ||||
| 52673 | } | ||||
| 52674 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52675 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52676 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52677 | aRv.NoteJSContextException(cx); | ||||
| 52678 | return; | ||||
| 52679 | } | ||||
| 52680 | } | ||||
| 52681 | |||||
| 52682 | void | ||||
| 52683 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52684 | { | ||||
| 52685 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52686 | if (aRv.Failed()) { | ||||
| 52687 | return; | ||||
| 52688 | } | ||||
| 52689 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52689); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52689; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52690 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52691 | |||||
| 52692 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52693 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52694 | if (!argv.resize(1)) { | ||||
| 52695 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52696 | // the right thing with that. | ||||
| 52697 | return; | ||||
| 52698 | } | ||||
| 52699 | unsigned argc = 1; | ||||
| 52700 | |||||
| 52701 | do { | ||||
| 52702 | if (arg.WasPassed()) { | ||||
| 52703 | |||||
| 52704 | if (arg.Value().IsNull()) { | ||||
| 52705 | argv[0].setNull(); | ||||
| 52706 | break; | ||||
| 52707 | } | ||||
| 52708 | |||||
| 52709 | uint32_t length = arg.Value().Value().Length(); | ||||
| 52710 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52711 | if (!returnArray) { | ||||
| 52712 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52713 | return; | ||||
| 52714 | } | ||||
| 52715 | // Scope for 'tmp' | ||||
| 52716 | { | ||||
| 52717 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52718 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52719 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52720 | // are different ways to succeed at wrapping the object. | ||||
| 52721 | do { | ||||
| 52722 | tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0])); | ||||
| 52723 | break; | ||||
| 52724 | } while (false); | ||||
| 52725 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52726 | JSPROP_ENUMERATE)) { | ||||
| 52727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52728 | return; | ||||
| 52729 | } | ||||
| 52730 | } | ||||
| 52731 | } | ||||
| 52732 | argv[0].setObject(*returnArray); | ||||
| 52733 | break; | ||||
| 52734 | } else if (argc == 1) { | ||||
| 52735 | // This is our current trailing argument; reduce argc | ||||
| 52736 | --argc; | ||||
| 52737 | } else { | ||||
| 52738 | argv[0].setUndefined(); | ||||
| 52739 | } | ||||
| 52740 | } while (false); | ||||
| 52741 | |||||
| 52742 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52743 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52744 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52745 | !InitIds(cx, atomsCache)) || | ||||
| 52746 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequence_id, &callable)) { | ||||
| 52747 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52748 | return; | ||||
| 52749 | } | ||||
| 52750 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52751 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52752 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52753 | aRv.NoteJSContextException(cx); | ||||
| 52754 | return; | ||||
| 52755 | } | ||||
| 52756 | } | ||||
| 52757 | |||||
| 52758 | void | ||||
| 52759 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52760 | { | ||||
| 52761 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52762 | if (aRv.Failed()) { | ||||
| 52763 | return; | ||||
| 52764 | } | ||||
| 52765 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52765); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52765; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52766 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52767 | |||||
| 52768 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52769 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52770 | if (!argv.resize(1)) { | ||||
| 52771 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52772 | // the right thing with that. | ||||
| 52773 | return; | ||||
| 52774 | } | ||||
| 52775 | unsigned argc = 1; | ||||
| 52776 | |||||
| 52777 | do { | ||||
| 52778 | |||||
| 52779 | if (arg.IsNull()) { | ||||
| 52780 | argv[0].setNull(); | ||||
| 52781 | break; | ||||
| 52782 | } | ||||
| 52783 | |||||
| 52784 | uint32_t length = arg.Value().Length(); | ||||
| 52785 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52786 | if (!returnArray) { | ||||
| 52787 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52788 | return; | ||||
| 52789 | } | ||||
| 52790 | // Scope for 'tmp' | ||||
| 52791 | { | ||||
| 52792 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52793 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52794 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52795 | // are different ways to succeed at wrapping the object. | ||||
| 52796 | do { | ||||
| 52797 | tmp.setInt32(int32_t(arg.Value()[sequenceIdx0])); | ||||
| 52798 | break; | ||||
| 52799 | } while (false); | ||||
| 52800 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52801 | JSPROP_ENUMERATE)) { | ||||
| 52802 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52803 | return; | ||||
| 52804 | } | ||||
| 52805 | } | ||||
| 52806 | } | ||||
| 52807 | argv[0].setObject(*returnArray); | ||||
| 52808 | break; | ||||
| 52809 | } while (false); | ||||
| 52810 | |||||
| 52811 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52812 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52813 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52814 | !InitIds(cx, atomsCache)) || | ||||
| 52815 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue_id, &callable)) { | ||||
| 52816 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52817 | return; | ||||
| 52818 | } | ||||
| 52819 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52820 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52821 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52822 | aRv.NoteJSContextException(cx); | ||||
| 52823 | return; | ||||
| 52824 | } | ||||
| 52825 | } | ||||
| 52826 | |||||
| 52827 | void | ||||
| 52828 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52829 | { | ||||
| 52830 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52831 | if (aRv.Failed()) { | ||||
| 52832 | return; | ||||
| 52833 | } | ||||
| 52834 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52834); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52834; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52835 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52836 | |||||
| 52837 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52838 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52839 | if (!argv.resize(1)) { | ||||
| 52840 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52841 | // the right thing with that. | ||||
| 52842 | return; | ||||
| 52843 | } | ||||
| 52844 | unsigned argc = 1; | ||||
| 52845 | |||||
| 52846 | do { | ||||
| 52847 | |||||
| 52848 | if (arg.IsNull()) { | ||||
| 52849 | argv[0].setNull(); | ||||
| 52850 | break; | ||||
| 52851 | } | ||||
| 52852 | |||||
| 52853 | uint32_t length = arg.Value().Length(); | ||||
| 52854 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52855 | if (!returnArray) { | ||||
| 52856 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52857 | return; | ||||
| 52858 | } | ||||
| 52859 | // Scope for 'tmp' | ||||
| 52860 | { | ||||
| 52861 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52862 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52863 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52864 | // are different ways to succeed at wrapping the object. | ||||
| 52865 | do { | ||||
| 52866 | tmp.setInt32(int32_t(arg.Value()[sequenceIdx0])); | ||||
| 52867 | break; | ||||
| 52868 | } while (false); | ||||
| 52869 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52870 | JSPROP_ENUMERATE)) { | ||||
| 52871 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52872 | return; | ||||
| 52873 | } | ||||
| 52874 | } | ||||
| 52875 | } | ||||
| 52876 | argv[0].setObject(*returnArray); | ||||
| 52877 | break; | ||||
| 52878 | } while (false); | ||||
| 52879 | |||||
| 52880 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52881 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52882 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52883 | !InitIds(cx, atomsCache)) || | ||||
| 52884 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue2_id, &callable)) { | ||||
| 52885 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52886 | return; | ||||
| 52887 | } | ||||
| 52888 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52889 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52890 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52891 | aRv.NoteJSContextException(cx); | ||||
| 52892 | return; | ||||
| 52893 | } | ||||
| 52894 | } | ||||
| 52895 | |||||
| 52896 | void | ||||
| 52897 | TestJSImplInterfaceJSImpl::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52898 | { | ||||
| 52899 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52900 | if (aRv.Failed()) { | ||||
| 52901 | return; | ||||
| 52902 | } | ||||
| 52903 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52903); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52903; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52904 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52905 | |||||
| 52906 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52907 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52908 | if (!argv.resize(1)) { | ||||
| 52909 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52910 | // the right thing with that. | ||||
| 52911 | return; | ||||
| 52912 | } | ||||
| 52913 | unsigned argc = 1; | ||||
| 52914 | |||||
| 52915 | do { | ||||
| 52916 | if (arg.WasPassed()) { | ||||
| 52917 | |||||
| 52918 | uint32_t length = arg.Value().Length(); | ||||
| 52919 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52920 | if (!returnArray) { | ||||
| 52921 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52922 | return; | ||||
| 52923 | } | ||||
| 52924 | // Scope for 'tmp' | ||||
| 52925 | { | ||||
| 52926 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 52927 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 52928 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 52929 | // are different ways to succeed at wrapping the object. | ||||
| 52930 | do { | ||||
| 52931 | if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) { | ||||
| 52932 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 52932); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 52932; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52933 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52934 | return; | ||||
| 52935 | } | ||||
| 52936 | break; | ||||
| 52937 | } while (false); | ||||
| 52938 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 52939 | JSPROP_ENUMERATE)) { | ||||
| 52940 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52941 | return; | ||||
| 52942 | } | ||||
| 52943 | } | ||||
| 52944 | } | ||||
| 52945 | argv[0].setObject(*returnArray); | ||||
| 52946 | break; | ||||
| 52947 | } else if (argc == 1) { | ||||
| 52948 | // This is our current trailing argument; reduce argc | ||||
| 52949 | --argc; | ||||
| 52950 | } else { | ||||
| 52951 | argv[0].setUndefined(); | ||||
| 52952 | } | ||||
| 52953 | } while (false); | ||||
| 52954 | |||||
| 52955 | JS::Rooted<JS::Value> callable(cx); | ||||
| 52956 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 52957 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 52958 | !InitIds(cx, atomsCache)) || | ||||
| 52959 | !GetCallableProperty(cx, atomsCache->passOptionalObjectSequence_id, &callable)) { | ||||
| 52960 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52961 | return; | ||||
| 52962 | } | ||||
| 52963 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 52964 | if (!JS::Call(cx, thisValue, callable, | ||||
| 52965 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 52966 | aRv.NoteJSContextException(cx); | ||||
| 52967 | return; | ||||
| 52968 | } | ||||
| 52969 | } | ||||
| 52970 | |||||
| 52971 | void | ||||
| 52972 | TestJSImplInterfaceJSImpl::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 52973 | { | ||||
| 52974 | CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 52975 | if (aRv.Failed()) { | ||||
| 52976 | return; | ||||
| 52977 | } | ||||
| 52978 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 52978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 52978; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 52979 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 52980 | |||||
| 52981 | JS::Rooted<JS::Value> rval(cx); | ||||
| 52982 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 52983 | if (!argv.resize(1)) { | ||||
| 52984 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 52985 | // the right thing with that. | ||||
| 52986 | return; | ||||
| 52987 | } | ||||
| 52988 | unsigned argc = 1; | ||||
| 52989 | |||||
| 52990 | do { | ||||
| 52991 | |||||
| 52992 | uint32_t length = arg.Length(); | ||||
| 52993 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 52994 | if (!returnArray) { | ||||
| 52995 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 52996 | return; | ||||
| 52997 | } | ||||
| 52998 | // Scope for 'tmp' | ||||
| 52999 | { | ||||
| 53000 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53001 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 53002 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53003 | // are different ways to succeed at wrapping the object. | ||||
| 53004 | do { | ||||
| 53005 | if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 53006 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53007 | return; | ||||
| 53008 | } | ||||
| 53009 | break; | ||||
| 53010 | } while (false); | ||||
| 53011 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 53012 | JSPROP_ENUMERATE)) { | ||||
| 53013 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53014 | return; | ||||
| 53015 | } | ||||
| 53016 | } | ||||
| 53017 | } | ||||
| 53018 | argv[0].setObject(*returnArray); | ||||
| 53019 | break; | ||||
| 53020 | } while (false); | ||||
| 53021 | |||||
| 53022 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53023 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53024 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53025 | !InitIds(cx, atomsCache)) || | ||||
| 53026 | !GetCallableProperty(cx, atomsCache->passExternalInterfaceSequence_id, &callable)) { | ||||
| 53027 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53028 | return; | ||||
| 53029 | } | ||||
| 53030 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53031 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53032 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53033 | aRv.NoteJSContextException(cx); | ||||
| 53034 | return; | ||||
| 53035 | } | ||||
| 53036 | } | ||||
| 53037 | |||||
| 53038 | void | ||||
| 53039 | TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53040 | { | ||||
| 53041 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53042 | if (aRv.Failed()) { | ||||
| 53043 | return; | ||||
| 53044 | } | ||||
| 53045 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53045); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53045; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53046 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53047 | |||||
| 53048 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53049 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 53050 | if (!argv.resize(1)) { | ||||
| 53051 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 53052 | // the right thing with that. | ||||
| 53053 | return; | ||||
| 53054 | } | ||||
| 53055 | unsigned argc = 1; | ||||
| 53056 | |||||
| 53057 | do { | ||||
| 53058 | |||||
| 53059 | uint32_t length = arg.Length(); | ||||
| 53060 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53061 | if (!returnArray) { | ||||
| 53062 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53063 | return; | ||||
| 53064 | } | ||||
| 53065 | // Scope for 'tmp' | ||||
| 53066 | { | ||||
| 53067 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53068 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 53069 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53070 | // are different ways to succeed at wrapping the object. | ||||
| 53071 | do { | ||||
| 53072 | if (!arg[sequenceIdx0]) { | ||||
| 53073 | tmp.setNull(); | ||||
| 53074 | break; | ||||
| 53075 | } | ||||
| 53076 | if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 53077 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53078 | return; | ||||
| 53079 | } | ||||
| 53080 | break; | ||||
| 53081 | } while (false); | ||||
| 53082 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 53083 | JSPROP_ENUMERATE)) { | ||||
| 53084 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53085 | return; | ||||
| 53086 | } | ||||
| 53087 | } | ||||
| 53088 | } | ||||
| 53089 | argv[0].setObject(*returnArray); | ||||
| 53090 | break; | ||||
| 53091 | } while (false); | ||||
| 53092 | |||||
| 53093 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53094 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53095 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53096 | !InitIds(cx, atomsCache)) || | ||||
| 53097 | !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceSequence_id, &callable)) { | ||||
| 53098 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53099 | return; | ||||
| 53100 | } | ||||
| 53101 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53102 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53103 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53104 | aRv.NoteJSContextException(cx); | ||||
| 53105 | return; | ||||
| 53106 | } | ||||
| 53107 | } | ||||
| 53108 | |||||
| 53109 | void | ||||
| 53110 | TestJSImplInterfaceJSImpl::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53111 | { | ||||
| 53112 | CallSetup s(this, aRv, "TestJSImplInterface.receiveStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53113 | if (aRv.Failed()) { | ||||
| 53114 | return; | ||||
| 53115 | } | ||||
| 53116 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53116; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53117 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53118 | |||||
| 53119 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53120 | |||||
| 53121 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53122 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53123 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53124 | !InitIds(cx, atomsCache)) || | ||||
| 53125 | !GetCallableProperty(cx, atomsCache->receiveStringSequence_id, &callable)) { | ||||
| 53126 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53127 | return; | ||||
| 53128 | } | ||||
| 53129 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53130 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53131 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53132 | aRv.NoteJSContextException(cx); | ||||
| 53133 | return; | ||||
| 53134 | } | ||||
| 53135 | Sequence<nsString> rvalDecl; | ||||
| 53136 | if (rval.isObject()) { | ||||
| 53137 | JS::ForOfIterator iter(cx); | ||||
| 53138 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53139 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53140 | return; | ||||
| 53141 | } | ||||
| 53142 | if (!iter.valueIsIterable()) { | ||||
| 53143 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence"); | ||||
| 53144 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53145 | return; | ||||
| 53146 | } | ||||
| 53147 | Sequence<nsString> &arr = rvalDecl; | ||||
| 53148 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53149 | while (true) { | ||||
| 53150 | bool done; | ||||
| 53151 | if (!iter.next(&temp, &done)) { | ||||
| 53152 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53153 | return; | ||||
| 53154 | } | ||||
| 53155 | if (done) { | ||||
| 53156 | break; | ||||
| 53157 | } | ||||
| 53158 | nsString* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 53159 | if (!slotPtr) { | ||||
| 53160 | JS_ReportOutOfMemory(cx); | ||||
| 53161 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53162 | return; | ||||
| 53163 | } | ||||
| 53164 | nsString& slot = *slotPtr; | ||||
| 53165 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | ||||
| 53166 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53167 | return; | ||||
| 53168 | } | ||||
| 53169 | } | ||||
| 53170 | } else { | ||||
| 53171 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence"); | ||||
| 53172 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53173 | return; | ||||
| 53174 | } | ||||
| 53175 | aRetVal = std::move(rvalDecl); | ||||
| 53176 | } | ||||
| 53177 | |||||
| 53178 | void | ||||
| 53179 | TestJSImplInterfaceJSImpl::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53180 | { | ||||
| 53181 | CallSetup s(this, aRv, "TestJSImplInterface.receiveByteStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53182 | if (aRv.Failed()) { | ||||
| 53183 | return; | ||||
| 53184 | } | ||||
| 53185 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53185); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53185; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53186 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53187 | |||||
| 53188 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53189 | |||||
| 53190 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53191 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53192 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53193 | !InitIds(cx, atomsCache)) || | ||||
| 53194 | !GetCallableProperty(cx, atomsCache->receiveByteStringSequence_id, &callable)) { | ||||
| 53195 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53196 | return; | ||||
| 53197 | } | ||||
| 53198 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53199 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53200 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53201 | aRv.NoteJSContextException(cx); | ||||
| 53202 | return; | ||||
| 53203 | } | ||||
| 53204 | Sequence<nsCString> rvalDecl; | ||||
| 53205 | if (rval.isObject()) { | ||||
| 53206 | JS::ForOfIterator iter(cx); | ||||
| 53207 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53208 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53209 | return; | ||||
| 53210 | } | ||||
| 53211 | if (!iter.valueIsIterable()) { | ||||
| 53212 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence"); | ||||
| 53213 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53214 | return; | ||||
| 53215 | } | ||||
| 53216 | Sequence<nsCString> &arr = rvalDecl; | ||||
| 53217 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53218 | while (true) { | ||||
| 53219 | bool done; | ||||
| 53220 | if (!iter.next(&temp, &done)) { | ||||
| 53221 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53222 | return; | ||||
| 53223 | } | ||||
| 53224 | if (done) { | ||||
| 53225 | break; | ||||
| 53226 | } | ||||
| 53227 | nsCString* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 53228 | if (!slotPtr) { | ||||
| 53229 | JS_ReportOutOfMemory(cx); | ||||
| 53230 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53231 | return; | ||||
| 53232 | } | ||||
| 53233 | nsCString& slot = *slotPtr; | ||||
| 53234 | if (!ConvertJSValueToByteString(cx, temp, false, "element of return value of TestJSImplInterface.receiveByteStringSequence", slot)) { | ||||
| 53235 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53236 | return; | ||||
| 53237 | } | ||||
| 53238 | } | ||||
| 53239 | } else { | ||||
| 53240 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence"); | ||||
| 53241 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53242 | return; | ||||
| 53243 | } | ||||
| 53244 | aRetVal = std::move(rvalDecl); | ||||
| 53245 | } | ||||
| 53246 | |||||
| 53247 | void | ||||
| 53248 | TestJSImplInterfaceJSImpl::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53249 | { | ||||
| 53250 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUTF8StringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53251 | if (aRv.Failed()) { | ||||
| 53252 | return; | ||||
| 53253 | } | ||||
| 53254 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53254); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53254; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53255 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53256 | |||||
| 53257 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53258 | |||||
| 53259 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53260 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53261 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53262 | !InitIds(cx, atomsCache)) || | ||||
| 53263 | !GetCallableProperty(cx, atomsCache->receiveUTF8StringSequence_id, &callable)) { | ||||
| 53264 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53265 | return; | ||||
| 53266 | } | ||||
| 53267 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53268 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53269 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53270 | aRv.NoteJSContextException(cx); | ||||
| 53271 | return; | ||||
| 53272 | } | ||||
| 53273 | Sequence<nsCString> rvalDecl; | ||||
| 53274 | if (rval.isObject()) { | ||||
| 53275 | JS::ForOfIterator iter(cx); | ||||
| 53276 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53277 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53278 | return; | ||||
| 53279 | } | ||||
| 53280 | if (!iter.valueIsIterable()) { | ||||
| 53281 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence"); | ||||
| 53282 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53283 | return; | ||||
| 53284 | } | ||||
| 53285 | Sequence<nsCString> &arr = rvalDecl; | ||||
| 53286 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53287 | while (true) { | ||||
| 53288 | bool done; | ||||
| 53289 | if (!iter.next(&temp, &done)) { | ||||
| 53290 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53291 | return; | ||||
| 53292 | } | ||||
| 53293 | if (done) { | ||||
| 53294 | break; | ||||
| 53295 | } | ||||
| 53296 | nsCString* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 53297 | if (!slotPtr) { | ||||
| 53298 | JS_ReportOutOfMemory(cx); | ||||
| 53299 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53300 | return; | ||||
| 53301 | } | ||||
| 53302 | nsCString& slot = *slotPtr; | ||||
| 53303 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | ||||
| 53304 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53305 | return; | ||||
| 53306 | } | ||||
| 53307 | } | ||||
| 53308 | } else { | ||||
| 53309 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence"); | ||||
| 53310 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53311 | return; | ||||
| 53312 | } | ||||
| 53313 | aRetVal = std::move(rvalDecl); | ||||
| 53314 | } | ||||
| 53315 | |||||
| 53316 | void | ||||
| 53317 | TestJSImplInterfaceJSImpl::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53318 | { | ||||
| 53319 | CallSetup s(this, aRv, "TestJSImplInterface.receiveAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53320 | if (aRv.Failed()) { | ||||
| 53321 | return; | ||||
| 53322 | } | ||||
| 53323 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53323); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53323; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53324 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53325 | |||||
| 53326 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53327 | |||||
| 53328 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53329 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53330 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53331 | !InitIds(cx, atomsCache)) || | ||||
| 53332 | !GetCallableProperty(cx, atomsCache->receiveAnySequence_id, &callable)) { | ||||
| 53333 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53334 | return; | ||||
| 53335 | } | ||||
| 53336 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53337 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53338 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53339 | aRv.NoteJSContextException(cx); | ||||
| 53340 | return; | ||||
| 53341 | } | ||||
| 53342 | Sequence<JS::Value> rvalDecl; | ||||
| 53343 | SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl); | ||||
| 53344 | if (rval.isObject()) { | ||||
| 53345 | JS::ForOfIterator iter(cx); | ||||
| 53346 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53347 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53348 | return; | ||||
| 53349 | } | ||||
| 53350 | if (!iter.valueIsIterable()) { | ||||
| 53351 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence"); | ||||
| 53352 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53353 | return; | ||||
| 53354 | } | ||||
| 53355 | Sequence<JS::Value> &arr = rvalDecl; | ||||
| 53356 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53357 | while (true) { | ||||
| 53358 | bool done; | ||||
| 53359 | if (!iter.next(&temp, &done)) { | ||||
| 53360 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53361 | return; | ||||
| 53362 | } | ||||
| 53363 | if (done) { | ||||
| 53364 | break; | ||||
| 53365 | } | ||||
| 53366 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 53367 | if (!slotPtr) { | ||||
| 53368 | JS_ReportOutOfMemory(cx); | ||||
| 53369 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53370 | return; | ||||
| 53371 | } | ||||
| 53372 | JS::Value& slot = *slotPtr; | ||||
| 53373 | #ifdef __clang__1 | ||||
| 53374 | #pragma clang diagnostic push | ||||
| 53375 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 53376 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 53377 | #endif // __clang__ | ||||
| 53378 | if ((false) && !CallerSubsumes(temp)) { | ||||
| 53379 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveAnySequence"); | ||||
| 53380 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53381 | return; | ||||
| 53382 | } | ||||
| 53383 | #ifdef __clang__1 | ||||
| 53384 | #pragma clang diagnostic pop | ||||
| 53385 | #endif // __clang__ | ||||
| 53386 | slot = temp; | ||||
| 53387 | } | ||||
| 53388 | } else { | ||||
| 53389 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence"); | ||||
| 53390 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53391 | return; | ||||
| 53392 | } | ||||
| 53393 | aRetVal = std::move(rvalDecl); | ||||
| 53394 | } | ||||
| 53395 | |||||
| 53396 | void | ||||
| 53397 | TestJSImplInterfaceJSImpl::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53398 | { | ||||
| 53399 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53400 | if (aRv.Failed()) { | ||||
| 53401 | return; | ||||
| 53402 | } | ||||
| 53403 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53403); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53403; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53404 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53405 | |||||
| 53406 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53407 | |||||
| 53408 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53409 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53410 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53411 | !InitIds(cx, atomsCache)) || | ||||
| 53412 | !GetCallableProperty(cx, atomsCache->receiveNullableAnySequence_id, &callable)) { | ||||
| 53413 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53414 | return; | ||||
| 53415 | } | ||||
| 53416 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53417 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53418 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53419 | aRv.NoteJSContextException(cx); | ||||
| 53420 | return; | ||||
| 53421 | } | ||||
| 53422 | Nullable<Sequence<JS::Value>> rvalDecl; | ||||
| 53423 | SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl.SetValue()); | ||||
| 53424 | if (rval.isObject()) { | ||||
| 53425 | JS::ForOfIterator iter(cx); | ||||
| 53426 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53427 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53428 | return; | ||||
| 53429 | } | ||||
| 53430 | if (!iter.valueIsIterable()) { | ||||
| 53431 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence"); | ||||
| 53432 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53433 | return; | ||||
| 53434 | } | ||||
| 53435 | Sequence<JS::Value> &arr = rvalDecl.SetValue(); | ||||
| 53436 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53437 | while (true) { | ||||
| 53438 | bool done; | ||||
| 53439 | if (!iter.next(&temp, &done)) { | ||||
| 53440 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53441 | return; | ||||
| 53442 | } | ||||
| 53443 | if (done) { | ||||
| 53444 | break; | ||||
| 53445 | } | ||||
| 53446 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | ||||
| 53447 | if (!slotPtr) { | ||||
| 53448 | JS_ReportOutOfMemory(cx); | ||||
| 53449 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53450 | return; | ||||
| 53451 | } | ||||
| 53452 | JS::Value& slot = *slotPtr; | ||||
| 53453 | #ifdef __clang__1 | ||||
| 53454 | #pragma clang diagnostic push | ||||
| 53455 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 53456 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 53457 | #endif // __clang__ | ||||
| 53458 | if ((false) && !CallerSubsumes(temp)) { | ||||
| 53459 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableAnySequence"); | ||||
| 53460 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53461 | return; | ||||
| 53462 | } | ||||
| 53463 | #ifdef __clang__1 | ||||
| 53464 | #pragma clang diagnostic pop | ||||
| 53465 | #endif // __clang__ | ||||
| 53466 | slot = temp; | ||||
| 53467 | } | ||||
| 53468 | } else if (rval.isNullOrUndefined()) { | ||||
| 53469 | rvalDecl.SetNull(); | ||||
| 53470 | } else { | ||||
| 53471 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence"); | ||||
| 53472 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53473 | return; | ||||
| 53474 | } | ||||
| 53475 | if (rvalDecl.IsNull()) { | ||||
| 53476 | aRetVal.SetNull(); | ||||
| 53477 | } else { | ||||
| 53478 | aRetVal.SetValue() = std::move(rvalDecl.Value()); | ||||
| 53479 | } | ||||
| 53480 | } | ||||
| 53481 | |||||
| 53482 | void | ||||
| 53483 | TestJSImplInterfaceJSImpl::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53484 | { | ||||
| 53485 | CallSetup s(this, aRv, "TestJSImplInterface.receiveObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53486 | if (aRv.Failed()) { | ||||
| 53487 | return; | ||||
| 53488 | } | ||||
| 53489 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53489); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53489; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53490 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53491 | |||||
| 53492 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53493 | |||||
| 53494 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53495 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53496 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53497 | !InitIds(cx, atomsCache)) || | ||||
| 53498 | !GetCallableProperty(cx, atomsCache->receiveObjectSequence_id, &callable)) { | ||||
| 53499 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53500 | return; | ||||
| 53501 | } | ||||
| 53502 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53503 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53504 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53505 | aRv.NoteJSContextException(cx); | ||||
| 53506 | return; | ||||
| 53507 | } | ||||
| 53508 | Sequence<JSObject*> rvalDecl; | ||||
| 53509 | SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl); | ||||
| 53510 | if (rval.isObject()) { | ||||
| 53511 | JS::ForOfIterator iter(cx); | ||||
| 53512 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53513 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53514 | return; | ||||
| 53515 | } | ||||
| 53516 | if (!iter.valueIsIterable()) { | ||||
| 53517 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence"); | ||||
| 53518 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53519 | return; | ||||
| 53520 | } | ||||
| 53521 | Sequence<JSObject*> &arr = rvalDecl; | ||||
| 53522 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53523 | while (true) { | ||||
| 53524 | bool done; | ||||
| 53525 | if (!iter.next(&temp, &done)) { | ||||
| 53526 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53527 | return; | ||||
| 53528 | } | ||||
| 53529 | if (done) { | ||||
| 53530 | break; | ||||
| 53531 | } | ||||
| 53532 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | ||||
| 53533 | if (!slotPtr) { | ||||
| 53534 | JS_ReportOutOfMemory(cx); | ||||
| 53535 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53536 | return; | ||||
| 53537 | } | ||||
| 53538 | JSObject*& slot = *slotPtr; | ||||
| 53539 | if (temp.isObject()) { | ||||
| 53540 | #ifdef __clang__1 | ||||
| 53541 | #pragma clang diagnostic push | ||||
| 53542 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 53543 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 53544 | #endif // __clang__ | ||||
| 53545 | if ((false) && !CallerSubsumes(temp)) { | ||||
| 53546 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveObjectSequence"); | ||||
| 53547 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53548 | return; | ||||
| 53549 | } | ||||
| 53550 | #ifdef __clang__1 | ||||
| 53551 | #pragma clang diagnostic pop | ||||
| 53552 | #endif // __clang__ | ||||
| 53553 | slot = &temp.toObject(); | ||||
| 53554 | } else { | ||||
| 53555 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveObjectSequence"); | ||||
| 53556 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53557 | return; | ||||
| 53558 | } | ||||
| 53559 | } | ||||
| 53560 | } else { | ||||
| 53561 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence"); | ||||
| 53562 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53563 | return; | ||||
| 53564 | } | ||||
| 53565 | aRetVal = std::move(rvalDecl); | ||||
| 53566 | } | ||||
| 53567 | |||||
| 53568 | void | ||||
| 53569 | TestJSImplInterfaceJSImpl::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53570 | { | ||||
| 53571 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53572 | if (aRv.Failed()) { | ||||
| 53573 | return; | ||||
| 53574 | } | ||||
| 53575 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53575); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53575; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53576 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53577 | |||||
| 53578 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53579 | |||||
| 53580 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53581 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53582 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53583 | !InitIds(cx, atomsCache)) || | ||||
| 53584 | !GetCallableProperty(cx, atomsCache->receiveNullableObjectSequence_id, &callable)) { | ||||
| 53585 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53586 | return; | ||||
| 53587 | } | ||||
| 53588 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53589 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53590 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 53591 | aRv.NoteJSContextException(cx); | ||||
| 53592 | return; | ||||
| 53593 | } | ||||
| 53594 | Sequence<JSObject*> rvalDecl; | ||||
| 53595 | SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl); | ||||
| 53596 | if (rval.isObject()) { | ||||
| 53597 | JS::ForOfIterator iter(cx); | ||||
| 53598 | if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) { | ||||
| 53599 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53600 | return; | ||||
| 53601 | } | ||||
| 53602 | if (!iter.valueIsIterable()) { | ||||
| 53603 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence"); | ||||
| 53604 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53605 | return; | ||||
| 53606 | } | ||||
| 53607 | Sequence<JSObject*> &arr = rvalDecl; | ||||
| 53608 | JS::Rooted<JS::Value> temp(cx); | ||||
| 53609 | while (true) { | ||||
| 53610 | bool done; | ||||
| 53611 | if (!iter.next(&temp, &done)) { | ||||
| 53612 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53613 | return; | ||||
| 53614 | } | ||||
| 53615 | if (done) { | ||||
| 53616 | break; | ||||
| 53617 | } | ||||
| 53618 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | ||||
| 53619 | if (!slotPtr) { | ||||
| 53620 | JS_ReportOutOfMemory(cx); | ||||
| 53621 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53622 | return; | ||||
| 53623 | } | ||||
| 53624 | JSObject*& slot = *slotPtr; | ||||
| 53625 | if (temp.isObject()) { | ||||
| 53626 | #ifdef __clang__1 | ||||
| 53627 | #pragma clang diagnostic push | ||||
| 53628 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 53629 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 53630 | #endif // __clang__ | ||||
| 53631 | if ((false) && !CallerSubsumes(temp)) { | ||||
| 53632 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableObjectSequence"); | ||||
| 53633 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53634 | return; | ||||
| 53635 | } | ||||
| 53636 | #ifdef __clang__1 | ||||
| 53637 | #pragma clang diagnostic pop | ||||
| 53638 | #endif // __clang__ | ||||
| 53639 | slot = &temp.toObject(); | ||||
| 53640 | } else if (temp.isNullOrUndefined()) { | ||||
| 53641 | slot = nullptr; | ||||
| 53642 | } else { | ||||
| 53643 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableObjectSequence"); | ||||
| 53644 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53645 | return; | ||||
| 53646 | } | ||||
| 53647 | } | ||||
| 53648 | } else { | ||||
| 53649 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence"); | ||||
| 53650 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53651 | return; | ||||
| 53652 | } | ||||
| 53653 | aRetVal = std::move(rvalDecl); | ||||
| 53654 | } | ||||
| 53655 | |||||
| 53656 | void | ||||
| 53657 | TestJSImplInterfaceJSImpl::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53658 | { | ||||
| 53659 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53660 | if (aRv.Failed()) { | ||||
| 53661 | return; | ||||
| 53662 | } | ||||
| 53663 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53663); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53663; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53664 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53665 | |||||
| 53666 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53667 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 53668 | if (!argv.resize(1)) { | ||||
| 53669 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 53670 | // the right thing with that. | ||||
| 53671 | return; | ||||
| 53672 | } | ||||
| 53673 | unsigned argc = 1; | ||||
| 53674 | |||||
| 53675 | do { | ||||
| 53676 | |||||
| 53677 | uint32_t length = arg.Length(); | ||||
| 53678 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53679 | if (!returnArray) { | ||||
| 53680 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53681 | return; | ||||
| 53682 | } | ||||
| 53683 | // Scope for 'tmp' | ||||
| 53684 | { | ||||
| 53685 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53686 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 53687 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53688 | // are different ways to succeed at wrapping the object. | ||||
| 53689 | do { | ||||
| 53690 | |||||
| 53691 | uint32_t length = arg[sequenceIdx0].Length(); | ||||
| 53692 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53693 | if (!returnArray) { | ||||
| 53694 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53695 | return; | ||||
| 53696 | } | ||||
| 53697 | // Scope for 'tmp' | ||||
| 53698 | { | ||||
| 53699 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53700 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 53701 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53702 | // are different ways to succeed at wrapping the object. | ||||
| 53703 | do { | ||||
| 53704 | tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1])); | ||||
| 53705 | break; | ||||
| 53706 | } while (false); | ||||
| 53707 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 53708 | JSPROP_ENUMERATE)) { | ||||
| 53709 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53710 | return; | ||||
| 53711 | } | ||||
| 53712 | } | ||||
| 53713 | } | ||||
| 53714 | tmp.setObject(*returnArray); | ||||
| 53715 | break; | ||||
| 53716 | } while (false); | ||||
| 53717 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 53718 | JSPROP_ENUMERATE)) { | ||||
| 53719 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53720 | return; | ||||
| 53721 | } | ||||
| 53722 | } | ||||
| 53723 | } | ||||
| 53724 | argv[0].setObject(*returnArray); | ||||
| 53725 | break; | ||||
| 53726 | } while (false); | ||||
| 53727 | |||||
| 53728 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53729 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53730 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53731 | !InitIds(cx, atomsCache)) || | ||||
| 53732 | !GetCallableProperty(cx, atomsCache->passSequenceOfSequences_id, &callable)) { | ||||
| 53733 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53734 | return; | ||||
| 53735 | } | ||||
| 53736 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53737 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53738 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53739 | aRv.NoteJSContextException(cx); | ||||
| 53740 | return; | ||||
| 53741 | } | ||||
| 53742 | } | ||||
| 53743 | |||||
| 53744 | void | ||||
| 53745 | TestJSImplInterfaceJSImpl::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53746 | { | ||||
| 53747 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequencesOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53748 | if (aRv.Failed()) { | ||||
| 53749 | return; | ||||
| 53750 | } | ||||
| 53751 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53751; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53752 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53753 | |||||
| 53754 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53755 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 53756 | if (!argv.resize(1)) { | ||||
| 53757 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 53758 | // the right thing with that. | ||||
| 53759 | return; | ||||
| 53760 | } | ||||
| 53761 | unsigned argc = 1; | ||||
| 53762 | |||||
| 53763 | do { | ||||
| 53764 | |||||
| 53765 | uint32_t length = arg.Length(); | ||||
| 53766 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53767 | if (!returnArray) { | ||||
| 53768 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53769 | return; | ||||
| 53770 | } | ||||
| 53771 | // Scope for 'tmp' | ||||
| 53772 | { | ||||
| 53773 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53774 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 53775 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53776 | // are different ways to succeed at wrapping the object. | ||||
| 53777 | do { | ||||
| 53778 | |||||
| 53779 | uint32_t length = arg[sequenceIdx0].Length(); | ||||
| 53780 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53781 | if (!returnArray) { | ||||
| 53782 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53783 | return; | ||||
| 53784 | } | ||||
| 53785 | // Scope for 'tmp' | ||||
| 53786 | { | ||||
| 53787 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53788 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 53789 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53790 | // are different ways to succeed at wrapping the object. | ||||
| 53791 | do { | ||||
| 53792 | |||||
| 53793 | uint32_t length = arg[sequenceIdx0][sequenceIdx1].Length(); | ||||
| 53794 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 53795 | if (!returnArray) { | ||||
| 53796 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53797 | return; | ||||
| 53798 | } | ||||
| 53799 | // Scope for 'tmp' | ||||
| 53800 | { | ||||
| 53801 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53802 | for (uint32_t sequenceIdx2 = 0; sequenceIdx2 < length; ++sequenceIdx2) { | ||||
| 53803 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 53804 | // are different ways to succeed at wrapping the object. | ||||
| 53805 | do { | ||||
| 53806 | tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1][sequenceIdx2])); | ||||
| 53807 | break; | ||||
| 53808 | } while (false); | ||||
| 53809 | if (!JS_DefineElement(cx, returnArray, sequenceIdx2, tmp, | ||||
| 53810 | JSPROP_ENUMERATE)) { | ||||
| 53811 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53812 | return; | ||||
| 53813 | } | ||||
| 53814 | } | ||||
| 53815 | } | ||||
| 53816 | tmp.setObject(*returnArray); | ||||
| 53817 | break; | ||||
| 53818 | } while (false); | ||||
| 53819 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 53820 | JSPROP_ENUMERATE)) { | ||||
| 53821 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53822 | return; | ||||
| 53823 | } | ||||
| 53824 | } | ||||
| 53825 | } | ||||
| 53826 | tmp.setObject(*returnArray); | ||||
| 53827 | break; | ||||
| 53828 | } while (false); | ||||
| 53829 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 53830 | JSPROP_ENUMERATE)) { | ||||
| 53831 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53832 | return; | ||||
| 53833 | } | ||||
| 53834 | } | ||||
| 53835 | } | ||||
| 53836 | argv[0].setObject(*returnArray); | ||||
| 53837 | break; | ||||
| 53838 | } while (false); | ||||
| 53839 | |||||
| 53840 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53841 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53842 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53843 | !InitIds(cx, atomsCache)) || | ||||
| 53844 | !GetCallableProperty(cx, atomsCache->passSequenceOfSequencesOfSequences_id, &callable)) { | ||||
| 53845 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53846 | return; | ||||
| 53847 | } | ||||
| 53848 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53849 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53850 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53851 | aRv.NoteJSContextException(cx); | ||||
| 53852 | return; | ||||
| 53853 | } | ||||
| 53854 | } | ||||
| 53855 | |||||
| 53856 | void | ||||
| 53857 | TestJSImplInterfaceJSImpl::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53858 | { | ||||
| 53859 | CallSetup s(this, aRv, "TestJSImplInterface.passRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53860 | if (aRv.Failed()) { | ||||
| 53861 | return; | ||||
| 53862 | } | ||||
| 53863 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53863); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53863; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53864 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53865 | |||||
| 53866 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53867 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 53868 | if (!argv.resize(1)) { | ||||
| 53869 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 53870 | // the right thing with that. | ||||
| 53871 | return; | ||||
| 53872 | } | ||||
| 53873 | unsigned argc = 1; | ||||
| 53874 | |||||
| 53875 | do { | ||||
| 53876 | |||||
| 53877 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 53878 | if (!returnObj) { | ||||
| 53879 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53880 | return; | ||||
| 53881 | } | ||||
| 53882 | // Scope for 'tmp' | ||||
| 53883 | { | ||||
| 53884 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53885 | for (auto& entry : arg.Entries()) { | ||||
| 53886 | auto& recordValue0 = entry.mValue; | ||||
| 53887 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 53888 | // are different ways to succeed at wrapping the value. | ||||
| 53889 | do { | ||||
| 53890 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 53891 | break; | ||||
| 53892 | } while (false); | ||||
| 53893 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 53894 | entry.mKey.BeginReading(), | ||||
| 53895 | entry.mKey.Length(), tmp, | ||||
| 53896 | JSPROP_ENUMERATE)) { | ||||
| 53897 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53898 | return; | ||||
| 53899 | } | ||||
| 53900 | } | ||||
| 53901 | } | ||||
| 53902 | argv[0].setObject(*returnObj); | ||||
| 53903 | break; | ||||
| 53904 | } while (false); | ||||
| 53905 | |||||
| 53906 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53907 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53908 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53909 | !InitIds(cx, atomsCache)) || | ||||
| 53910 | !GetCallableProperty(cx, atomsCache->passRecord_id, &callable)) { | ||||
| 53911 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53912 | return; | ||||
| 53913 | } | ||||
| 53914 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53915 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53916 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53917 | aRv.NoteJSContextException(cx); | ||||
| 53918 | return; | ||||
| 53919 | } | ||||
| 53920 | } | ||||
| 53921 | |||||
| 53922 | void | ||||
| 53923 | TestJSImplInterfaceJSImpl::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53924 | { | ||||
| 53925 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53926 | if (aRv.Failed()) { | ||||
| 53927 | return; | ||||
| 53928 | } | ||||
| 53929 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 53929); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 53929; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 53930 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 53931 | |||||
| 53932 | JS::Rooted<JS::Value> rval(cx); | ||||
| 53933 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 53934 | if (!argv.resize(1)) { | ||||
| 53935 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 53936 | // the right thing with that. | ||||
| 53937 | return; | ||||
| 53938 | } | ||||
| 53939 | unsigned argc = 1; | ||||
| 53940 | |||||
| 53941 | do { | ||||
| 53942 | |||||
| 53943 | if (arg.IsNull()) { | ||||
| 53944 | argv[0].setNull(); | ||||
| 53945 | break; | ||||
| 53946 | } | ||||
| 53947 | |||||
| 53948 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 53949 | if (!returnObj) { | ||||
| 53950 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53951 | return; | ||||
| 53952 | } | ||||
| 53953 | // Scope for 'tmp' | ||||
| 53954 | { | ||||
| 53955 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 53956 | for (auto& entry : arg.Value().Entries()) { | ||||
| 53957 | auto& recordValue0 = entry.mValue; | ||||
| 53958 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 53959 | // are different ways to succeed at wrapping the value. | ||||
| 53960 | do { | ||||
| 53961 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 53962 | break; | ||||
| 53963 | } while (false); | ||||
| 53964 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 53965 | entry.mKey.BeginReading(), | ||||
| 53966 | entry.mKey.Length(), tmp, | ||||
| 53967 | JSPROP_ENUMERATE)) { | ||||
| 53968 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53969 | return; | ||||
| 53970 | } | ||||
| 53971 | } | ||||
| 53972 | } | ||||
| 53973 | argv[0].setObject(*returnObj); | ||||
| 53974 | break; | ||||
| 53975 | } while (false); | ||||
| 53976 | |||||
| 53977 | JS::Rooted<JS::Value> callable(cx); | ||||
| 53978 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 53979 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 53980 | !InitIds(cx, atomsCache)) || | ||||
| 53981 | !GetCallableProperty(cx, atomsCache->passNullableRecord_id, &callable)) { | ||||
| 53982 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 53983 | return; | ||||
| 53984 | } | ||||
| 53985 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 53986 | if (!JS::Call(cx, thisValue, callable, | ||||
| 53987 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 53988 | aRv.NoteJSContextException(cx); | ||||
| 53989 | return; | ||||
| 53990 | } | ||||
| 53991 | } | ||||
| 53992 | |||||
| 53993 | void | ||||
| 53994 | TestJSImplInterfaceJSImpl::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 53995 | { | ||||
| 53996 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 53997 | if (aRv.Failed()) { | ||||
| 53998 | return; | ||||
| 53999 | } | ||||
| 54000 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54000); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54000; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54001 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54002 | |||||
| 54003 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54004 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54005 | if (!argv.resize(1)) { | ||||
| 54006 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54007 | // the right thing with that. | ||||
| 54008 | return; | ||||
| 54009 | } | ||||
| 54010 | unsigned argc = 1; | ||||
| 54011 | |||||
| 54012 | do { | ||||
| 54013 | |||||
| 54014 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54015 | if (!returnObj) { | ||||
| 54016 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54017 | return; | ||||
| 54018 | } | ||||
| 54019 | // Scope for 'tmp' | ||||
| 54020 | { | ||||
| 54021 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54022 | for (auto& entry : arg.Entries()) { | ||||
| 54023 | auto& recordValue0 = entry.mValue; | ||||
| 54024 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54025 | // are different ways to succeed at wrapping the value. | ||||
| 54026 | do { | ||||
| 54027 | if (recordValue0.IsNull()) { | ||||
| 54028 | tmp.setNull(); | ||||
| 54029 | break; | ||||
| 54030 | } | ||||
| 54031 | tmp.setInt32(int32_t(recordValue0.Value())); | ||||
| 54032 | break; | ||||
| 54033 | } while (false); | ||||
| 54034 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54035 | entry.mKey.BeginReading(), | ||||
| 54036 | entry.mKey.Length(), tmp, | ||||
| 54037 | JSPROP_ENUMERATE)) { | ||||
| 54038 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54039 | return; | ||||
| 54040 | } | ||||
| 54041 | } | ||||
| 54042 | } | ||||
| 54043 | argv[0].setObject(*returnObj); | ||||
| 54044 | break; | ||||
| 54045 | } while (false); | ||||
| 54046 | |||||
| 54047 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54048 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54049 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54050 | !InitIds(cx, atomsCache)) || | ||||
| 54051 | !GetCallableProperty(cx, atomsCache->passRecordOfNullableInts_id, &callable)) { | ||||
| 54052 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54053 | return; | ||||
| 54054 | } | ||||
| 54055 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54056 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54057 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54058 | aRv.NoteJSContextException(cx); | ||||
| 54059 | return; | ||||
| 54060 | } | ||||
| 54061 | } | ||||
| 54062 | |||||
| 54063 | void | ||||
| 54064 | TestJSImplInterfaceJSImpl::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54065 | { | ||||
| 54066 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54067 | if (aRv.Failed()) { | ||||
| 54068 | return; | ||||
| 54069 | } | ||||
| 54070 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54070); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54070; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54071 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54072 | |||||
| 54073 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54074 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54075 | if (!argv.resize(1)) { | ||||
| 54076 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54077 | // the right thing with that. | ||||
| 54078 | return; | ||||
| 54079 | } | ||||
| 54080 | unsigned argc = 1; | ||||
| 54081 | |||||
| 54082 | do { | ||||
| 54083 | if (arg.WasPassed()) { | ||||
| 54084 | |||||
| 54085 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54086 | if (!returnObj) { | ||||
| 54087 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54088 | return; | ||||
| 54089 | } | ||||
| 54090 | // Scope for 'tmp' | ||||
| 54091 | { | ||||
| 54092 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54093 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54094 | auto& recordValue0 = entry.mValue; | ||||
| 54095 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54096 | // are different ways to succeed at wrapping the value. | ||||
| 54097 | do { | ||||
| 54098 | if (recordValue0.IsNull()) { | ||||
| 54099 | tmp.setNull(); | ||||
| 54100 | break; | ||||
| 54101 | } | ||||
| 54102 | tmp.setInt32(int32_t(recordValue0.Value())); | ||||
| 54103 | break; | ||||
| 54104 | } while (false); | ||||
| 54105 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54106 | entry.mKey.BeginReading(), | ||||
| 54107 | entry.mKey.Length(), tmp, | ||||
| 54108 | JSPROP_ENUMERATE)) { | ||||
| 54109 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54110 | return; | ||||
| 54111 | } | ||||
| 54112 | } | ||||
| 54113 | } | ||||
| 54114 | argv[0].setObject(*returnObj); | ||||
| 54115 | break; | ||||
| 54116 | } else if (argc == 1) { | ||||
| 54117 | // This is our current trailing argument; reduce argc | ||||
| 54118 | --argc; | ||||
| 54119 | } else { | ||||
| 54120 | argv[0].setUndefined(); | ||||
| 54121 | } | ||||
| 54122 | } while (false); | ||||
| 54123 | |||||
| 54124 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54125 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54126 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54127 | !InitIds(cx, atomsCache)) || | ||||
| 54128 | !GetCallableProperty(cx, atomsCache->passOptionalRecordOfNullableInts_id, &callable)) { | ||||
| 54129 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54130 | return; | ||||
| 54131 | } | ||||
| 54132 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54133 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54134 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54135 | aRv.NoteJSContextException(cx); | ||||
| 54136 | return; | ||||
| 54137 | } | ||||
| 54138 | } | ||||
| 54139 | |||||
| 54140 | void | ||||
| 54141 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54142 | { | ||||
| 54143 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54144 | if (aRv.Failed()) { | ||||
| 54145 | return; | ||||
| 54146 | } | ||||
| 54147 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54147); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54147; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54148 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54149 | |||||
| 54150 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54151 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54152 | if (!argv.resize(1)) { | ||||
| 54153 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54154 | // the right thing with that. | ||||
| 54155 | return; | ||||
| 54156 | } | ||||
| 54157 | unsigned argc = 1; | ||||
| 54158 | |||||
| 54159 | do { | ||||
| 54160 | if (arg.WasPassed()) { | ||||
| 54161 | |||||
| 54162 | if (arg.Value().IsNull()) { | ||||
| 54163 | argv[0].setNull(); | ||||
| 54164 | break; | ||||
| 54165 | } | ||||
| 54166 | |||||
| 54167 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54168 | if (!returnObj) { | ||||
| 54169 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54170 | return; | ||||
| 54171 | } | ||||
| 54172 | // Scope for 'tmp' | ||||
| 54173 | { | ||||
| 54174 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54175 | for (auto& entry : arg.Value().Value().Entries()) { | ||||
| 54176 | auto& recordValue0 = entry.mValue; | ||||
| 54177 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54178 | // are different ways to succeed at wrapping the value. | ||||
| 54179 | do { | ||||
| 54180 | if (recordValue0.IsNull()) { | ||||
| 54181 | tmp.setNull(); | ||||
| 54182 | break; | ||||
| 54183 | } | ||||
| 54184 | tmp.setInt32(int32_t(recordValue0.Value())); | ||||
| 54185 | break; | ||||
| 54186 | } while (false); | ||||
| 54187 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54188 | entry.mKey.BeginReading(), | ||||
| 54189 | entry.mKey.Length(), tmp, | ||||
| 54190 | JSPROP_ENUMERATE)) { | ||||
| 54191 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54192 | return; | ||||
| 54193 | } | ||||
| 54194 | } | ||||
| 54195 | } | ||||
| 54196 | argv[0].setObject(*returnObj); | ||||
| 54197 | break; | ||||
| 54198 | } else if (argc == 1) { | ||||
| 54199 | // This is our current trailing argument; reduce argc | ||||
| 54200 | --argc; | ||||
| 54201 | } else { | ||||
| 54202 | argv[0].setUndefined(); | ||||
| 54203 | } | ||||
| 54204 | } while (false); | ||||
| 54205 | |||||
| 54206 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54207 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54208 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54209 | !InitIds(cx, atomsCache)) || | ||||
| 54210 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableInts_id, &callable)) { | ||||
| 54211 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54212 | return; | ||||
| 54213 | } | ||||
| 54214 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54215 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54216 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54217 | aRv.NoteJSContextException(cx); | ||||
| 54218 | return; | ||||
| 54219 | } | ||||
| 54220 | } | ||||
| 54221 | |||||
| 54222 | void | ||||
| 54223 | TestJSImplInterfaceJSImpl::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54224 | { | ||||
| 54225 | CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54226 | if (aRv.Failed()) { | ||||
| 54227 | return; | ||||
| 54228 | } | ||||
| 54229 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54229); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54229; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54230 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54231 | |||||
| 54232 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54233 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54234 | if (!argv.resize(1)) { | ||||
| 54235 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54236 | // the right thing with that. | ||||
| 54237 | return; | ||||
| 54238 | } | ||||
| 54239 | unsigned argc = 1; | ||||
| 54240 | |||||
| 54241 | do { | ||||
| 54242 | |||||
| 54243 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54244 | if (!returnObj) { | ||||
| 54245 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54246 | return; | ||||
| 54247 | } | ||||
| 54248 | // Scope for 'tmp' | ||||
| 54249 | { | ||||
| 54250 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54251 | for (auto& entry : arg.Entries()) { | ||||
| 54252 | auto& recordValue0 = entry.mValue; | ||||
| 54253 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54254 | // are different ways to succeed at wrapping the value. | ||||
| 54255 | do { | ||||
| 54256 | if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) { | ||||
| 54257 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 54257); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 54257; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54258 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54259 | return; | ||||
| 54260 | } | ||||
| 54261 | break; | ||||
| 54262 | } while (false); | ||||
| 54263 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54264 | entry.mKey.BeginReading(), | ||||
| 54265 | entry.mKey.Length(), tmp, | ||||
| 54266 | JSPROP_ENUMERATE)) { | ||||
| 54267 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54268 | return; | ||||
| 54269 | } | ||||
| 54270 | } | ||||
| 54271 | } | ||||
| 54272 | argv[0].setObject(*returnObj); | ||||
| 54273 | break; | ||||
| 54274 | } while (false); | ||||
| 54275 | |||||
| 54276 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54277 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54278 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54279 | !InitIds(cx, atomsCache)) || | ||||
| 54280 | !GetCallableProperty(cx, atomsCache->passCastableObjectRecord_id, &callable)) { | ||||
| 54281 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54282 | return; | ||||
| 54283 | } | ||||
| 54284 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54285 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54286 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54287 | aRv.NoteJSContextException(cx); | ||||
| 54288 | return; | ||||
| 54289 | } | ||||
| 54290 | } | ||||
| 54291 | |||||
| 54292 | void | ||||
| 54293 | TestJSImplInterfaceJSImpl::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54294 | { | ||||
| 54295 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54296 | if (aRv.Failed()) { | ||||
| 54297 | return; | ||||
| 54298 | } | ||||
| 54299 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54299); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54299; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54300 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54301 | |||||
| 54302 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54303 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54304 | if (!argv.resize(1)) { | ||||
| 54305 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54306 | // the right thing with that. | ||||
| 54307 | return; | ||||
| 54308 | } | ||||
| 54309 | unsigned argc = 1; | ||||
| 54310 | |||||
| 54311 | do { | ||||
| 54312 | |||||
| 54313 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54314 | if (!returnObj) { | ||||
| 54315 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54316 | return; | ||||
| 54317 | } | ||||
| 54318 | // Scope for 'tmp' | ||||
| 54319 | { | ||||
| 54320 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54321 | for (auto& entry : arg.Entries()) { | ||||
| 54322 | auto& recordValue0 = entry.mValue; | ||||
| 54323 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54324 | // are different ways to succeed at wrapping the value. | ||||
| 54325 | do { | ||||
| 54326 | if (!recordValue0) { | ||||
| 54327 | tmp.setNull(); | ||||
| 54328 | break; | ||||
| 54329 | } | ||||
| 54330 | if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) { | ||||
| 54331 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 54331); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 54331; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54332 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54333 | return; | ||||
| 54334 | } | ||||
| 54335 | break; | ||||
| 54336 | } while (false); | ||||
| 54337 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54338 | entry.mKey.BeginReading(), | ||||
| 54339 | entry.mKey.Length(), tmp, | ||||
| 54340 | JSPROP_ENUMERATE)) { | ||||
| 54341 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54342 | return; | ||||
| 54343 | } | ||||
| 54344 | } | ||||
| 54345 | } | ||||
| 54346 | argv[0].setObject(*returnObj); | ||||
| 54347 | break; | ||||
| 54348 | } while (false); | ||||
| 54349 | |||||
| 54350 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54351 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54352 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54353 | !InitIds(cx, atomsCache)) || | ||||
| 54354 | !GetCallableProperty(cx, atomsCache->passNullableCastableObjectRecord_id, &callable)) { | ||||
| 54355 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54356 | return; | ||||
| 54357 | } | ||||
| 54358 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54359 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54360 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54361 | aRv.NoteJSContextException(cx); | ||||
| 54362 | return; | ||||
| 54363 | } | ||||
| 54364 | } | ||||
| 54365 | |||||
| 54366 | void | ||||
| 54367 | TestJSImplInterfaceJSImpl::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54368 | { | ||||
| 54369 | CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54370 | if (aRv.Failed()) { | ||||
| 54371 | return; | ||||
| 54372 | } | ||||
| 54373 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54373); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54373; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54374 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54375 | |||||
| 54376 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54377 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54378 | if (!argv.resize(1)) { | ||||
| 54379 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54380 | // the right thing with that. | ||||
| 54381 | return; | ||||
| 54382 | } | ||||
| 54383 | unsigned argc = 1; | ||||
| 54384 | |||||
| 54385 | do { | ||||
| 54386 | |||||
| 54387 | if (arg.IsNull()) { | ||||
| 54388 | argv[0].setNull(); | ||||
| 54389 | break; | ||||
| 54390 | } | ||||
| 54391 | |||||
| 54392 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54393 | if (!returnObj) { | ||||
| 54394 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54395 | return; | ||||
| 54396 | } | ||||
| 54397 | // Scope for 'tmp' | ||||
| 54398 | { | ||||
| 54399 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54400 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54401 | auto& recordValue0 = entry.mValue; | ||||
| 54402 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54403 | // are different ways to succeed at wrapping the value. | ||||
| 54404 | do { | ||||
| 54405 | if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) { | ||||
| 54406 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 54406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 54406; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54407 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54408 | return; | ||||
| 54409 | } | ||||
| 54410 | break; | ||||
| 54411 | } while (false); | ||||
| 54412 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54413 | entry.mKey.BeginReading(), | ||||
| 54414 | entry.mKey.Length(), tmp, | ||||
| 54415 | JSPROP_ENUMERATE)) { | ||||
| 54416 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54417 | return; | ||||
| 54418 | } | ||||
| 54419 | } | ||||
| 54420 | } | ||||
| 54421 | argv[0].setObject(*returnObj); | ||||
| 54422 | break; | ||||
| 54423 | } while (false); | ||||
| 54424 | |||||
| 54425 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54426 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54427 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54428 | !InitIds(cx, atomsCache)) || | ||||
| 54429 | !GetCallableProperty(cx, atomsCache->passCastableObjectNullableRecord_id, &callable)) { | ||||
| 54430 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54431 | return; | ||||
| 54432 | } | ||||
| 54433 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54434 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54435 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54436 | aRv.NoteJSContextException(cx); | ||||
| 54437 | return; | ||||
| 54438 | } | ||||
| 54439 | } | ||||
| 54440 | |||||
| 54441 | void | ||||
| 54442 | TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54443 | { | ||||
| 54444 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54445 | if (aRv.Failed()) { | ||||
| 54446 | return; | ||||
| 54447 | } | ||||
| 54448 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54448); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54448; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54449 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54450 | |||||
| 54451 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54452 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54453 | if (!argv.resize(1)) { | ||||
| 54454 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54455 | // the right thing with that. | ||||
| 54456 | return; | ||||
| 54457 | } | ||||
| 54458 | unsigned argc = 1; | ||||
| 54459 | |||||
| 54460 | do { | ||||
| 54461 | |||||
| 54462 | if (arg.IsNull()) { | ||||
| 54463 | argv[0].setNull(); | ||||
| 54464 | break; | ||||
| 54465 | } | ||||
| 54466 | |||||
| 54467 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54468 | if (!returnObj) { | ||||
| 54469 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54470 | return; | ||||
| 54471 | } | ||||
| 54472 | // Scope for 'tmp' | ||||
| 54473 | { | ||||
| 54474 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54475 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54476 | auto& recordValue0 = entry.mValue; | ||||
| 54477 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54478 | // are different ways to succeed at wrapping the value. | ||||
| 54479 | do { | ||||
| 54480 | if (!recordValue0) { | ||||
| 54481 | tmp.setNull(); | ||||
| 54482 | break; | ||||
| 54483 | } | ||||
| 54484 | if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) { | ||||
| 54485 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 54485); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 54485; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54486 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54487 | return; | ||||
| 54488 | } | ||||
| 54489 | break; | ||||
| 54490 | } while (false); | ||||
| 54491 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54492 | entry.mKey.BeginReading(), | ||||
| 54493 | entry.mKey.Length(), tmp, | ||||
| 54494 | JSPROP_ENUMERATE)) { | ||||
| 54495 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54496 | return; | ||||
| 54497 | } | ||||
| 54498 | } | ||||
| 54499 | } | ||||
| 54500 | argv[0].setObject(*returnObj); | ||||
| 54501 | break; | ||||
| 54502 | } while (false); | ||||
| 54503 | |||||
| 54504 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54505 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54506 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54507 | !InitIds(cx, atomsCache)) || | ||||
| 54508 | !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableRecord_id, &callable)) { | ||||
| 54509 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54510 | return; | ||||
| 54511 | } | ||||
| 54512 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54513 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54514 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54515 | aRv.NoteJSContextException(cx); | ||||
| 54516 | return; | ||||
| 54517 | } | ||||
| 54518 | } | ||||
| 54519 | |||||
| 54520 | void | ||||
| 54521 | TestJSImplInterfaceJSImpl::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54522 | { | ||||
| 54523 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54524 | if (aRv.Failed()) { | ||||
| 54525 | return; | ||||
| 54526 | } | ||||
| 54527 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54527); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54527; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54528 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54529 | |||||
| 54530 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54531 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54532 | if (!argv.resize(1)) { | ||||
| 54533 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54534 | // the right thing with that. | ||||
| 54535 | return; | ||||
| 54536 | } | ||||
| 54537 | unsigned argc = 1; | ||||
| 54538 | |||||
| 54539 | do { | ||||
| 54540 | if (arg.WasPassed()) { | ||||
| 54541 | |||||
| 54542 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54543 | if (!returnObj) { | ||||
| 54544 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54545 | return; | ||||
| 54546 | } | ||||
| 54547 | // Scope for 'tmp' | ||||
| 54548 | { | ||||
| 54549 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54550 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54551 | auto& recordValue0 = entry.mValue; | ||||
| 54552 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54553 | // are different ways to succeed at wrapping the value. | ||||
| 54554 | do { | ||||
| 54555 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 54556 | break; | ||||
| 54557 | } while (false); | ||||
| 54558 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54559 | entry.mKey.BeginReading(), | ||||
| 54560 | entry.mKey.Length(), tmp, | ||||
| 54561 | JSPROP_ENUMERATE)) { | ||||
| 54562 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54563 | return; | ||||
| 54564 | } | ||||
| 54565 | } | ||||
| 54566 | } | ||||
| 54567 | argv[0].setObject(*returnObj); | ||||
| 54568 | break; | ||||
| 54569 | } else if (argc == 1) { | ||||
| 54570 | // This is our current trailing argument; reduce argc | ||||
| 54571 | --argc; | ||||
| 54572 | } else { | ||||
| 54573 | argv[0].setUndefined(); | ||||
| 54574 | } | ||||
| 54575 | } while (false); | ||||
| 54576 | |||||
| 54577 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54578 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54579 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54580 | !InitIds(cx, atomsCache)) || | ||||
| 54581 | !GetCallableProperty(cx, atomsCache->passOptionalRecord_id, &callable)) { | ||||
| 54582 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54583 | return; | ||||
| 54584 | } | ||||
| 54585 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54586 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54587 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54588 | aRv.NoteJSContextException(cx); | ||||
| 54589 | return; | ||||
| 54590 | } | ||||
| 54591 | } | ||||
| 54592 | |||||
| 54593 | void | ||||
| 54594 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54595 | { | ||||
| 54596 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54597 | if (aRv.Failed()) { | ||||
| 54598 | return; | ||||
| 54599 | } | ||||
| 54600 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54600); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54600; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54601 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54602 | |||||
| 54603 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54604 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54605 | if (!argv.resize(1)) { | ||||
| 54606 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54607 | // the right thing with that. | ||||
| 54608 | return; | ||||
| 54609 | } | ||||
| 54610 | unsigned argc = 1; | ||||
| 54611 | |||||
| 54612 | do { | ||||
| 54613 | if (arg.WasPassed()) { | ||||
| 54614 | |||||
| 54615 | if (arg.Value().IsNull()) { | ||||
| 54616 | argv[0].setNull(); | ||||
| 54617 | break; | ||||
| 54618 | } | ||||
| 54619 | |||||
| 54620 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54621 | if (!returnObj) { | ||||
| 54622 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54623 | return; | ||||
| 54624 | } | ||||
| 54625 | // Scope for 'tmp' | ||||
| 54626 | { | ||||
| 54627 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54628 | for (auto& entry : arg.Value().Value().Entries()) { | ||||
| 54629 | auto& recordValue0 = entry.mValue; | ||||
| 54630 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54631 | // are different ways to succeed at wrapping the value. | ||||
| 54632 | do { | ||||
| 54633 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 54634 | break; | ||||
| 54635 | } while (false); | ||||
| 54636 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54637 | entry.mKey.BeginReading(), | ||||
| 54638 | entry.mKey.Length(), tmp, | ||||
| 54639 | JSPROP_ENUMERATE)) { | ||||
| 54640 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54641 | return; | ||||
| 54642 | } | ||||
| 54643 | } | ||||
| 54644 | } | ||||
| 54645 | argv[0].setObject(*returnObj); | ||||
| 54646 | break; | ||||
| 54647 | } else if (argc == 1) { | ||||
| 54648 | // This is our current trailing argument; reduce argc | ||||
| 54649 | --argc; | ||||
| 54650 | } else { | ||||
| 54651 | argv[0].setUndefined(); | ||||
| 54652 | } | ||||
| 54653 | } while (false); | ||||
| 54654 | |||||
| 54655 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54656 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54657 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54658 | !InitIds(cx, atomsCache)) || | ||||
| 54659 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecord_id, &callable)) { | ||||
| 54660 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54661 | return; | ||||
| 54662 | } | ||||
| 54663 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54664 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54665 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54666 | aRv.NoteJSContextException(cx); | ||||
| 54667 | return; | ||||
| 54668 | } | ||||
| 54669 | } | ||||
| 54670 | |||||
| 54671 | void | ||||
| 54672 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54673 | { | ||||
| 54674 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54675 | if (aRv.Failed()) { | ||||
| 54676 | return; | ||||
| 54677 | } | ||||
| 54678 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54678); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54678; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54679 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54680 | |||||
| 54681 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54682 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54683 | if (!argv.resize(1)) { | ||||
| 54684 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54685 | // the right thing with that. | ||||
| 54686 | return; | ||||
| 54687 | } | ||||
| 54688 | unsigned argc = 1; | ||||
| 54689 | |||||
| 54690 | do { | ||||
| 54691 | |||||
| 54692 | if (arg.IsNull()) { | ||||
| 54693 | argv[0].setNull(); | ||||
| 54694 | break; | ||||
| 54695 | } | ||||
| 54696 | |||||
| 54697 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54698 | if (!returnObj) { | ||||
| 54699 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54700 | return; | ||||
| 54701 | } | ||||
| 54702 | // Scope for 'tmp' | ||||
| 54703 | { | ||||
| 54704 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54705 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54706 | auto& recordValue0 = entry.mValue; | ||||
| 54707 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54708 | // are different ways to succeed at wrapping the value. | ||||
| 54709 | do { | ||||
| 54710 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 54711 | break; | ||||
| 54712 | } while (false); | ||||
| 54713 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54714 | entry.mKey.BeginReading(), | ||||
| 54715 | entry.mKey.Length(), tmp, | ||||
| 54716 | JSPROP_ENUMERATE)) { | ||||
| 54717 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54718 | return; | ||||
| 54719 | } | ||||
| 54720 | } | ||||
| 54721 | } | ||||
| 54722 | argv[0].setObject(*returnObj); | ||||
| 54723 | break; | ||||
| 54724 | } while (false); | ||||
| 54725 | |||||
| 54726 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54727 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54728 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54729 | !InitIds(cx, atomsCache)) || | ||||
| 54730 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordWithDefaultValue_id, &callable)) { | ||||
| 54731 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54732 | return; | ||||
| 54733 | } | ||||
| 54734 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54735 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54736 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54737 | aRv.NoteJSContextException(cx); | ||||
| 54738 | return; | ||||
| 54739 | } | ||||
| 54740 | } | ||||
| 54741 | |||||
| 54742 | void | ||||
| 54743 | TestJSImplInterfaceJSImpl::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54744 | { | ||||
| 54745 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54746 | if (aRv.Failed()) { | ||||
| 54747 | return; | ||||
| 54748 | } | ||||
| 54749 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54749); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54749; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54750 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54751 | |||||
| 54752 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54753 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54754 | if (!argv.resize(1)) { | ||||
| 54755 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54756 | // the right thing with that. | ||||
| 54757 | return; | ||||
| 54758 | } | ||||
| 54759 | unsigned argc = 1; | ||||
| 54760 | |||||
| 54761 | do { | ||||
| 54762 | if (arg.WasPassed()) { | ||||
| 54763 | |||||
| 54764 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54765 | if (!returnObj) { | ||||
| 54766 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54767 | return; | ||||
| 54768 | } | ||||
| 54769 | // Scope for 'tmp' | ||||
| 54770 | { | ||||
| 54771 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54772 | for (auto& entry : arg.Value().Entries()) { | ||||
| 54773 | auto& recordValue0 = entry.mValue; | ||||
| 54774 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54775 | // are different ways to succeed at wrapping the value. | ||||
| 54776 | do { | ||||
| 54777 | if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) { | ||||
| 54778 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 54778); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 54778; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54779 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54780 | return; | ||||
| 54781 | } | ||||
| 54782 | break; | ||||
| 54783 | } while (false); | ||||
| 54784 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54785 | entry.mKey.BeginReading(), | ||||
| 54786 | entry.mKey.Length(), tmp, | ||||
| 54787 | JSPROP_ENUMERATE)) { | ||||
| 54788 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54789 | return; | ||||
| 54790 | } | ||||
| 54791 | } | ||||
| 54792 | } | ||||
| 54793 | argv[0].setObject(*returnObj); | ||||
| 54794 | break; | ||||
| 54795 | } else if (argc == 1) { | ||||
| 54796 | // This is our current trailing argument; reduce argc | ||||
| 54797 | --argc; | ||||
| 54798 | } else { | ||||
| 54799 | argv[0].setUndefined(); | ||||
| 54800 | } | ||||
| 54801 | } while (false); | ||||
| 54802 | |||||
| 54803 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54804 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54805 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54806 | !InitIds(cx, atomsCache)) || | ||||
| 54807 | !GetCallableProperty(cx, atomsCache->passOptionalObjectRecord_id, &callable)) { | ||||
| 54808 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54809 | return; | ||||
| 54810 | } | ||||
| 54811 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54812 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54813 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54814 | aRv.NoteJSContextException(cx); | ||||
| 54815 | return; | ||||
| 54816 | } | ||||
| 54817 | } | ||||
| 54818 | |||||
| 54819 | void | ||||
| 54820 | TestJSImplInterfaceJSImpl::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54821 | { | ||||
| 54822 | CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54823 | if (aRv.Failed()) { | ||||
| 54824 | return; | ||||
| 54825 | } | ||||
| 54826 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54826); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54826; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54827 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54828 | |||||
| 54829 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54830 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54831 | if (!argv.resize(1)) { | ||||
| 54832 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54833 | // the right thing with that. | ||||
| 54834 | return; | ||||
| 54835 | } | ||||
| 54836 | unsigned argc = 1; | ||||
| 54837 | |||||
| 54838 | do { | ||||
| 54839 | |||||
| 54840 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54841 | if (!returnObj) { | ||||
| 54842 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54843 | return; | ||||
| 54844 | } | ||||
| 54845 | // Scope for 'tmp' | ||||
| 54846 | { | ||||
| 54847 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54848 | for (auto& entry : arg.Entries()) { | ||||
| 54849 | auto& recordValue0 = entry.mValue; | ||||
| 54850 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54851 | // are different ways to succeed at wrapping the value. | ||||
| 54852 | do { | ||||
| 54853 | if (!WrapObject(cx, recordValue0, &tmp)) { | ||||
| 54854 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54855 | return; | ||||
| 54856 | } | ||||
| 54857 | break; | ||||
| 54858 | } while (false); | ||||
| 54859 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54860 | entry.mKey.BeginReading(), | ||||
| 54861 | entry.mKey.Length(), tmp, | ||||
| 54862 | JSPROP_ENUMERATE)) { | ||||
| 54863 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54864 | return; | ||||
| 54865 | } | ||||
| 54866 | } | ||||
| 54867 | } | ||||
| 54868 | argv[0].setObject(*returnObj); | ||||
| 54869 | break; | ||||
| 54870 | } while (false); | ||||
| 54871 | |||||
| 54872 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54873 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54874 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54875 | !InitIds(cx, atomsCache)) || | ||||
| 54876 | !GetCallableProperty(cx, atomsCache->passExternalInterfaceRecord_id, &callable)) { | ||||
| 54877 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54878 | return; | ||||
| 54879 | } | ||||
| 54880 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54881 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54882 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54883 | aRv.NoteJSContextException(cx); | ||||
| 54884 | return; | ||||
| 54885 | } | ||||
| 54886 | } | ||||
| 54887 | |||||
| 54888 | void | ||||
| 54889 | TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54890 | { | ||||
| 54891 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54892 | if (aRv.Failed()) { | ||||
| 54893 | return; | ||||
| 54894 | } | ||||
| 54895 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54895); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54895; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54896 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54897 | |||||
| 54898 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54899 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54900 | if (!argv.resize(1)) { | ||||
| 54901 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54902 | // the right thing with that. | ||||
| 54903 | return; | ||||
| 54904 | } | ||||
| 54905 | unsigned argc = 1; | ||||
| 54906 | |||||
| 54907 | do { | ||||
| 54908 | |||||
| 54909 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54910 | if (!returnObj) { | ||||
| 54911 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54912 | return; | ||||
| 54913 | } | ||||
| 54914 | // Scope for 'tmp' | ||||
| 54915 | { | ||||
| 54916 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54917 | for (auto& entry : arg.Entries()) { | ||||
| 54918 | auto& recordValue0 = entry.mValue; | ||||
| 54919 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54920 | // are different ways to succeed at wrapping the value. | ||||
| 54921 | do { | ||||
| 54922 | if (!recordValue0) { | ||||
| 54923 | tmp.setNull(); | ||||
| 54924 | break; | ||||
| 54925 | } | ||||
| 54926 | if (!WrapObject(cx, recordValue0, &tmp)) { | ||||
| 54927 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54928 | return; | ||||
| 54929 | } | ||||
| 54930 | break; | ||||
| 54931 | } while (false); | ||||
| 54932 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 54933 | entry.mKey.BeginReading(), | ||||
| 54934 | entry.mKey.Length(), tmp, | ||||
| 54935 | JSPROP_ENUMERATE)) { | ||||
| 54936 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54937 | return; | ||||
| 54938 | } | ||||
| 54939 | } | ||||
| 54940 | } | ||||
| 54941 | argv[0].setObject(*returnObj); | ||||
| 54942 | break; | ||||
| 54943 | } while (false); | ||||
| 54944 | |||||
| 54945 | JS::Rooted<JS::Value> callable(cx); | ||||
| 54946 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 54947 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 54948 | !InitIds(cx, atomsCache)) || | ||||
| 54949 | !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceRecord_id, &callable)) { | ||||
| 54950 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54951 | return; | ||||
| 54952 | } | ||||
| 54953 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 54954 | if (!JS::Call(cx, thisValue, callable, | ||||
| 54955 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 54956 | aRv.NoteJSContextException(cx); | ||||
| 54957 | return; | ||||
| 54958 | } | ||||
| 54959 | } | ||||
| 54960 | |||||
| 54961 | void | ||||
| 54962 | TestJSImplInterfaceJSImpl::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 54963 | { | ||||
| 54964 | CallSetup s(this, aRv, "TestJSImplInterface.passStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 54965 | if (aRv.Failed()) { | ||||
| 54966 | return; | ||||
| 54967 | } | ||||
| 54968 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 54968); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 54968; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 54969 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 54970 | |||||
| 54971 | JS::Rooted<JS::Value> rval(cx); | ||||
| 54972 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 54973 | if (!argv.resize(1)) { | ||||
| 54974 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 54975 | // the right thing with that. | ||||
| 54976 | return; | ||||
| 54977 | } | ||||
| 54978 | unsigned argc = 1; | ||||
| 54979 | |||||
| 54980 | do { | ||||
| 54981 | |||||
| 54982 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 54983 | if (!returnObj) { | ||||
| 54984 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54985 | return; | ||||
| 54986 | } | ||||
| 54987 | // Scope for 'tmp' | ||||
| 54988 | { | ||||
| 54989 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 54990 | for (auto& entry : arg.Entries()) { | ||||
| 54991 | auto& recordValue0 = entry.mValue; | ||||
| 54992 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 54993 | // are different ways to succeed at wrapping the value. | ||||
| 54994 | do { | ||||
| 54995 | if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) { | ||||
| 54996 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 54997 | return; | ||||
| 54998 | } | ||||
| 54999 | break; | ||||
| 55000 | } while (false); | ||||
| 55001 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 55002 | entry.mKey.BeginReading(), | ||||
| 55003 | entry.mKey.Length(), tmp, | ||||
| 55004 | JSPROP_ENUMERATE)) { | ||||
| 55005 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55006 | return; | ||||
| 55007 | } | ||||
| 55008 | } | ||||
| 55009 | } | ||||
| 55010 | argv[0].setObject(*returnObj); | ||||
| 55011 | break; | ||||
| 55012 | } while (false); | ||||
| 55013 | |||||
| 55014 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55015 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55016 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55017 | !InitIds(cx, atomsCache)) || | ||||
| 55018 | !GetCallableProperty(cx, atomsCache->passStringRecord_id, &callable)) { | ||||
| 55019 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55020 | return; | ||||
| 55021 | } | ||||
| 55022 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55023 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55024 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55025 | aRv.NoteJSContextException(cx); | ||||
| 55026 | return; | ||||
| 55027 | } | ||||
| 55028 | } | ||||
| 55029 | |||||
| 55030 | void | ||||
| 55031 | TestJSImplInterfaceJSImpl::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55032 | { | ||||
| 55033 | CallSetup s(this, aRv, "TestJSImplInterface.passByteStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55034 | if (aRv.Failed()) { | ||||
| 55035 | return; | ||||
| 55036 | } | ||||
| 55037 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55037; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55038 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55039 | |||||
| 55040 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55041 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55042 | if (!argv.resize(1)) { | ||||
| 55043 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55044 | // the right thing with that. | ||||
| 55045 | return; | ||||
| 55046 | } | ||||
| 55047 | unsigned argc = 1; | ||||
| 55048 | |||||
| 55049 | do { | ||||
| 55050 | |||||
| 55051 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 55052 | if (!returnObj) { | ||||
| 55053 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55054 | return; | ||||
| 55055 | } | ||||
| 55056 | // Scope for 'tmp' | ||||
| 55057 | { | ||||
| 55058 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 55059 | for (auto& entry : arg.Entries()) { | ||||
| 55060 | auto& recordValue0 = entry.mValue; | ||||
| 55061 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 55062 | // are different ways to succeed at wrapping the value. | ||||
| 55063 | do { | ||||
| 55064 | if (!NonVoidByteStringToJsval(cx, recordValue0, &tmp)) { | ||||
| 55065 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55066 | return; | ||||
| 55067 | } | ||||
| 55068 | break; | ||||
| 55069 | } while (false); | ||||
| 55070 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 55071 | entry.mKey.BeginReading(), | ||||
| 55072 | entry.mKey.Length(), tmp, | ||||
| 55073 | JSPROP_ENUMERATE)) { | ||||
| 55074 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55075 | return; | ||||
| 55076 | } | ||||
| 55077 | } | ||||
| 55078 | } | ||||
| 55079 | argv[0].setObject(*returnObj); | ||||
| 55080 | break; | ||||
| 55081 | } while (false); | ||||
| 55082 | |||||
| 55083 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55084 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55085 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55086 | !InitIds(cx, atomsCache)) || | ||||
| 55087 | !GetCallableProperty(cx, atomsCache->passByteStringRecord_id, &callable)) { | ||||
| 55088 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55089 | return; | ||||
| 55090 | } | ||||
| 55091 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55092 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55093 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55094 | aRv.NoteJSContextException(cx); | ||||
| 55095 | return; | ||||
| 55096 | } | ||||
| 55097 | } | ||||
| 55098 | |||||
| 55099 | void | ||||
| 55100 | TestJSImplInterfaceJSImpl::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55101 | { | ||||
| 55102 | CallSetup s(this, aRv, "TestJSImplInterface.passUTF8StringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55103 | if (aRv.Failed()) { | ||||
| 55104 | return; | ||||
| 55105 | } | ||||
| 55106 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55106); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55106; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55107 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55108 | |||||
| 55109 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55110 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55111 | if (!argv.resize(1)) { | ||||
| 55112 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55113 | // the right thing with that. | ||||
| 55114 | return; | ||||
| 55115 | } | ||||
| 55116 | unsigned argc = 1; | ||||
| 55117 | |||||
| 55118 | do { | ||||
| 55119 | |||||
| 55120 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 55121 | if (!returnObj) { | ||||
| 55122 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55123 | return; | ||||
| 55124 | } | ||||
| 55125 | // Scope for 'tmp' | ||||
| 55126 | { | ||||
| 55127 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 55128 | for (auto& entry : arg.Entries()) { | ||||
| 55129 | auto& recordValue0 = entry.mValue; | ||||
| 55130 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 55131 | // are different ways to succeed at wrapping the value. | ||||
| 55132 | do { | ||||
| 55133 | if (!NonVoidUTF8StringToJsval(cx, recordValue0, &tmp)) { | ||||
| 55134 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55135 | return; | ||||
| 55136 | } | ||||
| 55137 | break; | ||||
| 55138 | } while (false); | ||||
| 55139 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 55140 | entry.mKey.BeginReading(), | ||||
| 55141 | entry.mKey.Length(), tmp, | ||||
| 55142 | JSPROP_ENUMERATE)) { | ||||
| 55143 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55144 | return; | ||||
| 55145 | } | ||||
| 55146 | } | ||||
| 55147 | } | ||||
| 55148 | argv[0].setObject(*returnObj); | ||||
| 55149 | break; | ||||
| 55150 | } while (false); | ||||
| 55151 | |||||
| 55152 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55153 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55154 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55155 | !InitIds(cx, atomsCache)) || | ||||
| 55156 | !GetCallableProperty(cx, atomsCache->passUTF8StringRecord_id, &callable)) { | ||||
| 55157 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55158 | return; | ||||
| 55159 | } | ||||
| 55160 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55161 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55162 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55163 | aRv.NoteJSContextException(cx); | ||||
| 55164 | return; | ||||
| 55165 | } | ||||
| 55166 | } | ||||
| 55167 | |||||
| 55168 | void | ||||
| 55169 | TestJSImplInterfaceJSImpl::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55170 | { | ||||
| 55171 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecords", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55172 | if (aRv.Failed()) { | ||||
| 55173 | return; | ||||
| 55174 | } | ||||
| 55175 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55175); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55175; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55176 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55177 | |||||
| 55178 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55179 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55180 | if (!argv.resize(1)) { | ||||
| 55181 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55182 | // the right thing with that. | ||||
| 55183 | return; | ||||
| 55184 | } | ||||
| 55185 | unsigned argc = 1; | ||||
| 55186 | |||||
| 55187 | do { | ||||
| 55188 | |||||
| 55189 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 55190 | if (!returnObj) { | ||||
| 55191 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55192 | return; | ||||
| 55193 | } | ||||
| 55194 | // Scope for 'tmp' | ||||
| 55195 | { | ||||
| 55196 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 55197 | for (auto& entry : arg.Entries()) { | ||||
| 55198 | auto& recordValue0 = entry.mValue; | ||||
| 55199 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 55200 | // are different ways to succeed at wrapping the value. | ||||
| 55201 | do { | ||||
| 55202 | |||||
| 55203 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 55204 | if (!returnObj) { | ||||
| 55205 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55206 | return; | ||||
| 55207 | } | ||||
| 55208 | // Scope for 'tmp' | ||||
| 55209 | { | ||||
| 55210 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 55211 | for (auto& entry : recordValue0.Entries()) { | ||||
| 55212 | auto& recordValue1 = entry.mValue; | ||||
| 55213 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 55214 | // are different ways to succeed at wrapping the value. | ||||
| 55215 | do { | ||||
| 55216 | tmp.setInt32(int32_t(recordValue1)); | ||||
| 55217 | break; | ||||
| 55218 | } while (false); | ||||
| 55219 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 55220 | entry.mKey.BeginReading(), | ||||
| 55221 | entry.mKey.Length(), tmp, | ||||
| 55222 | JSPROP_ENUMERATE)) { | ||||
| 55223 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55224 | return; | ||||
| 55225 | } | ||||
| 55226 | } | ||||
| 55227 | } | ||||
| 55228 | tmp.setObject(*returnObj); | ||||
| 55229 | break; | ||||
| 55230 | } while (false); | ||||
| 55231 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 55232 | entry.mKey.BeginReading(), | ||||
| 55233 | entry.mKey.Length(), tmp, | ||||
| 55234 | JSPROP_ENUMERATE)) { | ||||
| 55235 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55236 | return; | ||||
| 55237 | } | ||||
| 55238 | } | ||||
| 55239 | } | ||||
| 55240 | argv[0].setObject(*returnObj); | ||||
| 55241 | break; | ||||
| 55242 | } while (false); | ||||
| 55243 | |||||
| 55244 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55245 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55246 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55247 | !InitIds(cx, atomsCache)) || | ||||
| 55248 | !GetCallableProperty(cx, atomsCache->passRecordOfRecords_id, &callable)) { | ||||
| 55249 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55250 | return; | ||||
| 55251 | } | ||||
| 55252 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55253 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55254 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55255 | aRv.NoteJSContextException(cx); | ||||
| 55256 | return; | ||||
| 55257 | } | ||||
| 55258 | } | ||||
| 55259 | |||||
| 55260 | void | ||||
| 55261 | TestJSImplInterfaceJSImpl::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55262 | { | ||||
| 55263 | CallSetup s(this, aRv, "TestJSImplInterface.receiveRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55264 | if (aRv.Failed()) { | ||||
| 55265 | return; | ||||
| 55266 | } | ||||
| 55267 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55267); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55267; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55268 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55269 | |||||
| 55270 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55271 | |||||
| 55272 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55273 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55274 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55275 | !InitIds(cx, atomsCache)) || | ||||
| 55276 | !GetCallableProperty(cx, atomsCache->receiveRecord_id, &callable)) { | ||||
| 55277 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55278 | return; | ||||
| 55279 | } | ||||
| 55280 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55281 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55282 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 55283 | aRv.NoteJSContextException(cx); | ||||
| 55284 | return; | ||||
| 55285 | } | ||||
| 55286 | Record<nsString, int32_t>& rvalDecl(aRetVal); | ||||
| 55287 | if (rval.isObject()) { | ||||
| 55288 | auto& recordEntries = rvalDecl.Entries(); | ||||
| 55289 | |||||
| 55290 | JS::Rooted<JSObject*> recordObj(cx, &rval.toObject()); | ||||
| 55291 | JS::RootedVector<jsid> ids(cx); | ||||
| 55292 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 55293 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 55294 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55295 | return; | ||||
| 55296 | } | ||||
| 55297 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 55298 | JS_ReportOutOfMemory(cx); | ||||
| 55299 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55300 | return; | ||||
| 55301 | } | ||||
| 55302 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 55303 | JS::Rooted<JS::Value> temp(cx); | ||||
| 55304 | JS::Rooted<jsid> curId(cx); | ||||
| 55305 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 55306 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 55307 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 55308 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 55309 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 55310 | // around. | ||||
| 55311 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 55312 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 55313 | curId = ids[i]; | ||||
| 55314 | |||||
| 55315 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 55316 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 55317 | &desc)) { | ||||
| 55318 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55319 | return; | ||||
| 55320 | } | ||||
| 55321 | |||||
| 55322 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 55323 | continue; | ||||
| 55324 | } | ||||
| 55325 | |||||
| 55326 | idVal = js::IdToValue(curId); | ||||
| 55327 | nsString propName; | ||||
| 55328 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 55329 | // to do. | ||||
| 55330 | if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecord", propName)) { | ||||
| 55331 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55332 | return; | ||||
| 55333 | } | ||||
| 55334 | |||||
| 55335 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 55336 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55337 | return; | ||||
| 55338 | } | ||||
| 55339 | |||||
| 55340 | Record<nsString, int32_t>::EntryType* entry; | ||||
| 55341 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 55342 | // Find the existing entry. | ||||
| 55343 | auto idx = recordEntries.IndexOf(propName); | ||||
| 55344 | 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", 55345); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55345; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 55345 | "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", 55345); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55345; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55346 | // Now blow it away to make it look like it was just added | ||||
| 55347 | // to the array, because it's not obvious that it's | ||||
| 55348 | // safe to write to its already-initialized mValue via our | ||||
| 55349 | // normal codegen conversions. For example, the value | ||||
| 55350 | // could be a union and this would change its type, but | ||||
| 55351 | // codegen assumes we won't do that. | ||||
| 55352 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 55353 | } else { | ||||
| 55354 | // Safe to do an infallible append here, because we did a | ||||
| 55355 | // SetCapacity above to the right capacity. | ||||
| 55356 | entry = recordEntries.AppendElement(); | ||||
| 55357 | } | ||||
| 55358 | entry->mKey = propName; | ||||
| 55359 | int32_t& slot = entry->mValue; | ||||
| 55360 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecord", &slot)) { | ||||
| 55361 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55362 | return; | ||||
| 55363 | } | ||||
| 55364 | } | ||||
| 55365 | } else { | ||||
| 55366 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecord"); | ||||
| 55367 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55368 | return; | ||||
| 55369 | } | ||||
| 55370 | } | ||||
| 55371 | |||||
| 55372 | void | ||||
| 55373 | TestJSImplInterfaceJSImpl::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55374 | { | ||||
| 55375 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55376 | if (aRv.Failed()) { | ||||
| 55377 | return; | ||||
| 55378 | } | ||||
| 55379 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55379); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55379; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55380 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55381 | |||||
| 55382 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55383 | |||||
| 55384 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55385 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55386 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55387 | !InitIds(cx, atomsCache)) || | ||||
| 55388 | !GetCallableProperty(cx, atomsCache->receiveNullableRecord_id, &callable)) { | ||||
| 55389 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55390 | return; | ||||
| 55391 | } | ||||
| 55392 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55393 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55394 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 55395 | aRv.NoteJSContextException(cx); | ||||
| 55396 | return; | ||||
| 55397 | } | ||||
| 55398 | Nullable<Record<nsString, int32_t>>& rvalDecl(aRetVal); | ||||
| 55399 | if (rval.isObject()) { | ||||
| 55400 | auto& recordEntries = rvalDecl.SetValue().Entries(); | ||||
| 55401 | |||||
| 55402 | JS::Rooted<JSObject*> recordObj(cx, &rval.toObject()); | ||||
| 55403 | JS::RootedVector<jsid> ids(cx); | ||||
| 55404 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 55405 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 55406 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55407 | return; | ||||
| 55408 | } | ||||
| 55409 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 55410 | JS_ReportOutOfMemory(cx); | ||||
| 55411 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55412 | return; | ||||
| 55413 | } | ||||
| 55414 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 55415 | JS::Rooted<JS::Value> temp(cx); | ||||
| 55416 | JS::Rooted<jsid> curId(cx); | ||||
| 55417 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 55418 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 55419 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 55420 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 55421 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 55422 | // around. | ||||
| 55423 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 55424 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 55425 | curId = ids[i]; | ||||
| 55426 | |||||
| 55427 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 55428 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 55429 | &desc)) { | ||||
| 55430 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55431 | return; | ||||
| 55432 | } | ||||
| 55433 | |||||
| 55434 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 55435 | continue; | ||||
| 55436 | } | ||||
| 55437 | |||||
| 55438 | idVal = js::IdToValue(curId); | ||||
| 55439 | nsString propName; | ||||
| 55440 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 55441 | // to do. | ||||
| 55442 | if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecord", propName)) { | ||||
| 55443 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55444 | return; | ||||
| 55445 | } | ||||
| 55446 | |||||
| 55447 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 55448 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55449 | return; | ||||
| 55450 | } | ||||
| 55451 | |||||
| 55452 | Record<nsString, int32_t>::EntryType* entry; | ||||
| 55453 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 55454 | // Find the existing entry. | ||||
| 55455 | auto idx = recordEntries.IndexOf(propName); | ||||
| 55456 | 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", 55457); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55457; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 55457 | "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", 55457); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55457; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55458 | // Now blow it away to make it look like it was just added | ||||
| 55459 | // to the array, because it's not obvious that it's | ||||
| 55460 | // safe to write to its already-initialized mValue via our | ||||
| 55461 | // normal codegen conversions. For example, the value | ||||
| 55462 | // could be a union and this would change its type, but | ||||
| 55463 | // codegen assumes we won't do that. | ||||
| 55464 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 55465 | } else { | ||||
| 55466 | // Safe to do an infallible append here, because we did a | ||||
| 55467 | // SetCapacity above to the right capacity. | ||||
| 55468 | entry = recordEntries.AppendElement(); | ||||
| 55469 | } | ||||
| 55470 | entry->mKey = propName; | ||||
| 55471 | int32_t& slot = entry->mValue; | ||||
| 55472 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecord", &slot)) { | ||||
| 55473 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55474 | return; | ||||
| 55475 | } | ||||
| 55476 | } | ||||
| 55477 | } else if (rval.isNullOrUndefined()) { | ||||
| 55478 | rvalDecl.SetNull(); | ||||
| 55479 | } else { | ||||
| 55480 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecord"); | ||||
| 55481 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55482 | return; | ||||
| 55483 | } | ||||
| 55484 | } | ||||
| 55485 | |||||
| 55486 | void | ||||
| 55487 | TestJSImplInterfaceJSImpl::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55488 | { | ||||
| 55489 | CallSetup s(this, aRv, "TestJSImplInterface.receiveRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55490 | if (aRv.Failed()) { | ||||
| 55491 | return; | ||||
| 55492 | } | ||||
| 55493 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55493); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55493; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55494 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55495 | |||||
| 55496 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55497 | |||||
| 55498 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55499 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55500 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55501 | !InitIds(cx, atomsCache)) || | ||||
| 55502 | !GetCallableProperty(cx, atomsCache->receiveRecordOfNullableInts_id, &callable)) { | ||||
| 55503 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55504 | return; | ||||
| 55505 | } | ||||
| 55506 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55507 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55508 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 55509 | aRv.NoteJSContextException(cx); | ||||
| 55510 | return; | ||||
| 55511 | } | ||||
| 55512 | Record<nsString, Nullable<int32_t>>& rvalDecl(aRetVal); | ||||
| 55513 | if (rval.isObject()) { | ||||
| 55514 | auto& recordEntries = rvalDecl.Entries(); | ||||
| 55515 | |||||
| 55516 | JS::Rooted<JSObject*> recordObj(cx, &rval.toObject()); | ||||
| 55517 | JS::RootedVector<jsid> ids(cx); | ||||
| 55518 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 55519 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 55520 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55521 | return; | ||||
| 55522 | } | ||||
| 55523 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 55524 | JS_ReportOutOfMemory(cx); | ||||
| 55525 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55526 | return; | ||||
| 55527 | } | ||||
| 55528 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 55529 | JS::Rooted<JS::Value> temp(cx); | ||||
| 55530 | JS::Rooted<jsid> curId(cx); | ||||
| 55531 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 55532 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 55533 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 55534 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 55535 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 55536 | // around. | ||||
| 55537 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 55538 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 55539 | curId = ids[i]; | ||||
| 55540 | |||||
| 55541 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 55542 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 55543 | &desc)) { | ||||
| 55544 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55545 | return; | ||||
| 55546 | } | ||||
| 55547 | |||||
| 55548 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 55549 | continue; | ||||
| 55550 | } | ||||
| 55551 | |||||
| 55552 | idVal = js::IdToValue(curId); | ||||
| 55553 | nsString propName; | ||||
| 55554 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 55555 | // to do. | ||||
| 55556 | if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecordOfNullableInts", propName)) { | ||||
| 55557 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55558 | return; | ||||
| 55559 | } | ||||
| 55560 | |||||
| 55561 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 55562 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55563 | return; | ||||
| 55564 | } | ||||
| 55565 | |||||
| 55566 | Record<nsString, Nullable<int32_t>>::EntryType* entry; | ||||
| 55567 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 55568 | // Find the existing entry. | ||||
| 55569 | auto idx = recordEntries.IndexOf(propName); | ||||
| 55570 | 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", 55571); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55571; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 55571 | "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", 55571); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55571; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55572 | // Now blow it away to make it look like it was just added | ||||
| 55573 | // to the array, because it's not obvious that it's | ||||
| 55574 | // safe to write to its already-initialized mValue via our | ||||
| 55575 | // normal codegen conversions. For example, the value | ||||
| 55576 | // could be a union and this would change its type, but | ||||
| 55577 | // codegen assumes we won't do that. | ||||
| 55578 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 55579 | } else { | ||||
| 55580 | // Safe to do an infallible append here, because we did a | ||||
| 55581 | // SetCapacity above to the right capacity. | ||||
| 55582 | entry = recordEntries.AppendElement(); | ||||
| 55583 | } | ||||
| 55584 | entry->mKey = propName; | ||||
| 55585 | Nullable<int32_t>& slot = entry->mValue; | ||||
| 55586 | if (temp.isNullOrUndefined()) { | ||||
| 55587 | slot.SetNull(); | ||||
| 55588 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecordOfNullableInts", &slot.SetValue())) { | ||||
| 55589 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55590 | return; | ||||
| 55591 | } | ||||
| 55592 | } | ||||
| 55593 | } else { | ||||
| 55594 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecordOfNullableInts"); | ||||
| 55595 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55596 | return; | ||||
| 55597 | } | ||||
| 55598 | } | ||||
| 55599 | |||||
| 55600 | void | ||||
| 55601 | TestJSImplInterfaceJSImpl::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55602 | { | ||||
| 55603 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55604 | if (aRv.Failed()) { | ||||
| 55605 | return; | ||||
| 55606 | } | ||||
| 55607 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55607); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55607; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55608 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55609 | |||||
| 55610 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55611 | |||||
| 55612 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55613 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55614 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55615 | !InitIds(cx, atomsCache)) || | ||||
| 55616 | !GetCallableProperty(cx, atomsCache->receiveNullableRecordOfNullableInts_id, &callable)) { | ||||
| 55617 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55618 | return; | ||||
| 55619 | } | ||||
| 55620 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55621 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55622 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 55623 | aRv.NoteJSContextException(cx); | ||||
| 55624 | return; | ||||
| 55625 | } | ||||
| 55626 | Nullable<Record<nsString, Nullable<int32_t>>>& rvalDecl(aRetVal); | ||||
| 55627 | if (rval.isObject()) { | ||||
| 55628 | auto& recordEntries = rvalDecl.SetValue().Entries(); | ||||
| 55629 | |||||
| 55630 | JS::Rooted<JSObject*> recordObj(cx, &rval.toObject()); | ||||
| 55631 | JS::RootedVector<jsid> ids(cx); | ||||
| 55632 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 55633 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 55634 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55635 | return; | ||||
| 55636 | } | ||||
| 55637 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 55638 | JS_ReportOutOfMemory(cx); | ||||
| 55639 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55640 | return; | ||||
| 55641 | } | ||||
| 55642 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 55643 | JS::Rooted<JS::Value> temp(cx); | ||||
| 55644 | JS::Rooted<jsid> curId(cx); | ||||
| 55645 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 55646 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 55647 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 55648 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 55649 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 55650 | // around. | ||||
| 55651 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 55652 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 55653 | curId = ids[i]; | ||||
| 55654 | |||||
| 55655 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 55656 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 55657 | &desc)) { | ||||
| 55658 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55659 | return; | ||||
| 55660 | } | ||||
| 55661 | |||||
| 55662 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 55663 | continue; | ||||
| 55664 | } | ||||
| 55665 | |||||
| 55666 | idVal = js::IdToValue(curId); | ||||
| 55667 | nsString propName; | ||||
| 55668 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 55669 | // to do. | ||||
| 55670 | if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", propName)) { | ||||
| 55671 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55672 | return; | ||||
| 55673 | } | ||||
| 55674 | |||||
| 55675 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 55676 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55677 | return; | ||||
| 55678 | } | ||||
| 55679 | |||||
| 55680 | Record<nsString, Nullable<int32_t>>::EntryType* entry; | ||||
| 55681 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 55682 | // Find the existing entry. | ||||
| 55683 | auto idx = recordEntries.IndexOf(propName); | ||||
| 55684 | 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", 55685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55685; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 55685 | "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", 55685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55685; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55686 | // Now blow it away to make it look like it was just added | ||||
| 55687 | // to the array, because it's not obvious that it's | ||||
| 55688 | // safe to write to its already-initialized mValue via our | ||||
| 55689 | // normal codegen conversions. For example, the value | ||||
| 55690 | // could be a union and this would change its type, but | ||||
| 55691 | // codegen assumes we won't do that. | ||||
| 55692 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 55693 | } else { | ||||
| 55694 | // Safe to do an infallible append here, because we did a | ||||
| 55695 | // SetCapacity above to the right capacity. | ||||
| 55696 | entry = recordEntries.AppendElement(); | ||||
| 55697 | } | ||||
| 55698 | entry->mKey = propName; | ||||
| 55699 | Nullable<int32_t>& slot = entry->mValue; | ||||
| 55700 | if (temp.isNullOrUndefined()) { | ||||
| 55701 | slot.SetNull(); | ||||
| 55702 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", &slot.SetValue())) { | ||||
| 55703 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55704 | return; | ||||
| 55705 | } | ||||
| 55706 | } | ||||
| 55707 | } else if (rval.isNullOrUndefined()) { | ||||
| 55708 | rvalDecl.SetNull(); | ||||
| 55709 | } else { | ||||
| 55710 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecordOfNullableInts"); | ||||
| 55711 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55712 | return; | ||||
| 55713 | } | ||||
| 55714 | } | ||||
| 55715 | |||||
| 55716 | void | ||||
| 55717 | TestJSImplInterfaceJSImpl::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55718 | { | ||||
| 55719 | CallSetup s(this, aRv, "TestJSImplInterface.receiveAnyRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55720 | if (aRv.Failed()) { | ||||
| 55721 | return; | ||||
| 55722 | } | ||||
| 55723 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55723); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55723; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55724 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55725 | |||||
| 55726 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55727 | |||||
| 55728 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55729 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55730 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55731 | !InitIds(cx, atomsCache)) || | ||||
| 55732 | !GetCallableProperty(cx, atomsCache->receiveAnyRecord_id, &callable)) { | ||||
| 55733 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55734 | return; | ||||
| 55735 | } | ||||
| 55736 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55737 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55738 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 55739 | aRv.NoteJSContextException(cx); | ||||
| 55740 | return; | ||||
| 55741 | } | ||||
| 55742 | Record<nsString, JS::Value>& rvalDecl(aRetVal); | ||||
| 55743 | if (rval.isObject()) { | ||||
| 55744 | auto& recordEntries = rvalDecl.Entries(); | ||||
| 55745 | |||||
| 55746 | JS::Rooted<JSObject*> recordObj(cx, &rval.toObject()); | ||||
| 55747 | JS::RootedVector<jsid> ids(cx); | ||||
| 55748 | if (!js::GetPropertyKeys(cx, recordObj, | ||||
| 55749 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | ||||
| 55750 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55751 | return; | ||||
| 55752 | } | ||||
| 55753 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | ||||
| 55754 | JS_ReportOutOfMemory(cx); | ||||
| 55755 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55756 | return; | ||||
| 55757 | } | ||||
| 55758 | JS::Rooted<JS::Value> propNameValue(cx); | ||||
| 55759 | JS::Rooted<JS::Value> temp(cx); | ||||
| 55760 | JS::Rooted<jsid> curId(cx); | ||||
| 55761 | JS::Rooted<JS::Value> idVal(cx); | ||||
| 55762 | // Use a hashset to keep track of ids seen, to avoid | ||||
| 55763 | // introducing nasty O(N^2) behavior scanning for them all the | ||||
| 55764 | // time. Ideally we'd use a data structure with O(1) lookup | ||||
| 55765 | // _and_ ordering for the MozMap, but we don't have one lying | ||||
| 55766 | // around. | ||||
| 55767 | nsTHashtable<nsStringHashKey> idsSeen; | ||||
| 55768 | for (size_t i = 0; i < ids.length(); ++i) { | ||||
| 55769 | curId = ids[i]; | ||||
| 55770 | |||||
| 55771 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | ||||
| 55772 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | ||||
| 55773 | &desc)) { | ||||
| 55774 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55775 | return; | ||||
| 55776 | } | ||||
| 55777 | |||||
| 55778 | if (desc.isNothing() || !desc->enumerable()) { | ||||
| 55779 | continue; | ||||
| 55780 | } | ||||
| 55781 | |||||
| 55782 | idVal = js::IdToValue(curId); | ||||
| 55783 | nsString propName; | ||||
| 55784 | // This will just throw if idVal is a Symbol, like the spec says | ||||
| 55785 | // to do. | ||||
| 55786 | if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveAnyRecord", propName)) { | ||||
| 55787 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55788 | return; | ||||
| 55789 | } | ||||
| 55790 | |||||
| 55791 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | ||||
| 55792 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55793 | return; | ||||
| 55794 | } | ||||
| 55795 | |||||
| 55796 | Record<nsString, JS::Value>::EntryType* entry; | ||||
| 55797 | if (!idsSeen.EnsureInserted(propName)) { | ||||
| 55798 | // Find the existing entry. | ||||
| 55799 | auto idx = recordEntries.IndexOf(propName); | ||||
| 55800 | 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", 55801); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55801; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | ||||
| 55801 | "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", 55801); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 55801; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55802 | // Now blow it away to make it look like it was just added | ||||
| 55803 | // to the array, because it's not obvious that it's | ||||
| 55804 | // safe to write to its already-initialized mValue via our | ||||
| 55805 | // normal codegen conversions. For example, the value | ||||
| 55806 | // could be a union and this would change its type, but | ||||
| 55807 | // codegen assumes we won't do that. | ||||
| 55808 | entry = recordEntries.ReconstructElementAt(idx); | ||||
| 55809 | } else { | ||||
| 55810 | // Safe to do an infallible append here, because we did a | ||||
| 55811 | // SetCapacity above to the right capacity. | ||||
| 55812 | entry = recordEntries.AppendElement(); | ||||
| 55813 | } | ||||
| 55814 | entry->mKey = propName; | ||||
| 55815 | JS::Value& slot = entry->mValue; | ||||
| 55816 | #ifdef __clang__1 | ||||
| 55817 | #pragma clang diagnostic push | ||||
| 55818 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 55819 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 55820 | #endif // __clang__ | ||||
| 55821 | if ((false) && !CallerSubsumes(temp)) { | ||||
| 55822 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in return value of TestJSImplInterface.receiveAnyRecord"); | ||||
| 55823 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55824 | return; | ||||
| 55825 | } | ||||
| 55826 | #ifdef __clang__1 | ||||
| 55827 | #pragma clang diagnostic pop | ||||
| 55828 | #endif // __clang__ | ||||
| 55829 | slot = temp; | ||||
| 55830 | } | ||||
| 55831 | } else { | ||||
| 55832 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveAnyRecord"); | ||||
| 55833 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55834 | return; | ||||
| 55835 | } | ||||
| 55836 | } | ||||
| 55837 | |||||
| 55838 | void | ||||
| 55839 | TestJSImplInterfaceJSImpl::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55840 | { | ||||
| 55841 | CallSetup s(this, aRv, "TestJSImplInterface.passArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55842 | if (aRv.Failed()) { | ||||
| 55843 | return; | ||||
| 55844 | } | ||||
| 55845 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55845); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55845; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55846 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55847 | |||||
| 55848 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55849 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55850 | if (!argv.resize(1)) { | ||||
| 55851 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55852 | // the right thing with that. | ||||
| 55853 | return; | ||||
| 55854 | } | ||||
| 55855 | unsigned argc = 1; | ||||
| 55856 | |||||
| 55857 | do { | ||||
| 55858 | argv[0].setObject(*arg.Obj()); | ||||
| 55859 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 55860 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55861 | return; | ||||
| 55862 | } | ||||
| 55863 | break; | ||||
| 55864 | } while (false); | ||||
| 55865 | |||||
| 55866 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55867 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55868 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55869 | !InitIds(cx, atomsCache)) || | ||||
| 55870 | !GetCallableProperty(cx, atomsCache->passArrayBuffer_id, &callable)) { | ||||
| 55871 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55872 | return; | ||||
| 55873 | } | ||||
| 55874 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55875 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55876 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55877 | aRv.NoteJSContextException(cx); | ||||
| 55878 | return; | ||||
| 55879 | } | ||||
| 55880 | } | ||||
| 55881 | |||||
| 55882 | void | ||||
| 55883 | TestJSImplInterfaceJSImpl::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55884 | { | ||||
| 55885 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55886 | if (aRv.Failed()) { | ||||
| 55887 | return; | ||||
| 55888 | } | ||||
| 55889 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55889); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55889; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55890 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55891 | |||||
| 55892 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55893 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55894 | if (!argv.resize(1)) { | ||||
| 55895 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55896 | // the right thing with that. | ||||
| 55897 | return; | ||||
| 55898 | } | ||||
| 55899 | unsigned argc = 1; | ||||
| 55900 | |||||
| 55901 | do { | ||||
| 55902 | if (arg.IsNull()) { | ||||
| 55903 | argv[0].setNull(); | ||||
| 55904 | break; | ||||
| 55905 | } | ||||
| 55906 | argv[0].setObject(*arg.Value().Obj()); | ||||
| 55907 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 55908 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55909 | return; | ||||
| 55910 | } | ||||
| 55911 | break; | ||||
| 55912 | } while (false); | ||||
| 55913 | |||||
| 55914 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55915 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55916 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55917 | !InitIds(cx, atomsCache)) || | ||||
| 55918 | !GetCallableProperty(cx, atomsCache->passNullableArrayBuffer_id, &callable)) { | ||||
| 55919 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55920 | return; | ||||
| 55921 | } | ||||
| 55922 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55923 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55924 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55925 | aRv.NoteJSContextException(cx); | ||||
| 55926 | return; | ||||
| 55927 | } | ||||
| 55928 | } | ||||
| 55929 | |||||
| 55930 | void | ||||
| 55931 | TestJSImplInterfaceJSImpl::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55932 | { | ||||
| 55933 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55934 | if (aRv.Failed()) { | ||||
| 55935 | return; | ||||
| 55936 | } | ||||
| 55937 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55937); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55937; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55938 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55939 | |||||
| 55940 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55941 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55942 | if (!argv.resize(1)) { | ||||
| 55943 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55944 | // the right thing with that. | ||||
| 55945 | return; | ||||
| 55946 | } | ||||
| 55947 | unsigned argc = 1; | ||||
| 55948 | |||||
| 55949 | do { | ||||
| 55950 | if (arg.WasPassed()) { | ||||
| 55951 | argv[0].setObject(*arg.Value().Obj()); | ||||
| 55952 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 55953 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55954 | return; | ||||
| 55955 | } | ||||
| 55956 | break; | ||||
| 55957 | } else if (argc == 1) { | ||||
| 55958 | // This is our current trailing argument; reduce argc | ||||
| 55959 | --argc; | ||||
| 55960 | } else { | ||||
| 55961 | argv[0].setUndefined(); | ||||
| 55962 | } | ||||
| 55963 | } while (false); | ||||
| 55964 | |||||
| 55965 | JS::Rooted<JS::Value> callable(cx); | ||||
| 55966 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 55967 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 55968 | !InitIds(cx, atomsCache)) || | ||||
| 55969 | !GetCallableProperty(cx, atomsCache->passOptionalArrayBuffer_id, &callable)) { | ||||
| 55970 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 55971 | return; | ||||
| 55972 | } | ||||
| 55973 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 55974 | if (!JS::Call(cx, thisValue, callable, | ||||
| 55975 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 55976 | aRv.NoteJSContextException(cx); | ||||
| 55977 | return; | ||||
| 55978 | } | ||||
| 55979 | } | ||||
| 55980 | |||||
| 55981 | void | ||||
| 55982 | TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 55983 | { | ||||
| 55984 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 55985 | if (aRv.Failed()) { | ||||
| 55986 | return; | ||||
| 55987 | } | ||||
| 55988 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 55988); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 55988; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 55989 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 55990 | |||||
| 55991 | JS::Rooted<JS::Value> rval(cx); | ||||
| 55992 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 55993 | if (!argv.resize(1)) { | ||||
| 55994 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 55995 | // the right thing with that. | ||||
| 55996 | return; | ||||
| 55997 | } | ||||
| 55998 | unsigned argc = 1; | ||||
| 55999 | |||||
| 56000 | do { | ||||
| 56001 | if (arg.WasPassed()) { | ||||
| 56002 | if (arg.Value().IsNull()) { | ||||
| 56003 | argv[0].setNull(); | ||||
| 56004 | break; | ||||
| 56005 | } | ||||
| 56006 | argv[0].setObject(*arg.Value().Value().Obj()); | ||||
| 56007 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56008 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56009 | return; | ||||
| 56010 | } | ||||
| 56011 | break; | ||||
| 56012 | } else if (argc == 1) { | ||||
| 56013 | // This is our current trailing argument; reduce argc | ||||
| 56014 | --argc; | ||||
| 56015 | } else { | ||||
| 56016 | argv[0].setUndefined(); | ||||
| 56017 | } | ||||
| 56018 | } while (false); | ||||
| 56019 | |||||
| 56020 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56021 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56022 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56023 | !InitIds(cx, atomsCache)) || | ||||
| 56024 | !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBuffer_id, &callable)) { | ||||
| 56025 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56026 | return; | ||||
| 56027 | } | ||||
| 56028 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56029 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56030 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56031 | aRv.NoteJSContextException(cx); | ||||
| 56032 | return; | ||||
| 56033 | } | ||||
| 56034 | } | ||||
| 56035 | |||||
| 56036 | void | ||||
| 56037 | TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56038 | { | ||||
| 56039 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56040 | if (aRv.Failed()) { | ||||
| 56041 | return; | ||||
| 56042 | } | ||||
| 56043 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56043); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56043; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56044 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56045 | |||||
| 56046 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56047 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56048 | if (!argv.resize(1)) { | ||||
| 56049 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56050 | // the right thing with that. | ||||
| 56051 | return; | ||||
| 56052 | } | ||||
| 56053 | unsigned argc = 1; | ||||
| 56054 | |||||
| 56055 | do { | ||||
| 56056 | if (arg.IsNull()) { | ||||
| 56057 | argv[0].setNull(); | ||||
| 56058 | break; | ||||
| 56059 | } | ||||
| 56060 | argv[0].setObject(*arg.Value().Obj()); | ||||
| 56061 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56062 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56063 | return; | ||||
| 56064 | } | ||||
| 56065 | break; | ||||
| 56066 | } while (false); | ||||
| 56067 | |||||
| 56068 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56069 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56070 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56071 | !InitIds(cx, atomsCache)) || | ||||
| 56072 | !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id, &callable)) { | ||||
| 56073 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56074 | return; | ||||
| 56075 | } | ||||
| 56076 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56077 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56078 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56079 | aRv.NoteJSContextException(cx); | ||||
| 56080 | return; | ||||
| 56081 | } | ||||
| 56082 | } | ||||
| 56083 | |||||
| 56084 | void | ||||
| 56085 | TestJSImplInterfaceJSImpl::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56086 | { | ||||
| 56087 | CallSetup s(this, aRv, "TestJSImplInterface.passArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56088 | if (aRv.Failed()) { | ||||
| 56089 | return; | ||||
| 56090 | } | ||||
| 56091 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56091); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56091; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56092 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56093 | |||||
| 56094 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56095 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56096 | if (!argv.resize(1)) { | ||||
| 56097 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56098 | // the right thing with that. | ||||
| 56099 | return; | ||||
| 56100 | } | ||||
| 56101 | unsigned argc = 1; | ||||
| 56102 | |||||
| 56103 | do { | ||||
| 56104 | argv[0].setObject(*arg.Obj()); | ||||
| 56105 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56106 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56107 | return; | ||||
| 56108 | } | ||||
| 56109 | break; | ||||
| 56110 | } while (false); | ||||
| 56111 | |||||
| 56112 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56113 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56114 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56115 | !InitIds(cx, atomsCache)) || | ||||
| 56116 | !GetCallableProperty(cx, atomsCache->passArrayBufferView_id, &callable)) { | ||||
| 56117 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56118 | return; | ||||
| 56119 | } | ||||
| 56120 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56121 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56122 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56123 | aRv.NoteJSContextException(cx); | ||||
| 56124 | return; | ||||
| 56125 | } | ||||
| 56126 | } | ||||
| 56127 | |||||
| 56128 | void | ||||
| 56129 | TestJSImplInterfaceJSImpl::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56130 | { | ||||
| 56131 | CallSetup s(this, aRv, "TestJSImplInterface.passInt8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56132 | if (aRv.Failed()) { | ||||
| 56133 | return; | ||||
| 56134 | } | ||||
| 56135 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56135); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56135; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56136 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56137 | |||||
| 56138 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56139 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56140 | if (!argv.resize(1)) { | ||||
| 56141 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56142 | // the right thing with that. | ||||
| 56143 | return; | ||||
| 56144 | } | ||||
| 56145 | unsigned argc = 1; | ||||
| 56146 | |||||
| 56147 | do { | ||||
| 56148 | argv[0].setObject(*arg.Obj()); | ||||
| 56149 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56150 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56151 | return; | ||||
| 56152 | } | ||||
| 56153 | break; | ||||
| 56154 | } while (false); | ||||
| 56155 | |||||
| 56156 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56157 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56158 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56159 | !InitIds(cx, atomsCache)) || | ||||
| 56160 | !GetCallableProperty(cx, atomsCache->passInt8Array_id, &callable)) { | ||||
| 56161 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56162 | return; | ||||
| 56163 | } | ||||
| 56164 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56165 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56166 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56167 | aRv.NoteJSContextException(cx); | ||||
| 56168 | return; | ||||
| 56169 | } | ||||
| 56170 | } | ||||
| 56171 | |||||
| 56172 | void | ||||
| 56173 | TestJSImplInterfaceJSImpl::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56174 | { | ||||
| 56175 | CallSetup s(this, aRv, "TestJSImplInterface.passInt16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56176 | if (aRv.Failed()) { | ||||
| 56177 | return; | ||||
| 56178 | } | ||||
| 56179 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56179); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56179; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56180 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56181 | |||||
| 56182 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56183 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56184 | if (!argv.resize(1)) { | ||||
| 56185 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56186 | // the right thing with that. | ||||
| 56187 | return; | ||||
| 56188 | } | ||||
| 56189 | unsigned argc = 1; | ||||
| 56190 | |||||
| 56191 | do { | ||||
| 56192 | argv[0].setObject(*arg.Obj()); | ||||
| 56193 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56194 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56195 | return; | ||||
| 56196 | } | ||||
| 56197 | break; | ||||
| 56198 | } while (false); | ||||
| 56199 | |||||
| 56200 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56201 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56202 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56203 | !InitIds(cx, atomsCache)) || | ||||
| 56204 | !GetCallableProperty(cx, atomsCache->passInt16Array_id, &callable)) { | ||||
| 56205 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56206 | return; | ||||
| 56207 | } | ||||
| 56208 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56209 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56210 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56211 | aRv.NoteJSContextException(cx); | ||||
| 56212 | return; | ||||
| 56213 | } | ||||
| 56214 | } | ||||
| 56215 | |||||
| 56216 | void | ||||
| 56217 | TestJSImplInterfaceJSImpl::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56218 | { | ||||
| 56219 | CallSetup s(this, aRv, "TestJSImplInterface.passInt32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56220 | if (aRv.Failed()) { | ||||
| 56221 | return; | ||||
| 56222 | } | ||||
| 56223 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56223); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56223; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56224 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56225 | |||||
| 56226 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56227 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56228 | if (!argv.resize(1)) { | ||||
| 56229 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56230 | // the right thing with that. | ||||
| 56231 | return; | ||||
| 56232 | } | ||||
| 56233 | unsigned argc = 1; | ||||
| 56234 | |||||
| 56235 | do { | ||||
| 56236 | argv[0].setObject(*arg.Obj()); | ||||
| 56237 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56238 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56239 | return; | ||||
| 56240 | } | ||||
| 56241 | break; | ||||
| 56242 | } while (false); | ||||
| 56243 | |||||
| 56244 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56245 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56246 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56247 | !InitIds(cx, atomsCache)) || | ||||
| 56248 | !GetCallableProperty(cx, atomsCache->passInt32Array_id, &callable)) { | ||||
| 56249 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56250 | return; | ||||
| 56251 | } | ||||
| 56252 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56253 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56254 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56255 | aRv.NoteJSContextException(cx); | ||||
| 56256 | return; | ||||
| 56257 | } | ||||
| 56258 | } | ||||
| 56259 | |||||
| 56260 | void | ||||
| 56261 | TestJSImplInterfaceJSImpl::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56262 | { | ||||
| 56263 | CallSetup s(this, aRv, "TestJSImplInterface.passUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56264 | if (aRv.Failed()) { | ||||
| 56265 | return; | ||||
| 56266 | } | ||||
| 56267 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56267); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56267; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56268 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56269 | |||||
| 56270 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56271 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56272 | if (!argv.resize(1)) { | ||||
| 56273 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56274 | // the right thing with that. | ||||
| 56275 | return; | ||||
| 56276 | } | ||||
| 56277 | unsigned argc = 1; | ||||
| 56278 | |||||
| 56279 | do { | ||||
| 56280 | argv[0].setObject(*arg.Obj()); | ||||
| 56281 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56282 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56283 | return; | ||||
| 56284 | } | ||||
| 56285 | break; | ||||
| 56286 | } while (false); | ||||
| 56287 | |||||
| 56288 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56289 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56290 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56291 | !InitIds(cx, atomsCache)) || | ||||
| 56292 | !GetCallableProperty(cx, atomsCache->passUint8Array_id, &callable)) { | ||||
| 56293 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56294 | return; | ||||
| 56295 | } | ||||
| 56296 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56297 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56298 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56299 | aRv.NoteJSContextException(cx); | ||||
| 56300 | return; | ||||
| 56301 | } | ||||
| 56302 | } | ||||
| 56303 | |||||
| 56304 | void | ||||
| 56305 | TestJSImplInterfaceJSImpl::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56306 | { | ||||
| 56307 | CallSetup s(this, aRv, "TestJSImplInterface.passUint16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56308 | if (aRv.Failed()) { | ||||
| 56309 | return; | ||||
| 56310 | } | ||||
| 56311 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56311); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56311; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56312 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56313 | |||||
| 56314 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56315 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56316 | if (!argv.resize(1)) { | ||||
| 56317 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56318 | // the right thing with that. | ||||
| 56319 | return; | ||||
| 56320 | } | ||||
| 56321 | unsigned argc = 1; | ||||
| 56322 | |||||
| 56323 | do { | ||||
| 56324 | argv[0].setObject(*arg.Obj()); | ||||
| 56325 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56326 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56327 | return; | ||||
| 56328 | } | ||||
| 56329 | break; | ||||
| 56330 | } while (false); | ||||
| 56331 | |||||
| 56332 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56333 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56334 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56335 | !InitIds(cx, atomsCache)) || | ||||
| 56336 | !GetCallableProperty(cx, atomsCache->passUint16Array_id, &callable)) { | ||||
| 56337 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56338 | return; | ||||
| 56339 | } | ||||
| 56340 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56341 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56342 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56343 | aRv.NoteJSContextException(cx); | ||||
| 56344 | return; | ||||
| 56345 | } | ||||
| 56346 | } | ||||
| 56347 | |||||
| 56348 | void | ||||
| 56349 | TestJSImplInterfaceJSImpl::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56350 | { | ||||
| 56351 | CallSetup s(this, aRv, "TestJSImplInterface.passUint32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56352 | if (aRv.Failed()) { | ||||
| 56353 | return; | ||||
| 56354 | } | ||||
| 56355 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56355); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56355; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56356 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56357 | |||||
| 56358 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56359 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56360 | if (!argv.resize(1)) { | ||||
| 56361 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56362 | // the right thing with that. | ||||
| 56363 | return; | ||||
| 56364 | } | ||||
| 56365 | unsigned argc = 1; | ||||
| 56366 | |||||
| 56367 | do { | ||||
| 56368 | argv[0].setObject(*arg.Obj()); | ||||
| 56369 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56370 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56371 | return; | ||||
| 56372 | } | ||||
| 56373 | break; | ||||
| 56374 | } while (false); | ||||
| 56375 | |||||
| 56376 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56377 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56378 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56379 | !InitIds(cx, atomsCache)) || | ||||
| 56380 | !GetCallableProperty(cx, atomsCache->passUint32Array_id, &callable)) { | ||||
| 56381 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56382 | return; | ||||
| 56383 | } | ||||
| 56384 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56385 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56386 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56387 | aRv.NoteJSContextException(cx); | ||||
| 56388 | return; | ||||
| 56389 | } | ||||
| 56390 | } | ||||
| 56391 | |||||
| 56392 | void | ||||
| 56393 | TestJSImplInterfaceJSImpl::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56394 | { | ||||
| 56395 | CallSetup s(this, aRv, "TestJSImplInterface.passUint8ClampedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56396 | if (aRv.Failed()) { | ||||
| 56397 | return; | ||||
| 56398 | } | ||||
| 56399 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56399); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56399; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56400 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56401 | |||||
| 56402 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56403 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56404 | if (!argv.resize(1)) { | ||||
| 56405 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56406 | // the right thing with that. | ||||
| 56407 | return; | ||||
| 56408 | } | ||||
| 56409 | unsigned argc = 1; | ||||
| 56410 | |||||
| 56411 | do { | ||||
| 56412 | argv[0].setObject(*arg.Obj()); | ||||
| 56413 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56414 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56415 | return; | ||||
| 56416 | } | ||||
| 56417 | break; | ||||
| 56418 | } while (false); | ||||
| 56419 | |||||
| 56420 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56421 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56422 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56423 | !InitIds(cx, atomsCache)) || | ||||
| 56424 | !GetCallableProperty(cx, atomsCache->passUint8ClampedArray_id, &callable)) { | ||||
| 56425 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56426 | return; | ||||
| 56427 | } | ||||
| 56428 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56429 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56430 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56431 | aRv.NoteJSContextException(cx); | ||||
| 56432 | return; | ||||
| 56433 | } | ||||
| 56434 | } | ||||
| 56435 | |||||
| 56436 | void | ||||
| 56437 | TestJSImplInterfaceJSImpl::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56438 | { | ||||
| 56439 | CallSetup s(this, aRv, "TestJSImplInterface.passFloat32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56440 | if (aRv.Failed()) { | ||||
| 56441 | return; | ||||
| 56442 | } | ||||
| 56443 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56443); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56443; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56444 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56445 | |||||
| 56446 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56447 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56448 | if (!argv.resize(1)) { | ||||
| 56449 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56450 | // the right thing with that. | ||||
| 56451 | return; | ||||
| 56452 | } | ||||
| 56453 | unsigned argc = 1; | ||||
| 56454 | |||||
| 56455 | do { | ||||
| 56456 | argv[0].setObject(*arg.Obj()); | ||||
| 56457 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56458 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56459 | return; | ||||
| 56460 | } | ||||
| 56461 | break; | ||||
| 56462 | } while (false); | ||||
| 56463 | |||||
| 56464 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56465 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56466 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56467 | !InitIds(cx, atomsCache)) || | ||||
| 56468 | !GetCallableProperty(cx, atomsCache->passFloat32Array_id, &callable)) { | ||||
| 56469 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56470 | return; | ||||
| 56471 | } | ||||
| 56472 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56473 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56474 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56475 | aRv.NoteJSContextException(cx); | ||||
| 56476 | return; | ||||
| 56477 | } | ||||
| 56478 | } | ||||
| 56479 | |||||
| 56480 | void | ||||
| 56481 | TestJSImplInterfaceJSImpl::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56482 | { | ||||
| 56483 | CallSetup s(this, aRv, "TestJSImplInterface.passFloat64Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56484 | if (aRv.Failed()) { | ||||
| 56485 | return; | ||||
| 56486 | } | ||||
| 56487 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56487); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56487; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56488 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56489 | |||||
| 56490 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56491 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56492 | if (!argv.resize(1)) { | ||||
| 56493 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56494 | // the right thing with that. | ||||
| 56495 | return; | ||||
| 56496 | } | ||||
| 56497 | unsigned argc = 1; | ||||
| 56498 | |||||
| 56499 | do { | ||||
| 56500 | argv[0].setObject(*arg.Obj()); | ||||
| 56501 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 56502 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56503 | return; | ||||
| 56504 | } | ||||
| 56505 | break; | ||||
| 56506 | } while (false); | ||||
| 56507 | |||||
| 56508 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56509 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56510 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56511 | !InitIds(cx, atomsCache)) || | ||||
| 56512 | !GetCallableProperty(cx, atomsCache->passFloat64Array_id, &callable)) { | ||||
| 56513 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56514 | return; | ||||
| 56515 | } | ||||
| 56516 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56517 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56518 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56519 | aRv.NoteJSContextException(cx); | ||||
| 56520 | return; | ||||
| 56521 | } | ||||
| 56522 | } | ||||
| 56523 | |||||
| 56524 | void | ||||
| 56525 | TestJSImplInterfaceJSImpl::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56526 | { | ||||
| 56527 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56528 | if (aRv.Failed()) { | ||||
| 56529 | return; | ||||
| 56530 | } | ||||
| 56531 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56531); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56531; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56532 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56533 | |||||
| 56534 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56535 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56536 | if (!argv.resize(1)) { | ||||
| 56537 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56538 | // the right thing with that. | ||||
| 56539 | return; | ||||
| 56540 | } | ||||
| 56541 | unsigned argc = 1; | ||||
| 56542 | |||||
| 56543 | do { | ||||
| 56544 | |||||
| 56545 | uint32_t length = arg.Length(); | ||||
| 56546 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 56547 | if (!returnArray) { | ||||
| 56548 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56549 | return; | ||||
| 56550 | } | ||||
| 56551 | // Scope for 'tmp' | ||||
| 56552 | { | ||||
| 56553 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 56554 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 56555 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 56556 | // are different ways to succeed at wrapping the object. | ||||
| 56557 | do { | ||||
| 56558 | tmp.setObject(*arg[sequenceIdx0].Obj()); | ||||
| 56559 | if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) { | ||||
| 56560 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56561 | return; | ||||
| 56562 | } | ||||
| 56563 | break; | ||||
| 56564 | } while (false); | ||||
| 56565 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 56566 | JSPROP_ENUMERATE)) { | ||||
| 56567 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56568 | return; | ||||
| 56569 | } | ||||
| 56570 | } | ||||
| 56571 | } | ||||
| 56572 | argv[0].setObject(*returnArray); | ||||
| 56573 | break; | ||||
| 56574 | } while (false); | ||||
| 56575 | |||||
| 56576 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56577 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56578 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56579 | !InitIds(cx, atomsCache)) || | ||||
| 56580 | !GetCallableProperty(cx, atomsCache->passSequenceOfArrayBuffers_id, &callable)) { | ||||
| 56581 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56582 | return; | ||||
| 56583 | } | ||||
| 56584 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56585 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56586 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56587 | aRv.NoteJSContextException(cx); | ||||
| 56588 | return; | ||||
| 56589 | } | ||||
| 56590 | } | ||||
| 56591 | |||||
| 56592 | void | ||||
| 56593 | TestJSImplInterfaceJSImpl::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56594 | { | ||||
| 56595 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56596 | if (aRv.Failed()) { | ||||
| 56597 | return; | ||||
| 56598 | } | ||||
| 56599 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56599); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56599; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56600 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56601 | |||||
| 56602 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56603 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56604 | if (!argv.resize(1)) { | ||||
| 56605 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56606 | // the right thing with that. | ||||
| 56607 | return; | ||||
| 56608 | } | ||||
| 56609 | unsigned argc = 1; | ||||
| 56610 | |||||
| 56611 | do { | ||||
| 56612 | |||||
| 56613 | uint32_t length = arg.Length(); | ||||
| 56614 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 56615 | if (!returnArray) { | ||||
| 56616 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56617 | return; | ||||
| 56618 | } | ||||
| 56619 | // Scope for 'tmp' | ||||
| 56620 | { | ||||
| 56621 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 56622 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 56623 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 56624 | // are different ways to succeed at wrapping the object. | ||||
| 56625 | do { | ||||
| 56626 | if (arg[sequenceIdx0].IsNull()) { | ||||
| 56627 | tmp.setNull(); | ||||
| 56628 | break; | ||||
| 56629 | } | ||||
| 56630 | tmp.setObject(*arg[sequenceIdx0].Value().Obj()); | ||||
| 56631 | if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) { | ||||
| 56632 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56633 | return; | ||||
| 56634 | } | ||||
| 56635 | break; | ||||
| 56636 | } while (false); | ||||
| 56637 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 56638 | JSPROP_ENUMERATE)) { | ||||
| 56639 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56640 | return; | ||||
| 56641 | } | ||||
| 56642 | } | ||||
| 56643 | } | ||||
| 56644 | argv[0].setObject(*returnArray); | ||||
| 56645 | break; | ||||
| 56646 | } while (false); | ||||
| 56647 | |||||
| 56648 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56649 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56650 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56651 | !InitIds(cx, atomsCache)) || | ||||
| 56652 | !GetCallableProperty(cx, atomsCache->passSequenceOfNullableArrayBuffers_id, &callable)) { | ||||
| 56653 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56654 | return; | ||||
| 56655 | } | ||||
| 56656 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56657 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56658 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56659 | aRv.NoteJSContextException(cx); | ||||
| 56660 | return; | ||||
| 56661 | } | ||||
| 56662 | } | ||||
| 56663 | |||||
| 56664 | void | ||||
| 56665 | TestJSImplInterfaceJSImpl::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56666 | { | ||||
| 56667 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56668 | if (aRv.Failed()) { | ||||
| 56669 | return; | ||||
| 56670 | } | ||||
| 56671 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56671); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56671; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56672 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56673 | |||||
| 56674 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56675 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56676 | if (!argv.resize(1)) { | ||||
| 56677 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56678 | // the right thing with that. | ||||
| 56679 | return; | ||||
| 56680 | } | ||||
| 56681 | unsigned argc = 1; | ||||
| 56682 | |||||
| 56683 | do { | ||||
| 56684 | |||||
| 56685 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 56686 | if (!returnObj) { | ||||
| 56687 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56688 | return; | ||||
| 56689 | } | ||||
| 56690 | // Scope for 'tmp' | ||||
| 56691 | { | ||||
| 56692 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 56693 | for (auto& entry : arg.Entries()) { | ||||
| 56694 | auto& recordValue0 = entry.mValue; | ||||
| 56695 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 56696 | // are different ways to succeed at wrapping the value. | ||||
| 56697 | do { | ||||
| 56698 | tmp.setObject(*recordValue0.Obj()); | ||||
| 56699 | if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) { | ||||
| 56700 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56701 | return; | ||||
| 56702 | } | ||||
| 56703 | break; | ||||
| 56704 | } while (false); | ||||
| 56705 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 56706 | entry.mKey.BeginReading(), | ||||
| 56707 | entry.mKey.Length(), tmp, | ||||
| 56708 | JSPROP_ENUMERATE)) { | ||||
| 56709 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56710 | return; | ||||
| 56711 | } | ||||
| 56712 | } | ||||
| 56713 | } | ||||
| 56714 | argv[0].setObject(*returnObj); | ||||
| 56715 | break; | ||||
| 56716 | } while (false); | ||||
| 56717 | |||||
| 56718 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56719 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56720 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56721 | !InitIds(cx, atomsCache)) || | ||||
| 56722 | !GetCallableProperty(cx, atomsCache->passRecordOfArrayBuffers_id, &callable)) { | ||||
| 56723 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56724 | return; | ||||
| 56725 | } | ||||
| 56726 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56727 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56728 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56729 | aRv.NoteJSContextException(cx); | ||||
| 56730 | return; | ||||
| 56731 | } | ||||
| 56732 | } | ||||
| 56733 | |||||
| 56734 | void | ||||
| 56735 | TestJSImplInterfaceJSImpl::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56736 | { | ||||
| 56737 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56738 | if (aRv.Failed()) { | ||||
| 56739 | return; | ||||
| 56740 | } | ||||
| 56741 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56741); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56741; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56742 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56743 | |||||
| 56744 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56745 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56746 | if (!argv.resize(1)) { | ||||
| 56747 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56748 | // the right thing with that. | ||||
| 56749 | return; | ||||
| 56750 | } | ||||
| 56751 | unsigned argc = 1; | ||||
| 56752 | |||||
| 56753 | do { | ||||
| 56754 | |||||
| 56755 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 56756 | if (!returnObj) { | ||||
| 56757 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56758 | return; | ||||
| 56759 | } | ||||
| 56760 | // Scope for 'tmp' | ||||
| 56761 | { | ||||
| 56762 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 56763 | for (auto& entry : arg.Entries()) { | ||||
| 56764 | auto& recordValue0 = entry.mValue; | ||||
| 56765 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 56766 | // are different ways to succeed at wrapping the value. | ||||
| 56767 | do { | ||||
| 56768 | if (recordValue0.IsNull()) { | ||||
| 56769 | tmp.setNull(); | ||||
| 56770 | break; | ||||
| 56771 | } | ||||
| 56772 | tmp.setObject(*recordValue0.Value().Obj()); | ||||
| 56773 | if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) { | ||||
| 56774 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56775 | return; | ||||
| 56776 | } | ||||
| 56777 | break; | ||||
| 56778 | } while (false); | ||||
| 56779 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 56780 | entry.mKey.BeginReading(), | ||||
| 56781 | entry.mKey.Length(), tmp, | ||||
| 56782 | JSPROP_ENUMERATE)) { | ||||
| 56783 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56784 | return; | ||||
| 56785 | } | ||||
| 56786 | } | ||||
| 56787 | } | ||||
| 56788 | argv[0].setObject(*returnObj); | ||||
| 56789 | break; | ||||
| 56790 | } while (false); | ||||
| 56791 | |||||
| 56792 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56793 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56794 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56795 | !InitIds(cx, atomsCache)) || | ||||
| 56796 | !GetCallableProperty(cx, atomsCache->passRecordOfNullableArrayBuffers_id, &callable)) { | ||||
| 56797 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56798 | return; | ||||
| 56799 | } | ||||
| 56800 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56801 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56802 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56803 | aRv.NoteJSContextException(cx); | ||||
| 56804 | return; | ||||
| 56805 | } | ||||
| 56806 | } | ||||
| 56807 | |||||
| 56808 | void | ||||
| 56809 | TestJSImplInterfaceJSImpl::PassVariadicTypedArray(const nsTArray<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56810 | { | ||||
| 56811 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56812 | if (aRv.Failed()) { | ||||
| 56813 | return; | ||||
| 56814 | } | ||||
| 56815 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56815); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56815; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56816 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56817 | |||||
| 56818 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56819 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56820 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 56821 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56822 | // the right thing with that. | ||||
| 56823 | return; | ||||
| 56824 | } | ||||
| 56825 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 56826 | |||||
| 56827 | do { | ||||
| 56828 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 56829 | argv[0 + idx].setObject(*arg[idx].Obj()); | ||||
| 56830 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) { | ||||
| 56831 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56832 | return; | ||||
| 56833 | } | ||||
| 56834 | continue; | ||||
| 56835 | } | ||||
| 56836 | break; | ||||
| 56837 | } while (false); | ||||
| 56838 | |||||
| 56839 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56840 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56841 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56842 | !InitIds(cx, atomsCache)) || | ||||
| 56843 | !GetCallableProperty(cx, atomsCache->passVariadicTypedArray_id, &callable)) { | ||||
| 56844 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56845 | return; | ||||
| 56846 | } | ||||
| 56847 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56848 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56849 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56850 | aRv.NoteJSContextException(cx); | ||||
| 56851 | return; | ||||
| 56852 | } | ||||
| 56853 | } | ||||
| 56854 | |||||
| 56855 | void | ||||
| 56856 | TestJSImplInterfaceJSImpl::PassVariadicNullableTypedArray(const nsTArray<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56857 | { | ||||
| 56858 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56859 | if (aRv.Failed()) { | ||||
| 56860 | return; | ||||
| 56861 | } | ||||
| 56862 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56862); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56862; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56863 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56864 | |||||
| 56865 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56866 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56867 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 56868 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56869 | // the right thing with that. | ||||
| 56870 | return; | ||||
| 56871 | } | ||||
| 56872 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 56873 | |||||
| 56874 | do { | ||||
| 56875 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 56876 | if (arg[idx].IsNull()) { | ||||
| 56877 | argv[0 + idx].setNull(); | ||||
| 56878 | continue; | ||||
| 56879 | } | ||||
| 56880 | argv[0 + idx].setObject(*arg[idx].Value().Obj()); | ||||
| 56881 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) { | ||||
| 56882 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56883 | return; | ||||
| 56884 | } | ||||
| 56885 | continue; | ||||
| 56886 | } | ||||
| 56887 | break; | ||||
| 56888 | } while (false); | ||||
| 56889 | |||||
| 56890 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56891 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56892 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56893 | !InitIds(cx, atomsCache)) || | ||||
| 56894 | !GetCallableProperty(cx, atomsCache->passVariadicNullableTypedArray_id, &callable)) { | ||||
| 56895 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56896 | return; | ||||
| 56897 | } | ||||
| 56898 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56899 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56900 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 56901 | aRv.NoteJSContextException(cx); | ||||
| 56902 | return; | ||||
| 56903 | } | ||||
| 56904 | } | ||||
| 56905 | |||||
| 56906 | void | ||||
| 56907 | TestJSImplInterfaceJSImpl::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56908 | { | ||||
| 56909 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56910 | if (aRv.Failed()) { | ||||
| 56911 | return; | ||||
| 56912 | } | ||||
| 56913 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56913); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56913; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56914 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56915 | |||||
| 56916 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56917 | |||||
| 56918 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56919 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56920 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56921 | !InitIds(cx, atomsCache)) || | ||||
| 56922 | !GetCallableProperty(cx, atomsCache->receiveUint8Array_id, &callable)) { | ||||
| 56923 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56924 | return; | ||||
| 56925 | } | ||||
| 56926 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56927 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56928 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 56929 | aRv.NoteJSContextException(cx); | ||||
| 56930 | return; | ||||
| 56931 | } | ||||
| 56932 | RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx); | ||||
| 56933 | if (rval.isObject()) { | ||||
| 56934 | if (!rvalDecl.Init(&rval.toObject())) { | ||||
| 56935 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveUint8Array", "Uint8Array"); | ||||
| 56936 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56937 | return; | ||||
| 56938 | } | ||||
| 56939 | if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) { | ||||
| 56940 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.receiveUint8Array"); | ||||
| 56941 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56942 | return; | ||||
| 56943 | } | ||||
| 56944 | if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) { | ||||
| 56945 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.receiveUint8Array"); | ||||
| 56946 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56947 | return; | ||||
| 56948 | } | ||||
| 56949 | if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) { | ||||
| 56950 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.receiveUint8Array"); | ||||
| 56951 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56952 | return; | ||||
| 56953 | } | ||||
| 56954 | } else { | ||||
| 56955 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveUint8Array"); | ||||
| 56956 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56957 | return; | ||||
| 56958 | } | ||||
| 56959 | aRetVal.set(rvalDecl.Obj()); | ||||
| 56960 | } | ||||
| 56961 | |||||
| 56962 | void | ||||
| 56963 | TestJSImplInterfaceJSImpl::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 56964 | { | ||||
| 56965 | CallSetup s(this, aRv, "TestJSImplInterface.passString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 56966 | if (aRv.Failed()) { | ||||
| 56967 | return; | ||||
| 56968 | } | ||||
| 56969 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 56969); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 56969; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 56970 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 56971 | |||||
| 56972 | JS::Rooted<JS::Value> rval(cx); | ||||
| 56973 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 56974 | if (!argv.resize(1)) { | ||||
| 56975 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 56976 | // the right thing with that. | ||||
| 56977 | return; | ||||
| 56978 | } | ||||
| 56979 | unsigned argc = 1; | ||||
| 56980 | |||||
| 56981 | do { | ||||
| 56982 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 56983 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56984 | return; | ||||
| 56985 | } | ||||
| 56986 | break; | ||||
| 56987 | } while (false); | ||||
| 56988 | |||||
| 56989 | JS::Rooted<JS::Value> callable(cx); | ||||
| 56990 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 56991 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 56992 | !InitIds(cx, atomsCache)) || | ||||
| 56993 | !GetCallableProperty(cx, atomsCache->passString_id, &callable)) { | ||||
| 56994 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 56995 | return; | ||||
| 56996 | } | ||||
| 56997 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 56998 | if (!JS::Call(cx, thisValue, callable, | ||||
| 56999 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57000 | aRv.NoteJSContextException(cx); | ||||
| 57001 | return; | ||||
| 57002 | } | ||||
| 57003 | } | ||||
| 57004 | |||||
| 57005 | void | ||||
| 57006 | TestJSImplInterfaceJSImpl::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57007 | { | ||||
| 57008 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57009 | if (aRv.Failed()) { | ||||
| 57010 | return; | ||||
| 57011 | } | ||||
| 57012 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57012); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57012; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57013 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57014 | |||||
| 57015 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57016 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57017 | if (!argv.resize(1)) { | ||||
| 57018 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57019 | // the right thing with that. | ||||
| 57020 | return; | ||||
| 57021 | } | ||||
| 57022 | unsigned argc = 1; | ||||
| 57023 | |||||
| 57024 | do { | ||||
| 57025 | if (!xpc::StringToJsval(cx, arg, argv[0])) { | ||||
| 57026 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57027 | return; | ||||
| 57028 | } | ||||
| 57029 | break; | ||||
| 57030 | } while (false); | ||||
| 57031 | |||||
| 57032 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57033 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57034 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57035 | !InitIds(cx, atomsCache)) || | ||||
| 57036 | !GetCallableProperty(cx, atomsCache->passNullableString_id, &callable)) { | ||||
| 57037 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57038 | return; | ||||
| 57039 | } | ||||
| 57040 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57041 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57042 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57043 | aRv.NoteJSContextException(cx); | ||||
| 57044 | return; | ||||
| 57045 | } | ||||
| 57046 | } | ||||
| 57047 | |||||
| 57048 | void | ||||
| 57049 | TestJSImplInterfaceJSImpl::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57050 | { | ||||
| 57051 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57052 | if (aRv.Failed()) { | ||||
| 57053 | return; | ||||
| 57054 | } | ||||
| 57055 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57055); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57055; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57056 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57057 | |||||
| 57058 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57059 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57060 | if (!argv.resize(1)) { | ||||
| 57061 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57062 | // the right thing with that. | ||||
| 57063 | return; | ||||
| 57064 | } | ||||
| 57065 | unsigned argc = 1; | ||||
| 57066 | |||||
| 57067 | do { | ||||
| 57068 | if (arg.WasPassed()) { | ||||
| 57069 | if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57070 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57071 | return; | ||||
| 57072 | } | ||||
| 57073 | break; | ||||
| 57074 | } else if (argc == 1) { | ||||
| 57075 | // This is our current trailing argument; reduce argc | ||||
| 57076 | --argc; | ||||
| 57077 | } else { | ||||
| 57078 | argv[0].setUndefined(); | ||||
| 57079 | } | ||||
| 57080 | } while (false); | ||||
| 57081 | |||||
| 57082 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57083 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57084 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57085 | !InitIds(cx, atomsCache)) || | ||||
| 57086 | !GetCallableProperty(cx, atomsCache->passOptionalString_id, &callable)) { | ||||
| 57087 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57088 | return; | ||||
| 57089 | } | ||||
| 57090 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57091 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57092 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57093 | aRv.NoteJSContextException(cx); | ||||
| 57094 | return; | ||||
| 57095 | } | ||||
| 57096 | } | ||||
| 57097 | |||||
| 57098 | void | ||||
| 57099 | TestJSImplInterfaceJSImpl::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57100 | { | ||||
| 57101 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57102 | if (aRv.Failed()) { | ||||
| 57103 | return; | ||||
| 57104 | } | ||||
| 57105 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57105); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57105; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57106 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57107 | |||||
| 57108 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57109 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57110 | if (!argv.resize(1)) { | ||||
| 57111 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57112 | // the right thing with that. | ||||
| 57113 | return; | ||||
| 57114 | } | ||||
| 57115 | unsigned argc = 1; | ||||
| 57116 | |||||
| 57117 | do { | ||||
| 57118 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 57119 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57120 | return; | ||||
| 57121 | } | ||||
| 57122 | break; | ||||
| 57123 | } while (false); | ||||
| 57124 | |||||
| 57125 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57126 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57127 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57128 | !InitIds(cx, atomsCache)) || | ||||
| 57129 | !GetCallableProperty(cx, atomsCache->passOptionalStringWithDefaultValue_id, &callable)) { | ||||
| 57130 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57131 | return; | ||||
| 57132 | } | ||||
| 57133 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57134 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57135 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57136 | aRv.NoteJSContextException(cx); | ||||
| 57137 | return; | ||||
| 57138 | } | ||||
| 57139 | } | ||||
| 57140 | |||||
| 57141 | void | ||||
| 57142 | TestJSImplInterfaceJSImpl::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57143 | { | ||||
| 57144 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57145 | if (aRv.Failed()) { | ||||
| 57146 | return; | ||||
| 57147 | } | ||||
| 57148 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57148); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57148; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57149 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57150 | |||||
| 57151 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57152 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57153 | if (!argv.resize(1)) { | ||||
| 57154 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57155 | // the right thing with that. | ||||
| 57156 | return; | ||||
| 57157 | } | ||||
| 57158 | unsigned argc = 1; | ||||
| 57159 | |||||
| 57160 | do { | ||||
| 57161 | if (arg.WasPassed()) { | ||||
| 57162 | if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57163 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57164 | return; | ||||
| 57165 | } | ||||
| 57166 | break; | ||||
| 57167 | } else if (argc == 1) { | ||||
| 57168 | // This is our current trailing argument; reduce argc | ||||
| 57169 | --argc; | ||||
| 57170 | } else { | ||||
| 57171 | argv[0].setUndefined(); | ||||
| 57172 | } | ||||
| 57173 | } while (false); | ||||
| 57174 | |||||
| 57175 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57176 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57177 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57178 | !InitIds(cx, atomsCache)) || | ||||
| 57179 | !GetCallableProperty(cx, atomsCache->passOptionalNullableString_id, &callable)) { | ||||
| 57180 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57181 | return; | ||||
| 57182 | } | ||||
| 57183 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57184 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57185 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57186 | aRv.NoteJSContextException(cx); | ||||
| 57187 | return; | ||||
| 57188 | } | ||||
| 57189 | } | ||||
| 57190 | |||||
| 57191 | void | ||||
| 57192 | TestJSImplInterfaceJSImpl::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57193 | { | ||||
| 57194 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57195 | if (aRv.Failed()) { | ||||
| 57196 | return; | ||||
| 57197 | } | ||||
| 57198 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57198); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57198; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57199 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57200 | |||||
| 57201 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57202 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57203 | if (!argv.resize(1)) { | ||||
| 57204 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57205 | // the right thing with that. | ||||
| 57206 | return; | ||||
| 57207 | } | ||||
| 57208 | unsigned argc = 1; | ||||
| 57209 | |||||
| 57210 | do { | ||||
| 57211 | if (!xpc::StringToJsval(cx, arg, argv[0])) { | ||||
| 57212 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57213 | return; | ||||
| 57214 | } | ||||
| 57215 | break; | ||||
| 57216 | } while (false); | ||||
| 57217 | |||||
| 57218 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57219 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57220 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57221 | !InitIds(cx, atomsCache)) || | ||||
| 57222 | !GetCallableProperty(cx, atomsCache->passOptionalNullableStringWithDefaultValue_id, &callable)) { | ||||
| 57223 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57224 | return; | ||||
| 57225 | } | ||||
| 57226 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57227 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57228 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57229 | aRv.NoteJSContextException(cx); | ||||
| 57230 | return; | ||||
| 57231 | } | ||||
| 57232 | } | ||||
| 57233 | |||||
| 57234 | void | ||||
| 57235 | TestJSImplInterfaceJSImpl::PassVariadicString(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57236 | { | ||||
| 57237 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57238 | if (aRv.Failed()) { | ||||
| 57239 | return; | ||||
| 57240 | } | ||||
| 57241 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57241); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57241; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57242 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57243 | |||||
| 57244 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57245 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57246 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 57247 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57248 | // the right thing with that. | ||||
| 57249 | return; | ||||
| 57250 | } | ||||
| 57251 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 57252 | |||||
| 57253 | do { | ||||
| 57254 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 57255 | if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) { | ||||
| 57256 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57257 | return; | ||||
| 57258 | } | ||||
| 57259 | continue; | ||||
| 57260 | } | ||||
| 57261 | break; | ||||
| 57262 | } while (false); | ||||
| 57263 | |||||
| 57264 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57265 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57266 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57267 | !InitIds(cx, atomsCache)) || | ||||
| 57268 | !GetCallableProperty(cx, atomsCache->passVariadicString_id, &callable)) { | ||||
| 57269 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57270 | return; | ||||
| 57271 | } | ||||
| 57272 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57273 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57274 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57275 | aRv.NoteJSContextException(cx); | ||||
| 57276 | return; | ||||
| 57277 | } | ||||
| 57278 | } | ||||
| 57279 | |||||
| 57280 | void | ||||
| 57281 | TestJSImplInterfaceJSImpl::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57282 | { | ||||
| 57283 | CallSetup s(this, aRv, "TestJSImplInterface.passByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57284 | if (aRv.Failed()) { | ||||
| 57285 | return; | ||||
| 57286 | } | ||||
| 57287 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57287); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57287; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57288 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57289 | |||||
| 57290 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57291 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57292 | if (!argv.resize(1)) { | ||||
| 57293 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57294 | // the right thing with that. | ||||
| 57295 | return; | ||||
| 57296 | } | ||||
| 57297 | unsigned argc = 1; | ||||
| 57298 | |||||
| 57299 | do { | ||||
| 57300 | if (!NonVoidByteStringToJsval(cx, arg, argv[0])) { | ||||
| 57301 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57302 | return; | ||||
| 57303 | } | ||||
| 57304 | break; | ||||
| 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->passByteString_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 | |||||
| 57323 | void | ||||
| 57324 | TestJSImplInterfaceJSImpl::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57325 | { | ||||
| 57326 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableByteString", 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 { *((volatile int *)__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 (!ByteStringToJsval(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->passNullableByteString_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 | |||||
| 57366 | void | ||||
| 57367 | TestJSImplInterfaceJSImpl::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57368 | { | ||||
| 57369 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteString", 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 { *((volatile int *)__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)) { | ||||
| 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; | ||||
| 57384 | |||||
| 57385 | do { | ||||
| 57386 | if (arg.WasPassed()) { | ||||
| 57387 | if (!NonVoidByteStringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57388 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57389 | return; | ||||
| 57390 | } | ||||
| 57391 | break; | ||||
| 57392 | } else if (argc == 1) { | ||||
| 57393 | // This is our current trailing argument; reduce argc | ||||
| 57394 | --argc; | ||||
| 57395 | } else { | ||||
| 57396 | argv[0].setUndefined(); | ||||
| 57397 | } | ||||
| 57398 | } while (false); | ||||
| 57399 | |||||
| 57400 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57401 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57402 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57403 | !InitIds(cx, atomsCache)) || | ||||
| 57404 | !GetCallableProperty(cx, atomsCache->passOptionalByteString_id, &callable)) { | ||||
| 57405 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57406 | return; | ||||
| 57407 | } | ||||
| 57408 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57409 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57410 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57411 | aRv.NoteJSContextException(cx); | ||||
| 57412 | return; | ||||
| 57413 | } | ||||
| 57414 | } | ||||
| 57415 | |||||
| 57416 | void | ||||
| 57417 | TestJSImplInterfaceJSImpl::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57418 | { | ||||
| 57419 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57420 | if (aRv.Failed()) { | ||||
| 57421 | return; | ||||
| 57422 | } | ||||
| 57423 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57423); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57423; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57424 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57425 | |||||
| 57426 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57427 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57428 | if (!argv.resize(1)) { | ||||
| 57429 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57430 | // the right thing with that. | ||||
| 57431 | return; | ||||
| 57432 | } | ||||
| 57433 | unsigned argc = 1; | ||||
| 57434 | |||||
| 57435 | do { | ||||
| 57436 | if (!NonVoidByteStringToJsval(cx, arg, argv[0])) { | ||||
| 57437 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57438 | return; | ||||
| 57439 | } | ||||
| 57440 | break; | ||||
| 57441 | } while (false); | ||||
| 57442 | |||||
| 57443 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57444 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57445 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57446 | !InitIds(cx, atomsCache)) || | ||||
| 57447 | !GetCallableProperty(cx, atomsCache->passOptionalByteStringWithDefaultValue_id, &callable)) { | ||||
| 57448 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57449 | return; | ||||
| 57450 | } | ||||
| 57451 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57452 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57453 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57454 | aRv.NoteJSContextException(cx); | ||||
| 57455 | return; | ||||
| 57456 | } | ||||
| 57457 | } | ||||
| 57458 | |||||
| 57459 | void | ||||
| 57460 | TestJSImplInterfaceJSImpl::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57461 | { | ||||
| 57462 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57463 | if (aRv.Failed()) { | ||||
| 57464 | return; | ||||
| 57465 | } | ||||
| 57466 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57466); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57466; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57467 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57468 | |||||
| 57469 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57470 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57471 | if (!argv.resize(1)) { | ||||
| 57472 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57473 | // the right thing with that. | ||||
| 57474 | return; | ||||
| 57475 | } | ||||
| 57476 | unsigned argc = 1; | ||||
| 57477 | |||||
| 57478 | do { | ||||
| 57479 | if (arg.WasPassed()) { | ||||
| 57480 | if (!ByteStringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57481 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57482 | return; | ||||
| 57483 | } | ||||
| 57484 | break; | ||||
| 57485 | } else if (argc == 1) { | ||||
| 57486 | // This is our current trailing argument; reduce argc | ||||
| 57487 | --argc; | ||||
| 57488 | } else { | ||||
| 57489 | argv[0].setUndefined(); | ||||
| 57490 | } | ||||
| 57491 | } while (false); | ||||
| 57492 | |||||
| 57493 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57494 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57495 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57496 | !InitIds(cx, atomsCache)) || | ||||
| 57497 | !GetCallableProperty(cx, atomsCache->passOptionalNullableByteString_id, &callable)) { | ||||
| 57498 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57499 | return; | ||||
| 57500 | } | ||||
| 57501 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57502 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57503 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57504 | aRv.NoteJSContextException(cx); | ||||
| 57505 | return; | ||||
| 57506 | } | ||||
| 57507 | } | ||||
| 57508 | |||||
| 57509 | void | ||||
| 57510 | TestJSImplInterfaceJSImpl::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57511 | { | ||||
| 57512 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57513 | if (aRv.Failed()) { | ||||
| 57514 | return; | ||||
| 57515 | } | ||||
| 57516 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57516); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57516; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57517 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57518 | |||||
| 57519 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57520 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57521 | if (!argv.resize(1)) { | ||||
| 57522 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57523 | // the right thing with that. | ||||
| 57524 | return; | ||||
| 57525 | } | ||||
| 57526 | unsigned argc = 1; | ||||
| 57527 | |||||
| 57528 | do { | ||||
| 57529 | if (!ByteStringToJsval(cx, arg, argv[0])) { | ||||
| 57530 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57531 | return; | ||||
| 57532 | } | ||||
| 57533 | break; | ||||
| 57534 | } while (false); | ||||
| 57535 | |||||
| 57536 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57537 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57538 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57539 | !InitIds(cx, atomsCache)) || | ||||
| 57540 | !GetCallableProperty(cx, atomsCache->passOptionalNullableByteStringWithDefaultValue_id, &callable)) { | ||||
| 57541 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57542 | return; | ||||
| 57543 | } | ||||
| 57544 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57545 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57546 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57547 | aRv.NoteJSContextException(cx); | ||||
| 57548 | return; | ||||
| 57549 | } | ||||
| 57550 | } | ||||
| 57551 | |||||
| 57552 | void | ||||
| 57553 | TestJSImplInterfaceJSImpl::PassVariadicByteString(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57554 | { | ||||
| 57555 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57556 | if (aRv.Failed()) { | ||||
| 57557 | return; | ||||
| 57558 | } | ||||
| 57559 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57559); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57559; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57560 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57561 | |||||
| 57562 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57563 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57564 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 57565 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57566 | // the right thing with that. | ||||
| 57567 | return; | ||||
| 57568 | } | ||||
| 57569 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 57570 | |||||
| 57571 | do { | ||||
| 57572 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 57573 | if (!NonVoidByteStringToJsval(cx, arg[idx], argv[0 + idx])) { | ||||
| 57574 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57575 | return; | ||||
| 57576 | } | ||||
| 57577 | continue; | ||||
| 57578 | } | ||||
| 57579 | break; | ||||
| 57580 | } while (false); | ||||
| 57581 | |||||
| 57582 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57583 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57584 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57585 | !InitIds(cx, atomsCache)) || | ||||
| 57586 | !GetCallableProperty(cx, atomsCache->passVariadicByteString_id, &callable)) { | ||||
| 57587 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57588 | return; | ||||
| 57589 | } | ||||
| 57590 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57591 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57592 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57593 | aRv.NoteJSContextException(cx); | ||||
| 57594 | return; | ||||
| 57595 | } | ||||
| 57596 | } | ||||
| 57597 | |||||
| 57598 | void | ||||
| 57599 | TestJSImplInterfaceJSImpl::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57600 | { | ||||
| 57601 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57602 | if (aRv.Failed()) { | ||||
| 57603 | return; | ||||
| 57604 | } | ||||
| 57605 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57605); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57605; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57606 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57607 | |||||
| 57608 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57609 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57610 | if (!argv.resize(1)) { | ||||
| 57611 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57612 | // the right thing with that. | ||||
| 57613 | return; | ||||
| 57614 | } | ||||
| 57615 | unsigned argc = 1; | ||||
| 57616 | |||||
| 57617 | do { | ||||
| 57618 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 57619 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 57620 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57621 | return; | ||||
| 57622 | } | ||||
| 57623 | break; | ||||
| 57624 | } while (false); | ||||
| 57625 | |||||
| 57626 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57627 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57628 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57629 | !InitIds(cx, atomsCache)) || | ||||
| 57630 | !GetCallableProperty(cx, atomsCache->passUnionByteString_id, &callable)) { | ||||
| 57631 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57632 | return; | ||||
| 57633 | } | ||||
| 57634 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57635 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57636 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57637 | aRv.NoteJSContextException(cx); | ||||
| 57638 | return; | ||||
| 57639 | } | ||||
| 57640 | } | ||||
| 57641 | |||||
| 57642 | void | ||||
| 57643 | TestJSImplInterfaceJSImpl::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57644 | { | ||||
| 57645 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57646 | if (aRv.Failed()) { | ||||
| 57647 | return; | ||||
| 57648 | } | ||||
| 57649 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57649); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57649; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57650 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57651 | |||||
| 57652 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57653 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57654 | if (!argv.resize(1)) { | ||||
| 57655 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57656 | // the right thing with that. | ||||
| 57657 | return; | ||||
| 57658 | } | ||||
| 57659 | unsigned argc = 1; | ||||
| 57660 | |||||
| 57661 | do { | ||||
| 57662 | if (arg.WasPassed()) { | ||||
| 57663 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 57664 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 57665 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57666 | return; | ||||
| 57667 | } | ||||
| 57668 | break; | ||||
| 57669 | } else if (argc == 1) { | ||||
| 57670 | // This is our current trailing argument; reduce argc | ||||
| 57671 | --argc; | ||||
| 57672 | } else { | ||||
| 57673 | argv[0].setUndefined(); | ||||
| 57674 | } | ||||
| 57675 | } while (false); | ||||
| 57676 | |||||
| 57677 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57678 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57679 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57680 | !InitIds(cx, atomsCache)) || | ||||
| 57681 | !GetCallableProperty(cx, atomsCache->passOptionalUnionByteString_id, &callable)) { | ||||
| 57682 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57683 | return; | ||||
| 57684 | } | ||||
| 57685 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57686 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57687 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57688 | aRv.NoteJSContextException(cx); | ||||
| 57689 | return; | ||||
| 57690 | } | ||||
| 57691 | } | ||||
| 57692 | |||||
| 57693 | void | ||||
| 57694 | TestJSImplInterfaceJSImpl::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57695 | { | ||||
| 57696 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57697 | if (aRv.Failed()) { | ||||
| 57698 | return; | ||||
| 57699 | } | ||||
| 57700 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57700); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57700; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57701 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57702 | |||||
| 57703 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57704 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57705 | if (!argv.resize(1)) { | ||||
| 57706 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57707 | // the right thing with that. | ||||
| 57708 | return; | ||||
| 57709 | } | ||||
| 57710 | unsigned argc = 1; | ||||
| 57711 | |||||
| 57712 | do { | ||||
| 57713 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 57714 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 57715 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57716 | return; | ||||
| 57717 | } | ||||
| 57718 | break; | ||||
| 57719 | } while (false); | ||||
| 57720 | |||||
| 57721 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57722 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57723 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57724 | !InitIds(cx, atomsCache)) || | ||||
| 57725 | !GetCallableProperty(cx, atomsCache->passOptionalUnionByteStringWithDefaultValue_id, &callable)) { | ||||
| 57726 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57727 | return; | ||||
| 57728 | } | ||||
| 57729 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57730 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57731 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57732 | aRv.NoteJSContextException(cx); | ||||
| 57733 | return; | ||||
| 57734 | } | ||||
| 57735 | } | ||||
| 57736 | |||||
| 57737 | void | ||||
| 57738 | TestJSImplInterfaceJSImpl::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57739 | { | ||||
| 57740 | CallSetup s(this, aRv, "TestJSImplInterface.passUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57741 | if (aRv.Failed()) { | ||||
| 57742 | return; | ||||
| 57743 | } | ||||
| 57744 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57744); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57744; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57745 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57746 | |||||
| 57747 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57748 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57749 | if (!argv.resize(1)) { | ||||
| 57750 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57751 | // the right thing with that. | ||||
| 57752 | return; | ||||
| 57753 | } | ||||
| 57754 | unsigned argc = 1; | ||||
| 57755 | |||||
| 57756 | do { | ||||
| 57757 | if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) { | ||||
| 57758 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57759 | return; | ||||
| 57760 | } | ||||
| 57761 | break; | ||||
| 57762 | } while (false); | ||||
| 57763 | |||||
| 57764 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57765 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57766 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57767 | !InitIds(cx, atomsCache)) || | ||||
| 57768 | !GetCallableProperty(cx, atomsCache->passUTF8String_id, &callable)) { | ||||
| 57769 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57770 | return; | ||||
| 57771 | } | ||||
| 57772 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57773 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57774 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57775 | aRv.NoteJSContextException(cx); | ||||
| 57776 | return; | ||||
| 57777 | } | ||||
| 57778 | } | ||||
| 57779 | |||||
| 57780 | void | ||||
| 57781 | TestJSImplInterfaceJSImpl::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57782 | { | ||||
| 57783 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57784 | if (aRv.Failed()) { | ||||
| 57785 | return; | ||||
| 57786 | } | ||||
| 57787 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57787); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57787; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57788 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57789 | |||||
| 57790 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57791 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57792 | if (!argv.resize(1)) { | ||||
| 57793 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57794 | // the right thing with that. | ||||
| 57795 | return; | ||||
| 57796 | } | ||||
| 57797 | unsigned argc = 1; | ||||
| 57798 | |||||
| 57799 | do { | ||||
| 57800 | if (!UTF8StringToJsval(cx, arg, argv[0])) { | ||||
| 57801 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57802 | return; | ||||
| 57803 | } | ||||
| 57804 | break; | ||||
| 57805 | } while (false); | ||||
| 57806 | |||||
| 57807 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57808 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57809 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57810 | !InitIds(cx, atomsCache)) || | ||||
| 57811 | !GetCallableProperty(cx, atomsCache->passNullableUTF8String_id, &callable)) { | ||||
| 57812 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57813 | return; | ||||
| 57814 | } | ||||
| 57815 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57816 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57817 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57818 | aRv.NoteJSContextException(cx); | ||||
| 57819 | return; | ||||
| 57820 | } | ||||
| 57821 | } | ||||
| 57822 | |||||
| 57823 | void | ||||
| 57824 | TestJSImplInterfaceJSImpl::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57825 | { | ||||
| 57826 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57827 | if (aRv.Failed()) { | ||||
| 57828 | return; | ||||
| 57829 | } | ||||
| 57830 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57830); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57830; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57831 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57832 | |||||
| 57833 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57834 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57835 | if (!argv.resize(1)) { | ||||
| 57836 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57837 | // the right thing with that. | ||||
| 57838 | return; | ||||
| 57839 | } | ||||
| 57840 | unsigned argc = 1; | ||||
| 57841 | |||||
| 57842 | do { | ||||
| 57843 | if (arg.WasPassed()) { | ||||
| 57844 | if (!NonVoidUTF8StringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57845 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57846 | return; | ||||
| 57847 | } | ||||
| 57848 | break; | ||||
| 57849 | } else if (argc == 1) { | ||||
| 57850 | // This is our current trailing argument; reduce argc | ||||
| 57851 | --argc; | ||||
| 57852 | } else { | ||||
| 57853 | argv[0].setUndefined(); | ||||
| 57854 | } | ||||
| 57855 | } while (false); | ||||
| 57856 | |||||
| 57857 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57858 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57859 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57860 | !InitIds(cx, atomsCache)) || | ||||
| 57861 | !GetCallableProperty(cx, atomsCache->passOptionalUTF8String_id, &callable)) { | ||||
| 57862 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57863 | return; | ||||
| 57864 | } | ||||
| 57865 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57866 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57867 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57868 | aRv.NoteJSContextException(cx); | ||||
| 57869 | return; | ||||
| 57870 | } | ||||
| 57871 | } | ||||
| 57872 | |||||
| 57873 | void | ||||
| 57874 | TestJSImplInterfaceJSImpl::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57875 | { | ||||
| 57876 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57877 | if (aRv.Failed()) { | ||||
| 57878 | return; | ||||
| 57879 | } | ||||
| 57880 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57880); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57880; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57881 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57882 | |||||
| 57883 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57884 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57885 | if (!argv.resize(1)) { | ||||
| 57886 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57887 | // the right thing with that. | ||||
| 57888 | return; | ||||
| 57889 | } | ||||
| 57890 | unsigned argc = 1; | ||||
| 57891 | |||||
| 57892 | do { | ||||
| 57893 | if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) { | ||||
| 57894 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57895 | return; | ||||
| 57896 | } | ||||
| 57897 | break; | ||||
| 57898 | } while (false); | ||||
| 57899 | |||||
| 57900 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57901 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57902 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57903 | !InitIds(cx, atomsCache)) || | ||||
| 57904 | !GetCallableProperty(cx, atomsCache->passOptionalUTF8StringWithDefaultValue_id, &callable)) { | ||||
| 57905 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57906 | return; | ||||
| 57907 | } | ||||
| 57908 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57909 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57910 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57911 | aRv.NoteJSContextException(cx); | ||||
| 57912 | return; | ||||
| 57913 | } | ||||
| 57914 | } | ||||
| 57915 | |||||
| 57916 | void | ||||
| 57917 | TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57918 | { | ||||
| 57919 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57920 | if (aRv.Failed()) { | ||||
| 57921 | return; | ||||
| 57922 | } | ||||
| 57923 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57923); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57923; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57924 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57925 | |||||
| 57926 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57927 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57928 | if (!argv.resize(1)) { | ||||
| 57929 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57930 | // the right thing with that. | ||||
| 57931 | return; | ||||
| 57932 | } | ||||
| 57933 | unsigned argc = 1; | ||||
| 57934 | |||||
| 57935 | do { | ||||
| 57936 | if (arg.WasPassed()) { | ||||
| 57937 | if (!UTF8StringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 57938 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57939 | return; | ||||
| 57940 | } | ||||
| 57941 | break; | ||||
| 57942 | } else if (argc == 1) { | ||||
| 57943 | // This is our current trailing argument; reduce argc | ||||
| 57944 | --argc; | ||||
| 57945 | } else { | ||||
| 57946 | argv[0].setUndefined(); | ||||
| 57947 | } | ||||
| 57948 | } while (false); | ||||
| 57949 | |||||
| 57950 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57951 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57952 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57953 | !InitIds(cx, atomsCache)) || | ||||
| 57954 | !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8String_id, &callable)) { | ||||
| 57955 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57956 | return; | ||||
| 57957 | } | ||||
| 57958 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 57959 | if (!JS::Call(cx, thisValue, callable, | ||||
| 57960 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 57961 | aRv.NoteJSContextException(cx); | ||||
| 57962 | return; | ||||
| 57963 | } | ||||
| 57964 | } | ||||
| 57965 | |||||
| 57966 | void | ||||
| 57967 | TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 57968 | { | ||||
| 57969 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 57970 | if (aRv.Failed()) { | ||||
| 57971 | return; | ||||
| 57972 | } | ||||
| 57973 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 57973); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 57973; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 57974 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 57975 | |||||
| 57976 | JS::Rooted<JS::Value> rval(cx); | ||||
| 57977 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 57978 | if (!argv.resize(1)) { | ||||
| 57979 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 57980 | // the right thing with that. | ||||
| 57981 | return; | ||||
| 57982 | } | ||||
| 57983 | unsigned argc = 1; | ||||
| 57984 | |||||
| 57985 | do { | ||||
| 57986 | if (!UTF8StringToJsval(cx, arg, argv[0])) { | ||||
| 57987 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57988 | return; | ||||
| 57989 | } | ||||
| 57990 | break; | ||||
| 57991 | } while (false); | ||||
| 57992 | |||||
| 57993 | JS::Rooted<JS::Value> callable(cx); | ||||
| 57994 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 57995 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 57996 | !InitIds(cx, atomsCache)) || | ||||
| 57997 | !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id, &callable)) { | ||||
| 57998 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 57999 | return; | ||||
| 58000 | } | ||||
| 58001 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58002 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58003 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58004 | aRv.NoteJSContextException(cx); | ||||
| 58005 | return; | ||||
| 58006 | } | ||||
| 58007 | } | ||||
| 58008 | |||||
| 58009 | void | ||||
| 58010 | TestJSImplInterfaceJSImpl::PassVariadicUTF8String(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58011 | { | ||||
| 58012 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58013 | if (aRv.Failed()) { | ||||
| 58014 | return; | ||||
| 58015 | } | ||||
| 58016 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58016); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58016; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58017 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58018 | |||||
| 58019 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58020 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58021 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 58022 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58023 | // the right thing with that. | ||||
| 58024 | return; | ||||
| 58025 | } | ||||
| 58026 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 58027 | |||||
| 58028 | do { | ||||
| 58029 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 58030 | if (!NonVoidUTF8StringToJsval(cx, arg[idx], argv[0 + idx])) { | ||||
| 58031 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58032 | return; | ||||
| 58033 | } | ||||
| 58034 | continue; | ||||
| 58035 | } | ||||
| 58036 | break; | ||||
| 58037 | } while (false); | ||||
| 58038 | |||||
| 58039 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58040 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58041 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58042 | !InitIds(cx, atomsCache)) || | ||||
| 58043 | !GetCallableProperty(cx, atomsCache->passVariadicUTF8String_id, &callable)) { | ||||
| 58044 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58045 | return; | ||||
| 58046 | } | ||||
| 58047 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58048 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58049 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58050 | aRv.NoteJSContextException(cx); | ||||
| 58051 | return; | ||||
| 58052 | } | ||||
| 58053 | } | ||||
| 58054 | |||||
| 58055 | void | ||||
| 58056 | TestJSImplInterfaceJSImpl::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58057 | { | ||||
| 58058 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58059 | if (aRv.Failed()) { | ||||
| 58060 | return; | ||||
| 58061 | } | ||||
| 58062 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58062); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58062; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58063 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58064 | |||||
| 58065 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58066 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58067 | if (!argv.resize(1)) { | ||||
| 58068 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58069 | // the right thing with that. | ||||
| 58070 | return; | ||||
| 58071 | } | ||||
| 58072 | unsigned argc = 1; | ||||
| 58073 | |||||
| 58074 | do { | ||||
| 58075 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 58076 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 58077 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58078 | return; | ||||
| 58079 | } | ||||
| 58080 | break; | ||||
| 58081 | } while (false); | ||||
| 58082 | |||||
| 58083 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58084 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58085 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58086 | !InitIds(cx, atomsCache)) || | ||||
| 58087 | !GetCallableProperty(cx, atomsCache->passUnionUTF8String_id, &callable)) { | ||||
| 58088 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58089 | return; | ||||
| 58090 | } | ||||
| 58091 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58092 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58093 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58094 | aRv.NoteJSContextException(cx); | ||||
| 58095 | return; | ||||
| 58096 | } | ||||
| 58097 | } | ||||
| 58098 | |||||
| 58099 | void | ||||
| 58100 | TestJSImplInterfaceJSImpl::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58101 | { | ||||
| 58102 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58103 | if (aRv.Failed()) { | ||||
| 58104 | return; | ||||
| 58105 | } | ||||
| 58106 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58106); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58106; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58107 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58108 | |||||
| 58109 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58110 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58111 | if (!argv.resize(1)) { | ||||
| 58112 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58113 | // the right thing with that. | ||||
| 58114 | return; | ||||
| 58115 | } | ||||
| 58116 | unsigned argc = 1; | ||||
| 58117 | |||||
| 58118 | do { | ||||
| 58119 | if (arg.WasPassed()) { | ||||
| 58120 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 58121 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 58122 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58123 | return; | ||||
| 58124 | } | ||||
| 58125 | break; | ||||
| 58126 | } else if (argc == 1) { | ||||
| 58127 | // This is our current trailing argument; reduce argc | ||||
| 58128 | --argc; | ||||
| 58129 | } else { | ||||
| 58130 | argv[0].setUndefined(); | ||||
| 58131 | } | ||||
| 58132 | } while (false); | ||||
| 58133 | |||||
| 58134 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58135 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58136 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58137 | !InitIds(cx, atomsCache)) || | ||||
| 58138 | !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8String_id, &callable)) { | ||||
| 58139 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58140 | return; | ||||
| 58141 | } | ||||
| 58142 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58143 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58144 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58145 | aRv.NoteJSContextException(cx); | ||||
| 58146 | return; | ||||
| 58147 | } | ||||
| 58148 | } | ||||
| 58149 | |||||
| 58150 | void | ||||
| 58151 | TestJSImplInterfaceJSImpl::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58152 | { | ||||
| 58153 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58154 | if (aRv.Failed()) { | ||||
| 58155 | return; | ||||
| 58156 | } | ||||
| 58157 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58157); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58157; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58158 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58159 | |||||
| 58160 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58161 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58162 | if (!argv.resize(1)) { | ||||
| 58163 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58164 | // the right thing with that. | ||||
| 58165 | return; | ||||
| 58166 | } | ||||
| 58167 | unsigned argc = 1; | ||||
| 58168 | |||||
| 58169 | do { | ||||
| 58170 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 58171 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 58172 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58173 | return; | ||||
| 58174 | } | ||||
| 58175 | break; | ||||
| 58176 | } while (false); | ||||
| 58177 | |||||
| 58178 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58179 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58180 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58181 | !InitIds(cx, atomsCache)) || | ||||
| 58182 | !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id, &callable)) { | ||||
| 58183 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58184 | return; | ||||
| 58185 | } | ||||
| 58186 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58187 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58188 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58189 | aRv.NoteJSContextException(cx); | ||||
| 58190 | return; | ||||
| 58191 | } | ||||
| 58192 | } | ||||
| 58193 | |||||
| 58194 | void | ||||
| 58195 | TestJSImplInterfaceJSImpl::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58196 | { | ||||
| 58197 | CallSetup s(this, aRv, "TestJSImplInterface.passSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58198 | if (aRv.Failed()) { | ||||
| 58199 | return; | ||||
| 58200 | } | ||||
| 58201 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58201; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58202 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58203 | |||||
| 58204 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58205 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58206 | if (!argv.resize(1)) { | ||||
| 58207 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58208 | // the right thing with that. | ||||
| 58209 | return; | ||||
| 58210 | } | ||||
| 58211 | unsigned argc = 1; | ||||
| 58212 | |||||
| 58213 | do { | ||||
| 58214 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 58215 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58216 | return; | ||||
| 58217 | } | ||||
| 58218 | break; | ||||
| 58219 | } while (false); | ||||
| 58220 | |||||
| 58221 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58222 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58223 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58224 | !InitIds(cx, atomsCache)) || | ||||
| 58225 | !GetCallableProperty(cx, atomsCache->passSVS_id, &callable)) { | ||||
| 58226 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58227 | return; | ||||
| 58228 | } | ||||
| 58229 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58230 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58231 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58232 | aRv.NoteJSContextException(cx); | ||||
| 58233 | return; | ||||
| 58234 | } | ||||
| 58235 | } | ||||
| 58236 | |||||
| 58237 | void | ||||
| 58238 | TestJSImplInterfaceJSImpl::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58239 | { | ||||
| 58240 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58241 | if (aRv.Failed()) { | ||||
| 58242 | return; | ||||
| 58243 | } | ||||
| 58244 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58244); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58244; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58245 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58246 | |||||
| 58247 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58248 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58249 | if (!argv.resize(1)) { | ||||
| 58250 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58251 | // the right thing with that. | ||||
| 58252 | return; | ||||
| 58253 | } | ||||
| 58254 | unsigned argc = 1; | ||||
| 58255 | |||||
| 58256 | do { | ||||
| 58257 | if (!xpc::StringToJsval(cx, arg, argv[0])) { | ||||
| 58258 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58259 | return; | ||||
| 58260 | } | ||||
| 58261 | break; | ||||
| 58262 | } while (false); | ||||
| 58263 | |||||
| 58264 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58265 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58266 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58267 | !InitIds(cx, atomsCache)) || | ||||
| 58268 | !GetCallableProperty(cx, atomsCache->passNullableSVS_id, &callable)) { | ||||
| 58269 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58270 | return; | ||||
| 58271 | } | ||||
| 58272 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58273 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58274 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58275 | aRv.NoteJSContextException(cx); | ||||
| 58276 | return; | ||||
| 58277 | } | ||||
| 58278 | } | ||||
| 58279 | |||||
| 58280 | void | ||||
| 58281 | TestJSImplInterfaceJSImpl::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58282 | { | ||||
| 58283 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58284 | if (aRv.Failed()) { | ||||
| 58285 | return; | ||||
| 58286 | } | ||||
| 58287 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58287); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58287; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58288 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58289 | |||||
| 58290 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58291 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58292 | if (!argv.resize(1)) { | ||||
| 58293 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58294 | // the right thing with that. | ||||
| 58295 | return; | ||||
| 58296 | } | ||||
| 58297 | unsigned argc = 1; | ||||
| 58298 | |||||
| 58299 | do { | ||||
| 58300 | if (arg.WasPassed()) { | ||||
| 58301 | if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 58302 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58303 | return; | ||||
| 58304 | } | ||||
| 58305 | break; | ||||
| 58306 | } else if (argc == 1) { | ||||
| 58307 | // This is our current trailing argument; reduce argc | ||||
| 58308 | --argc; | ||||
| 58309 | } else { | ||||
| 58310 | argv[0].setUndefined(); | ||||
| 58311 | } | ||||
| 58312 | } while (false); | ||||
| 58313 | |||||
| 58314 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58315 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58316 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58317 | !InitIds(cx, atomsCache)) || | ||||
| 58318 | !GetCallableProperty(cx, atomsCache->passOptionalSVS_id, &callable)) { | ||||
| 58319 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58320 | return; | ||||
| 58321 | } | ||||
| 58322 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58323 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58324 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58325 | aRv.NoteJSContextException(cx); | ||||
| 58326 | return; | ||||
| 58327 | } | ||||
| 58328 | } | ||||
| 58329 | |||||
| 58330 | void | ||||
| 58331 | TestJSImplInterfaceJSImpl::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58332 | { | ||||
| 58333 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58334 | if (aRv.Failed()) { | ||||
| 58335 | return; | ||||
| 58336 | } | ||||
| 58337 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58337); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58337; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58338 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58339 | |||||
| 58340 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58341 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58342 | if (!argv.resize(1)) { | ||||
| 58343 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58344 | // the right thing with that. | ||||
| 58345 | return; | ||||
| 58346 | } | ||||
| 58347 | unsigned argc = 1; | ||||
| 58348 | |||||
| 58349 | do { | ||||
| 58350 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 58351 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58352 | return; | ||||
| 58353 | } | ||||
| 58354 | break; | ||||
| 58355 | } while (false); | ||||
| 58356 | |||||
| 58357 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58358 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58359 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58360 | !InitIds(cx, atomsCache)) || | ||||
| 58361 | !GetCallableProperty(cx, atomsCache->passOptionalSVSWithDefaultValue_id, &callable)) { | ||||
| 58362 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58363 | return; | ||||
| 58364 | } | ||||
| 58365 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58366 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58367 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58368 | aRv.NoteJSContextException(cx); | ||||
| 58369 | return; | ||||
| 58370 | } | ||||
| 58371 | } | ||||
| 58372 | |||||
| 58373 | void | ||||
| 58374 | TestJSImplInterfaceJSImpl::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58375 | { | ||||
| 58376 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58377 | if (aRv.Failed()) { | ||||
| 58378 | return; | ||||
| 58379 | } | ||||
| 58380 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58380); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58380; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58381 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58382 | |||||
| 58383 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58384 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58385 | if (!argv.resize(1)) { | ||||
| 58386 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58387 | // the right thing with that. | ||||
| 58388 | return; | ||||
| 58389 | } | ||||
| 58390 | unsigned argc = 1; | ||||
| 58391 | |||||
| 58392 | do { | ||||
| 58393 | if (arg.WasPassed()) { | ||||
| 58394 | if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) { | ||||
| 58395 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58396 | return; | ||||
| 58397 | } | ||||
| 58398 | break; | ||||
| 58399 | } else if (argc == 1) { | ||||
| 58400 | // This is our current trailing argument; reduce argc | ||||
| 58401 | --argc; | ||||
| 58402 | } else { | ||||
| 58403 | argv[0].setUndefined(); | ||||
| 58404 | } | ||||
| 58405 | } while (false); | ||||
| 58406 | |||||
| 58407 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58408 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58409 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58410 | !InitIds(cx, atomsCache)) || | ||||
| 58411 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSVS_id, &callable)) { | ||||
| 58412 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58413 | return; | ||||
| 58414 | } | ||||
| 58415 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58416 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58417 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58418 | aRv.NoteJSContextException(cx); | ||||
| 58419 | return; | ||||
| 58420 | } | ||||
| 58421 | } | ||||
| 58422 | |||||
| 58423 | void | ||||
| 58424 | TestJSImplInterfaceJSImpl::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58425 | { | ||||
| 58426 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58427 | if (aRv.Failed()) { | ||||
| 58428 | return; | ||||
| 58429 | } | ||||
| 58430 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58430); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58430; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58431 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58432 | |||||
| 58433 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58434 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58435 | if (!argv.resize(1)) { | ||||
| 58436 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58437 | // the right thing with that. | ||||
| 58438 | return; | ||||
| 58439 | } | ||||
| 58440 | unsigned argc = 1; | ||||
| 58441 | |||||
| 58442 | do { | ||||
| 58443 | if (!xpc::StringToJsval(cx, arg, argv[0])) { | ||||
| 58444 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58445 | return; | ||||
| 58446 | } | ||||
| 58447 | break; | ||||
| 58448 | } while (false); | ||||
| 58449 | |||||
| 58450 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58451 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58452 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58453 | !InitIds(cx, atomsCache)) || | ||||
| 58454 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSVSWithDefaultValue_id, &callable)) { | ||||
| 58455 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58456 | return; | ||||
| 58457 | } | ||||
| 58458 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58459 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58460 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58461 | aRv.NoteJSContextException(cx); | ||||
| 58462 | return; | ||||
| 58463 | } | ||||
| 58464 | } | ||||
| 58465 | |||||
| 58466 | void | ||||
| 58467 | TestJSImplInterfaceJSImpl::PassVariadicSVS(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58468 | { | ||||
| 58469 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58470 | if (aRv.Failed()) { | ||||
| 58471 | return; | ||||
| 58472 | } | ||||
| 58473 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58473); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58473; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58474 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58475 | |||||
| 58476 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58477 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58478 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 58479 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58480 | // the right thing with that. | ||||
| 58481 | return; | ||||
| 58482 | } | ||||
| 58483 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 58484 | |||||
| 58485 | do { | ||||
| 58486 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 58487 | if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) { | ||||
| 58488 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58489 | return; | ||||
| 58490 | } | ||||
| 58491 | continue; | ||||
| 58492 | } | ||||
| 58493 | break; | ||||
| 58494 | } while (false); | ||||
| 58495 | |||||
| 58496 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58497 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58498 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58499 | !InitIds(cx, atomsCache)) || | ||||
| 58500 | !GetCallableProperty(cx, atomsCache->passVariadicSVS_id, &callable)) { | ||||
| 58501 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58502 | return; | ||||
| 58503 | } | ||||
| 58504 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58505 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58506 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58507 | aRv.NoteJSContextException(cx); | ||||
| 58508 | return; | ||||
| 58509 | } | ||||
| 58510 | } | ||||
| 58511 | |||||
| 58512 | void | ||||
| 58513 | TestJSImplInterfaceJSImpl::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58514 | { | ||||
| 58515 | CallSetup s(this, aRv, "TestJSImplInterface.receiveSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58516 | if (aRv.Failed()) { | ||||
| 58517 | return; | ||||
| 58518 | } | ||||
| 58519 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58519); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58519; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58520 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58521 | |||||
| 58522 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58523 | |||||
| 58524 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58525 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58526 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58527 | !InitIds(cx, atomsCache)) || | ||||
| 58528 | !GetCallableProperty(cx, atomsCache->receiveSVS_id, &callable)) { | ||||
| 58529 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58530 | return; | ||||
| 58531 | } | ||||
| 58532 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58533 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58534 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 58535 | aRv.NoteJSContextException(cx); | ||||
| 58536 | return; | ||||
| 58537 | } | ||||
| 58538 | binding_detail::FakeString<char16_t> rvalDecl; | ||||
| 58539 | if (!ConvertJSValueToString(cx, rval, eStringify, eStringify, rvalDecl)) { | ||||
| 58540 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58541 | return; | ||||
| 58542 | } | ||||
| 58543 | if (!NormalizeUSVString(rvalDecl)) { | ||||
| 58544 | JS_ReportOutOfMemory(cx); | ||||
| 58545 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58546 | return; | ||||
| 58547 | } | ||||
| 58548 | aRetVal = rvalDecl; | ||||
| 58549 | } | ||||
| 58550 | |||||
| 58551 | void | ||||
| 58552 | TestJSImplInterfaceJSImpl::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58553 | { | ||||
| 58554 | CallSetup s(this, aRv, "TestJSImplInterface.passJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58555 | if (aRv.Failed()) { | ||||
| 58556 | return; | ||||
| 58557 | } | ||||
| 58558 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58558); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58558; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58559 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58560 | |||||
| 58561 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58562 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58563 | if (!argv.resize(1)) { | ||||
| 58564 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58565 | // the right thing with that. | ||||
| 58566 | return; | ||||
| 58567 | } | ||||
| 58568 | unsigned argc = 1; | ||||
| 58569 | |||||
| 58570 | do { | ||||
| 58571 | argv[0].setString(arg); | ||||
| 58572 | if (!MaybeWrapStringValue(cx, argv[0])) { | ||||
| 58573 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58574 | return; | ||||
| 58575 | } | ||||
| 58576 | break; | ||||
| 58577 | } while (false); | ||||
| 58578 | |||||
| 58579 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58580 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58581 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58582 | !InitIds(cx, atomsCache)) || | ||||
| 58583 | !GetCallableProperty(cx, atomsCache->passJSString_id, &callable)) { | ||||
| 58584 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58585 | return; | ||||
| 58586 | } | ||||
| 58587 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58588 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58589 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58590 | aRv.NoteJSContextException(cx); | ||||
| 58591 | return; | ||||
| 58592 | } | ||||
| 58593 | } | ||||
| 58594 | |||||
| 58595 | void | ||||
| 58596 | TestJSImplInterfaceJSImpl::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58597 | { | ||||
| 58598 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalJSStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58599 | if (aRv.Failed()) { | ||||
| 58600 | return; | ||||
| 58601 | } | ||||
| 58602 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58602; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58603 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58604 | |||||
| 58605 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58606 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58607 | if (!argv.resize(1)) { | ||||
| 58608 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58609 | // the right thing with that. | ||||
| 58610 | return; | ||||
| 58611 | } | ||||
| 58612 | unsigned argc = 1; | ||||
| 58613 | |||||
| 58614 | do { | ||||
| 58615 | argv[0].setString(arg); | ||||
| 58616 | if (!MaybeWrapStringValue(cx, argv[0])) { | ||||
| 58617 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58618 | return; | ||||
| 58619 | } | ||||
| 58620 | break; | ||||
| 58621 | } while (false); | ||||
| 58622 | |||||
| 58623 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58624 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58625 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58626 | !InitIds(cx, atomsCache)) || | ||||
| 58627 | !GetCallableProperty(cx, atomsCache->passOptionalJSStringWithDefaultValue_id, &callable)) { | ||||
| 58628 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58629 | return; | ||||
| 58630 | } | ||||
| 58631 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58632 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58633 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58634 | aRv.NoteJSContextException(cx); | ||||
| 58635 | return; | ||||
| 58636 | } | ||||
| 58637 | } | ||||
| 58638 | |||||
| 58639 | void | ||||
| 58640 | TestJSImplInterfaceJSImpl::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58641 | { | ||||
| 58642 | CallSetup s(this, aRv, "TestJSImplInterface.receiveJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58643 | if (aRv.Failed()) { | ||||
| 58644 | return; | ||||
| 58645 | } | ||||
| 58646 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58646); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58646; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58647 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58648 | |||||
| 58649 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58650 | |||||
| 58651 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58652 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58653 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58654 | !InitIds(cx, atomsCache)) || | ||||
| 58655 | !GetCallableProperty(cx, atomsCache->receiveJSString_id, &callable)) { | ||||
| 58656 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58657 | return; | ||||
| 58658 | } | ||||
| 58659 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58660 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58661 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 58662 | aRv.NoteJSContextException(cx); | ||||
| 58663 | return; | ||||
| 58664 | } | ||||
| 58665 | JS::Rooted<JSString*> rvalDecl(cx); | ||||
| 58666 | if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) { | ||||
| 58667 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58668 | return; | ||||
| 58669 | } | ||||
| 58670 | aRetVal.set(rvalDecl); | ||||
| 58671 | } | ||||
| 58672 | |||||
| 58673 | void | ||||
| 58674 | TestJSImplInterfaceJSImpl::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58675 | { | ||||
| 58676 | CallSetup s(this, aRv, "TestJSImplInterface.passEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58677 | if (aRv.Failed()) { | ||||
| 58678 | return; | ||||
| 58679 | } | ||||
| 58680 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58680); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58680; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58681 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58682 | |||||
| 58683 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58684 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58685 | if (!argv.resize(1)) { | ||||
| 58686 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58687 | // the right thing with that. | ||||
| 58688 | return; | ||||
| 58689 | } | ||||
| 58690 | unsigned argc = 1; | ||||
| 58691 | |||||
| 58692 | do { | ||||
| 58693 | if (!ToJSValue(cx, arg, argv[0])) { | ||||
| 58694 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58695 | return; | ||||
| 58696 | } | ||||
| 58697 | break; | ||||
| 58698 | } while (false); | ||||
| 58699 | |||||
| 58700 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58701 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58702 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58703 | !InitIds(cx, atomsCache)) || | ||||
| 58704 | !GetCallableProperty(cx, atomsCache->passEnum_id, &callable)) { | ||||
| 58705 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58706 | return; | ||||
| 58707 | } | ||||
| 58708 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58709 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58710 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58711 | aRv.NoteJSContextException(cx); | ||||
| 58712 | return; | ||||
| 58713 | } | ||||
| 58714 | } | ||||
| 58715 | |||||
| 58716 | void | ||||
| 58717 | TestJSImplInterfaceJSImpl::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58718 | { | ||||
| 58719 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58720 | if (aRv.Failed()) { | ||||
| 58721 | return; | ||||
| 58722 | } | ||||
| 58723 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58723); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58723; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58724 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58725 | |||||
| 58726 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58727 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58728 | if (!argv.resize(1)) { | ||||
| 58729 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58730 | // the right thing with that. | ||||
| 58731 | return; | ||||
| 58732 | } | ||||
| 58733 | unsigned argc = 1; | ||||
| 58734 | |||||
| 58735 | do { | ||||
| 58736 | if (arg.IsNull()) { | ||||
| 58737 | argv[0].setNull(); | ||||
| 58738 | break; | ||||
| 58739 | } else { | ||||
| 58740 | if (!ToJSValue(cx, arg.Value(), argv[0])) { | ||||
| 58741 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58742 | return; | ||||
| 58743 | } | ||||
| 58744 | break; | ||||
| 58745 | } | ||||
| 58746 | } while (false); | ||||
| 58747 | |||||
| 58748 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58749 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58750 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58751 | !InitIds(cx, atomsCache)) || | ||||
| 58752 | !GetCallableProperty(cx, atomsCache->passNullableEnum_id, &callable)) { | ||||
| 58753 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58754 | return; | ||||
| 58755 | } | ||||
| 58756 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58757 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58758 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58759 | aRv.NoteJSContextException(cx); | ||||
| 58760 | return; | ||||
| 58761 | } | ||||
| 58762 | } | ||||
| 58763 | |||||
| 58764 | void | ||||
| 58765 | TestJSImplInterfaceJSImpl::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58766 | { | ||||
| 58767 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58768 | if (aRv.Failed()) { | ||||
| 58769 | return; | ||||
| 58770 | } | ||||
| 58771 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58771); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58771; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58772 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58773 | |||||
| 58774 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58775 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58776 | if (!argv.resize(1)) { | ||||
| 58777 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58778 | // the right thing with that. | ||||
| 58779 | return; | ||||
| 58780 | } | ||||
| 58781 | unsigned argc = 1; | ||||
| 58782 | |||||
| 58783 | do { | ||||
| 58784 | if (arg.WasPassed()) { | ||||
| 58785 | if (!ToJSValue(cx, arg.Value(), argv[0])) { | ||||
| 58786 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58787 | return; | ||||
| 58788 | } | ||||
| 58789 | break; | ||||
| 58790 | } else if (argc == 1) { | ||||
| 58791 | // This is our current trailing argument; reduce argc | ||||
| 58792 | --argc; | ||||
| 58793 | } else { | ||||
| 58794 | argv[0].setUndefined(); | ||||
| 58795 | } | ||||
| 58796 | } while (false); | ||||
| 58797 | |||||
| 58798 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58799 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58800 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58801 | !InitIds(cx, atomsCache)) || | ||||
| 58802 | !GetCallableProperty(cx, atomsCache->passOptionalEnum_id, &callable)) { | ||||
| 58803 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58804 | return; | ||||
| 58805 | } | ||||
| 58806 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58807 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58808 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58809 | aRv.NoteJSContextException(cx); | ||||
| 58810 | return; | ||||
| 58811 | } | ||||
| 58812 | } | ||||
| 58813 | |||||
| 58814 | void | ||||
| 58815 | TestJSImplInterfaceJSImpl::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58816 | { | ||||
| 58817 | CallSetup s(this, aRv, "TestJSImplInterface.passEnumWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58818 | if (aRv.Failed()) { | ||||
| 58819 | return; | ||||
| 58820 | } | ||||
| 58821 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58821); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58821; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58822 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58823 | |||||
| 58824 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58825 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58826 | if (!argv.resize(1)) { | ||||
| 58827 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58828 | // the right thing with that. | ||||
| 58829 | return; | ||||
| 58830 | } | ||||
| 58831 | unsigned argc = 1; | ||||
| 58832 | |||||
| 58833 | do { | ||||
| 58834 | if (!ToJSValue(cx, arg, argv[0])) { | ||||
| 58835 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58836 | return; | ||||
| 58837 | } | ||||
| 58838 | break; | ||||
| 58839 | } while (false); | ||||
| 58840 | |||||
| 58841 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58842 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58843 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58844 | !InitIds(cx, atomsCache)) || | ||||
| 58845 | !GetCallableProperty(cx, atomsCache->passEnumWithDefault_id, &callable)) { | ||||
| 58846 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58847 | return; | ||||
| 58848 | } | ||||
| 58849 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58850 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58851 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58852 | aRv.NoteJSContextException(cx); | ||||
| 58853 | return; | ||||
| 58854 | } | ||||
| 58855 | } | ||||
| 58856 | |||||
| 58857 | void | ||||
| 58858 | TestJSImplInterfaceJSImpl::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58859 | { | ||||
| 58860 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58861 | if (aRv.Failed()) { | ||||
| 58862 | return; | ||||
| 58863 | } | ||||
| 58864 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58864); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58864; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58865 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58866 | |||||
| 58867 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58868 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58869 | if (!argv.resize(1)) { | ||||
| 58870 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58871 | // the right thing with that. | ||||
| 58872 | return; | ||||
| 58873 | } | ||||
| 58874 | unsigned argc = 1; | ||||
| 58875 | |||||
| 58876 | do { | ||||
| 58877 | if (arg.WasPassed()) { | ||||
| 58878 | if (arg.Value().IsNull()) { | ||||
| 58879 | argv[0].setNull(); | ||||
| 58880 | break; | ||||
| 58881 | } else { | ||||
| 58882 | if (!ToJSValue(cx, arg.Value().Value(), argv[0])) { | ||||
| 58883 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58884 | return; | ||||
| 58885 | } | ||||
| 58886 | break; | ||||
| 58887 | } | ||||
| 58888 | } else if (argc == 1) { | ||||
| 58889 | // This is our current trailing argument; reduce argc | ||||
| 58890 | --argc; | ||||
| 58891 | } else { | ||||
| 58892 | argv[0].setUndefined(); | ||||
| 58893 | } | ||||
| 58894 | } while (false); | ||||
| 58895 | |||||
| 58896 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58897 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58898 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58899 | !InitIds(cx, atomsCache)) || | ||||
| 58900 | !GetCallableProperty(cx, atomsCache->passOptionalNullableEnum_id, &callable)) { | ||||
| 58901 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58902 | return; | ||||
| 58903 | } | ||||
| 58904 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58905 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58906 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58907 | aRv.NoteJSContextException(cx); | ||||
| 58908 | return; | ||||
| 58909 | } | ||||
| 58910 | } | ||||
| 58911 | |||||
| 58912 | void | ||||
| 58913 | TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58914 | { | ||||
| 58915 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58916 | if (aRv.Failed()) { | ||||
| 58917 | return; | ||||
| 58918 | } | ||||
| 58919 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58919); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58919; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58920 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58921 | |||||
| 58922 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58923 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58924 | if (!argv.resize(1)) { | ||||
| 58925 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58926 | // the right thing with that. | ||||
| 58927 | return; | ||||
| 58928 | } | ||||
| 58929 | unsigned argc = 1; | ||||
| 58930 | |||||
| 58931 | do { | ||||
| 58932 | if (arg.IsNull()) { | ||||
| 58933 | argv[0].setNull(); | ||||
| 58934 | break; | ||||
| 58935 | } else { | ||||
| 58936 | if (!ToJSValue(cx, arg.Value(), argv[0])) { | ||||
| 58937 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58938 | return; | ||||
| 58939 | } | ||||
| 58940 | break; | ||||
| 58941 | } | ||||
| 58942 | } while (false); | ||||
| 58943 | |||||
| 58944 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58945 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58946 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58947 | !InitIds(cx, atomsCache)) || | ||||
| 58948 | !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue_id, &callable)) { | ||||
| 58949 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58950 | return; | ||||
| 58951 | } | ||||
| 58952 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 58953 | if (!JS::Call(cx, thisValue, callable, | ||||
| 58954 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 58955 | aRv.NoteJSContextException(cx); | ||||
| 58956 | return; | ||||
| 58957 | } | ||||
| 58958 | } | ||||
| 58959 | |||||
| 58960 | void | ||||
| 58961 | TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 58962 | { | ||||
| 58963 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 58964 | if (aRv.Failed()) { | ||||
| 58965 | return; | ||||
| 58966 | } | ||||
| 58967 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 58967); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 58967; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 58968 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 58969 | |||||
| 58970 | JS::Rooted<JS::Value> rval(cx); | ||||
| 58971 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 58972 | if (!argv.resize(1)) { | ||||
| 58973 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 58974 | // the right thing with that. | ||||
| 58975 | return; | ||||
| 58976 | } | ||||
| 58977 | unsigned argc = 1; | ||||
| 58978 | |||||
| 58979 | do { | ||||
| 58980 | if (arg.IsNull()) { | ||||
| 58981 | argv[0].setNull(); | ||||
| 58982 | break; | ||||
| 58983 | } else { | ||||
| 58984 | if (!ToJSValue(cx, arg.Value(), argv[0])) { | ||||
| 58985 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58986 | return; | ||||
| 58987 | } | ||||
| 58988 | break; | ||||
| 58989 | } | ||||
| 58990 | } while (false); | ||||
| 58991 | |||||
| 58992 | JS::Rooted<JS::Value> callable(cx); | ||||
| 58993 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 58994 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 58995 | !InitIds(cx, atomsCache)) || | ||||
| 58996 | !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue2_id, &callable)) { | ||||
| 58997 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 58998 | return; | ||||
| 58999 | } | ||||
| 59000 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59001 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59002 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59003 | aRv.NoteJSContextException(cx); | ||||
| 59004 | return; | ||||
| 59005 | } | ||||
| 59006 | } | ||||
| 59007 | |||||
| 59008 | MyTestEnum | ||||
| 59009 | TestJSImplInterfaceJSImpl::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59010 | { | ||||
| 59011 | CallSetup s(this, aRv, "TestJSImplInterface.receiveEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59012 | if (aRv.Failed()) { | ||||
| 59013 | return MyTestEnum(0); | ||||
| 59014 | } | ||||
| 59015 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59015); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59015; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59016 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59017 | |||||
| 59018 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59019 | |||||
| 59020 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59021 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59022 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59023 | !InitIds(cx, atomsCache)) || | ||||
| 59024 | !GetCallableProperty(cx, atomsCache->receiveEnum_id, &callable)) { | ||||
| 59025 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59026 | return MyTestEnum(0); | ||||
| 59027 | } | ||||
| 59028 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59029 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59030 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 59031 | aRv.NoteJSContextException(cx); | ||||
| 59032 | return MyTestEnum(0); | ||||
| 59033 | } | ||||
| 59034 | MyTestEnum rvalDecl; | ||||
| 59035 | { | ||||
| 59036 | int index; | ||||
| 59037 | if (!binding_detail::FindEnumStringIndex<true>(cx, rval, | ||||
| 59038 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 59039 | "MyTestEnum", "return value of TestJSImplInterface.receiveEnum", | ||||
| 59040 | &index)) { | ||||
| 59041 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59042 | return MyTestEnum(0); | ||||
| 59043 | } | ||||
| 59044 | 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", 59044); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 59044; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59045 | rvalDecl = static_cast<MyTestEnum>(index); | ||||
| 59046 | } | ||||
| 59047 | return rvalDecl; | ||||
| 59048 | } | ||||
| 59049 | |||||
| 59050 | Nullable<MyTestEnum> | ||||
| 59051 | TestJSImplInterfaceJSImpl::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59052 | { | ||||
| 59053 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59054 | if (aRv.Failed()) { | ||||
| 59055 | return Nullable<MyTestEnum>(); | ||||
| 59056 | } | ||||
| 59057 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59057); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59057; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59058 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59059 | |||||
| 59060 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59061 | |||||
| 59062 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59063 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59064 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59065 | !InitIds(cx, atomsCache)) || | ||||
| 59066 | !GetCallableProperty(cx, atomsCache->receiveNullableEnum_id, &callable)) { | ||||
| 59067 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59068 | return Nullable<MyTestEnum>(); | ||||
| 59069 | } | ||||
| 59070 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59071 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59072 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 59073 | aRv.NoteJSContextException(cx); | ||||
| 59074 | return Nullable<MyTestEnum>(); | ||||
| 59075 | } | ||||
| 59076 | Nullable<MyTestEnum> rvalDecl; | ||||
| 59077 | if (rval.isNullOrUndefined()) { | ||||
| 59078 | rvalDecl.SetNull(); | ||||
| 59079 | } else { | ||||
| 59080 | { | ||||
| 59081 | int index; | ||||
| 59082 | if (!binding_detail::FindEnumStringIndex<true>(cx, rval, | ||||
| 59083 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 59084 | "MyTestEnum", "return value of TestJSImplInterface.receiveNullableEnum", | ||||
| 59085 | &index)) { | ||||
| 59086 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59087 | return Nullable<MyTestEnum>(); | ||||
| 59088 | } | ||||
| 59089 | 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", 59089); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 59089; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59090 | rvalDecl.SetValue() = static_cast<MyTestEnum>(index); | ||||
| 59091 | } | ||||
| 59092 | } | ||||
| 59093 | return rvalDecl; | ||||
| 59094 | } | ||||
| 59095 | |||||
| 59096 | void | ||||
| 59097 | TestJSImplInterfaceJSImpl::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59098 | { | ||||
| 59099 | CallSetup s(this, aRv, "TestJSImplInterface.passCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59100 | if (aRv.Failed()) { | ||||
| 59101 | return; | ||||
| 59102 | } | ||||
| 59103 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59103); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59103; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59104 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59105 | |||||
| 59106 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59107 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59108 | if (!argv.resize(1)) { | ||||
| 59109 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59110 | // the right thing with that. | ||||
| 59111 | return; | ||||
| 59112 | } | ||||
| 59113 | unsigned argc = 1; | ||||
| 59114 | |||||
| 59115 | do { | ||||
| 59116 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 59117 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 59118 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59119 | return; | ||||
| 59120 | } | ||||
| 59121 | break; | ||||
| 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->passCallback_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 | |||||
| 59140 | void | ||||
| 59141 | TestJSImplInterfaceJSImpl::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59142 | { | ||||
| 59143 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59144 | if (aRv.Failed()) { | ||||
| 59145 | return; | ||||
| 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 { *((volatile int *)__null) = 59147; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59148 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59149 | |||||
| 59150 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59151 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59152 | if (!argv.resize(1)) { | ||||
| 59153 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59154 | // the right thing with that. | ||||
| 59155 | return; | ||||
| 59156 | } | ||||
| 59157 | unsigned argc = 1; | ||||
| 59158 | |||||
| 59159 | do { | ||||
| 59160 | if (arg) { | ||||
| 59161 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 59162 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 59163 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59164 | return; | ||||
| 59165 | } | ||||
| 59166 | break; | ||||
| 59167 | } else { | ||||
| 59168 | argv[0].setNull(); | ||||
| 59169 | break; | ||||
| 59170 | } | ||||
| 59171 | } while (false); | ||||
| 59172 | |||||
| 59173 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59174 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59175 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59176 | !InitIds(cx, atomsCache)) || | ||||
| 59177 | !GetCallableProperty(cx, atomsCache->passNullableCallback_id, &callable)) { | ||||
| 59178 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59179 | return; | ||||
| 59180 | } | ||||
| 59181 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59182 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59183 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59184 | aRv.NoteJSContextException(cx); | ||||
| 59185 | return; | ||||
| 59186 | } | ||||
| 59187 | } | ||||
| 59188 | |||||
| 59189 | void | ||||
| 59190 | TestJSImplInterfaceJSImpl::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59191 | { | ||||
| 59192 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59193 | if (aRv.Failed()) { | ||||
| 59194 | return; | ||||
| 59195 | } | ||||
| 59196 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59196); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59196; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59197 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59198 | |||||
| 59199 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59200 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59201 | if (!argv.resize(1)) { | ||||
| 59202 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59203 | // the right thing with that. | ||||
| 59204 | return; | ||||
| 59205 | } | ||||
| 59206 | unsigned argc = 1; | ||||
| 59207 | |||||
| 59208 | do { | ||||
| 59209 | if (arg.WasPassed()) { | ||||
| 59210 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value())); | ||||
| 59211 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 59212 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59213 | return; | ||||
| 59214 | } | ||||
| 59215 | break; | ||||
| 59216 | } else if (argc == 1) { | ||||
| 59217 | // This is our current trailing argument; reduce argc | ||||
| 59218 | --argc; | ||||
| 59219 | } else { | ||||
| 59220 | argv[0].setUndefined(); | ||||
| 59221 | } | ||||
| 59222 | } while (false); | ||||
| 59223 | |||||
| 59224 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59225 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59226 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59227 | !InitIds(cx, atomsCache)) || | ||||
| 59228 | !GetCallableProperty(cx, atomsCache->passOptionalCallback_id, &callable)) { | ||||
| 59229 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59230 | return; | ||||
| 59231 | } | ||||
| 59232 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59233 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59234 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59235 | aRv.NoteJSContextException(cx); | ||||
| 59236 | return; | ||||
| 59237 | } | ||||
| 59238 | } | ||||
| 59239 | |||||
| 59240 | void | ||||
| 59241 | TestJSImplInterfaceJSImpl::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59242 | { | ||||
| 59243 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59244 | if (aRv.Failed()) { | ||||
| 59245 | return; | ||||
| 59246 | } | ||||
| 59247 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59247); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59247; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59248 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59249 | |||||
| 59250 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59251 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59252 | if (!argv.resize(1)) { | ||||
| 59253 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59254 | // the right thing with that. | ||||
| 59255 | return; | ||||
| 59256 | } | ||||
| 59257 | unsigned argc = 1; | ||||
| 59258 | |||||
| 59259 | do { | ||||
| 59260 | if (arg.WasPassed()) { | ||||
| 59261 | if (arg.Value()) { | ||||
| 59262 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value())); | ||||
| 59263 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 59264 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59265 | return; | ||||
| 59266 | } | ||||
| 59267 | break; | ||||
| 59268 | } else { | ||||
| 59269 | argv[0].setNull(); | ||||
| 59270 | break; | ||||
| 59271 | } | ||||
| 59272 | } else if (argc == 1) { | ||||
| 59273 | // This is our current trailing argument; reduce argc | ||||
| 59274 | --argc; | ||||
| 59275 | } else { | ||||
| 59276 | argv[0].setUndefined(); | ||||
| 59277 | } | ||||
| 59278 | } while (false); | ||||
| 59279 | |||||
| 59280 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59281 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59282 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59283 | !InitIds(cx, atomsCache)) || | ||||
| 59284 | !GetCallableProperty(cx, atomsCache->passOptionalNullableCallback_id, &callable)) { | ||||
| 59285 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59286 | return; | ||||
| 59287 | } | ||||
| 59288 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59289 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59290 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59291 | aRv.NoteJSContextException(cx); | ||||
| 59292 | return; | ||||
| 59293 | } | ||||
| 59294 | } | ||||
| 59295 | |||||
| 59296 | void | ||||
| 59297 | TestJSImplInterfaceJSImpl::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59298 | { | ||||
| 59299 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59300 | if (aRv.Failed()) { | ||||
| 59301 | return; | ||||
| 59302 | } | ||||
| 59303 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59303); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59303; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59304 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59305 | |||||
| 59306 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59307 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59308 | if (!argv.resize(1)) { | ||||
| 59309 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59310 | // the right thing with that. | ||||
| 59311 | return; | ||||
| 59312 | } | ||||
| 59313 | unsigned argc = 1; | ||||
| 59314 | |||||
| 59315 | do { | ||||
| 59316 | if (arg) { | ||||
| 59317 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 59318 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 59319 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59320 | return; | ||||
| 59321 | } | ||||
| 59322 | break; | ||||
| 59323 | } else { | ||||
| 59324 | argv[0].setNull(); | ||||
| 59325 | break; | ||||
| 59326 | } | ||||
| 59327 | } while (false); | ||||
| 59328 | |||||
| 59329 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59330 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59331 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59332 | !InitIds(cx, atomsCache)) || | ||||
| 59333 | !GetCallableProperty(cx, atomsCache->passOptionalNullableCallbackWithDefaultValue_id, &callable)) { | ||||
| 59334 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59335 | return; | ||||
| 59336 | } | ||||
| 59337 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59338 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59339 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59340 | aRv.NoteJSContextException(cx); | ||||
| 59341 | return; | ||||
| 59342 | } | ||||
| 59343 | } | ||||
| 59344 | |||||
| 59345 | already_AddRefed<MyTestCallback> | ||||
| 59346 | TestJSImplInterfaceJSImpl::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59347 | { | ||||
| 59348 | CallSetup s(this, aRv, "TestJSImplInterface.receiveCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59349 | if (aRv.Failed()) { | ||||
| 59350 | return nullptr; | ||||
| 59351 | } | ||||
| 59352 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59352); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59352; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59353 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59354 | |||||
| 59355 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59356 | |||||
| 59357 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59358 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59359 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59360 | !InitIds(cx, atomsCache)) || | ||||
| 59361 | !GetCallableProperty(cx, atomsCache->receiveCallback_id, &callable)) { | ||||
| 59362 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59363 | return nullptr; | ||||
| 59364 | } | ||||
| 59365 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59366 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59367 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 59368 | aRv.NoteJSContextException(cx); | ||||
| 59369 | return nullptr; | ||||
| 59370 | } | ||||
| 59371 | RefPtr<MyTestCallback> rvalDecl; | ||||
| 59372 | if (rval.isObject()) { | ||||
| 59373 | if (JS::IsCallable(&rval.toObject())) { | ||||
| 59374 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 59375 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 59376 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 59377 | rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 59378 | } | ||||
| 59379 | } else { | ||||
| 59380 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveCallback"); | ||||
| 59381 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59382 | return nullptr; | ||||
| 59383 | } | ||||
| 59384 | } else { | ||||
| 59385 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallback"); | ||||
| 59386 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59387 | return nullptr; | ||||
| 59388 | } | ||||
| 59389 | return rvalDecl.forget(); | ||||
| 59390 | } | ||||
| 59391 | |||||
| 59392 | already_AddRefed<MyTestCallback> | ||||
| 59393 | TestJSImplInterfaceJSImpl::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59394 | { | ||||
| 59395 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59396 | if (aRv.Failed()) { | ||||
| 59397 | return nullptr; | ||||
| 59398 | } | ||||
| 59399 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59399); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59399; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59400 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59401 | |||||
| 59402 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59403 | |||||
| 59404 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59405 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59406 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59407 | !InitIds(cx, atomsCache)) || | ||||
| 59408 | !GetCallableProperty(cx, atomsCache->receiveNullableCallback_id, &callable)) { | ||||
| 59409 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59410 | return nullptr; | ||||
| 59411 | } | ||||
| 59412 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59413 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59414 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 59415 | aRv.NoteJSContextException(cx); | ||||
| 59416 | return nullptr; | ||||
| 59417 | } | ||||
| 59418 | RefPtr<MyTestCallback> rvalDecl; | ||||
| 59419 | if (rval.isObject()) { | ||||
| 59420 | if (JS::IsCallable(&rval.toObject())) { | ||||
| 59421 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 59422 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 59423 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 59424 | rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 59425 | } | ||||
| 59426 | } else { | ||||
| 59427 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveNullableCallback"); | ||||
| 59428 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59429 | return nullptr; | ||||
| 59430 | } | ||||
| 59431 | } else if (rval.isNullOrUndefined()) { | ||||
| 59432 | rvalDecl = nullptr; | ||||
| 59433 | } else { | ||||
| 59434 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallback"); | ||||
| 59435 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59436 | return nullptr; | ||||
| 59437 | } | ||||
| 59438 | return rvalDecl.forget(); | ||||
| 59439 | } | ||||
| 59440 | |||||
| 59441 | void | ||||
| 59442 | TestJSImplInterfaceJSImpl::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59443 | { | ||||
| 59444 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59445 | if (aRv.Failed()) { | ||||
| 59446 | return; | ||||
| 59447 | } | ||||
| 59448 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59448); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59448; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59449 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59450 | |||||
| 59451 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59452 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59453 | if (!argv.resize(1)) { | ||||
| 59454 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59455 | // the right thing with that. | ||||
| 59456 | return; | ||||
| 59457 | } | ||||
| 59458 | unsigned argc = 1; | ||||
| 59459 | |||||
| 59460 | do { | ||||
| 59461 | if (arg) { | ||||
| 59462 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 59463 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 59464 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59465 | return; | ||||
| 59466 | } | ||||
| 59467 | break; | ||||
| 59468 | } else { | ||||
| 59469 | argv[0].setNull(); | ||||
| 59470 | break; | ||||
| 59471 | } | ||||
| 59472 | } while (false); | ||||
| 59473 | |||||
| 59474 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59475 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59476 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59477 | !InitIds(cx, atomsCache)) || | ||||
| 59478 | !GetCallableProperty(cx, atomsCache->passOptionalNullableTreatAsNullCallbackWithDefaultValue_id, &callable)) { | ||||
| 59479 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59480 | return; | ||||
| 59481 | } | ||||
| 59482 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59483 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59484 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59485 | aRv.NoteJSContextException(cx); | ||||
| 59486 | return; | ||||
| 59487 | } | ||||
| 59488 | } | ||||
| 59489 | |||||
| 59490 | void | ||||
| 59491 | TestJSImplInterfaceJSImpl::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59492 | { | ||||
| 59493 | CallSetup s(this, aRv, "TestJSImplInterface.passAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59494 | if (aRv.Failed()) { | ||||
| 59495 | return; | ||||
| 59496 | } | ||||
| 59497 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59497); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59497; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59498 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59499 | |||||
| 59500 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59501 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59502 | if (!argv.resize(1)) { | ||||
| 59503 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59504 | // the right thing with that. | ||||
| 59505 | return; | ||||
| 59506 | } | ||||
| 59507 | unsigned argc = 1; | ||||
| 59508 | |||||
| 59509 | do { | ||||
| 59510 | JS::ExposeValueToActiveJS(arg); | ||||
| 59511 | argv[0].set(arg); | ||||
| 59512 | if (!MaybeWrapValue(cx, argv[0])) { | ||||
| 59513 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59514 | return; | ||||
| 59515 | } | ||||
| 59516 | break; | ||||
| 59517 | } while (false); | ||||
| 59518 | |||||
| 59519 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59520 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59521 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59522 | !InitIds(cx, atomsCache)) || | ||||
| 59523 | !GetCallableProperty(cx, atomsCache->passAny_id, &callable)) { | ||||
| 59524 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59525 | return; | ||||
| 59526 | } | ||||
| 59527 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59528 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59529 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59530 | aRv.NoteJSContextException(cx); | ||||
| 59531 | return; | ||||
| 59532 | } | ||||
| 59533 | } | ||||
| 59534 | |||||
| 59535 | void | ||||
| 59536 | TestJSImplInterfaceJSImpl::PassVariadicAny(const nsTArray<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59537 | { | ||||
| 59538 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59539 | if (aRv.Failed()) { | ||||
| 59540 | return; | ||||
| 59541 | } | ||||
| 59542 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59542); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59542; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59543 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59544 | |||||
| 59545 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59546 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59547 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 59548 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59549 | // the right thing with that. | ||||
| 59550 | return; | ||||
| 59551 | } | ||||
| 59552 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 59553 | |||||
| 59554 | do { | ||||
| 59555 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 59556 | JS::ExposeValueToActiveJS(arg[idx]); | ||||
| 59557 | argv[0 + idx].set(arg[idx]); | ||||
| 59558 | if (!MaybeWrapValue(cx, argv[0 + idx])) { | ||||
| 59559 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59560 | return; | ||||
| 59561 | } | ||||
| 59562 | continue; | ||||
| 59563 | } | ||||
| 59564 | break; | ||||
| 59565 | } while (false); | ||||
| 59566 | |||||
| 59567 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59568 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59569 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59570 | !InitIds(cx, atomsCache)) || | ||||
| 59571 | !GetCallableProperty(cx, atomsCache->passVariadicAny_id, &callable)) { | ||||
| 59572 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59573 | return; | ||||
| 59574 | } | ||||
| 59575 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59576 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59577 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59578 | aRv.NoteJSContextException(cx); | ||||
| 59579 | return; | ||||
| 59580 | } | ||||
| 59581 | } | ||||
| 59582 | |||||
| 59583 | void | ||||
| 59584 | TestJSImplInterfaceJSImpl::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59585 | { | ||||
| 59586 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59587 | if (aRv.Failed()) { | ||||
| 59588 | return; | ||||
| 59589 | } | ||||
| 59590 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59590); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59590; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59591 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59592 | |||||
| 59593 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59594 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59595 | if (!argv.resize(1)) { | ||||
| 59596 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59597 | // the right thing with that. | ||||
| 59598 | return; | ||||
| 59599 | } | ||||
| 59600 | unsigned argc = 1; | ||||
| 59601 | |||||
| 59602 | do { | ||||
| 59603 | JS::ExposeValueToActiveJS(arg); | ||||
| 59604 | argv[0].set(arg); | ||||
| 59605 | if (!MaybeWrapValue(cx, argv[0])) { | ||||
| 59606 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59607 | return; | ||||
| 59608 | } | ||||
| 59609 | break; | ||||
| 59610 | } while (false); | ||||
| 59611 | |||||
| 59612 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59613 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59614 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59615 | !InitIds(cx, atomsCache)) || | ||||
| 59616 | !GetCallableProperty(cx, atomsCache->passOptionalAny_id, &callable)) { | ||||
| 59617 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59618 | return; | ||||
| 59619 | } | ||||
| 59620 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59621 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59622 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59623 | aRv.NoteJSContextException(cx); | ||||
| 59624 | return; | ||||
| 59625 | } | ||||
| 59626 | } | ||||
| 59627 | |||||
| 59628 | void | ||||
| 59629 | TestJSImplInterfaceJSImpl::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59630 | { | ||||
| 59631 | CallSetup s(this, aRv, "TestJSImplInterface.passAnyDefaultNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59632 | if (aRv.Failed()) { | ||||
| 59633 | return; | ||||
| 59634 | } | ||||
| 59635 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59635); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59635; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59636 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59637 | |||||
| 59638 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59639 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59640 | if (!argv.resize(1)) { | ||||
| 59641 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59642 | // the right thing with that. | ||||
| 59643 | return; | ||||
| 59644 | } | ||||
| 59645 | unsigned argc = 1; | ||||
| 59646 | |||||
| 59647 | do { | ||||
| 59648 | JS::ExposeValueToActiveJS(arg); | ||||
| 59649 | argv[0].set(arg); | ||||
| 59650 | if (!MaybeWrapValue(cx, argv[0])) { | ||||
| 59651 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59652 | return; | ||||
| 59653 | } | ||||
| 59654 | break; | ||||
| 59655 | } while (false); | ||||
| 59656 | |||||
| 59657 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59658 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59659 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59660 | !InitIds(cx, atomsCache)) || | ||||
| 59661 | !GetCallableProperty(cx, atomsCache->passAnyDefaultNull_id, &callable)) { | ||||
| 59662 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59663 | return; | ||||
| 59664 | } | ||||
| 59665 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59666 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59667 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59668 | aRv.NoteJSContextException(cx); | ||||
| 59669 | return; | ||||
| 59670 | } | ||||
| 59671 | } | ||||
| 59672 | |||||
| 59673 | void | ||||
| 59674 | TestJSImplInterfaceJSImpl::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59675 | { | ||||
| 59676 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59677 | if (aRv.Failed()) { | ||||
| 59678 | return; | ||||
| 59679 | } | ||||
| 59680 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59680); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59680; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59681 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59682 | |||||
| 59683 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59684 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59685 | if (!argv.resize(1)) { | ||||
| 59686 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59687 | // the right thing with that. | ||||
| 59688 | return; | ||||
| 59689 | } | ||||
| 59690 | unsigned argc = 1; | ||||
| 59691 | |||||
| 59692 | do { | ||||
| 59693 | |||||
| 59694 | uint32_t length = arg.Length(); | ||||
| 59695 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 59696 | if (!returnArray) { | ||||
| 59697 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59698 | return; | ||||
| 59699 | } | ||||
| 59700 | // Scope for 'tmp' | ||||
| 59701 | { | ||||
| 59702 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 59703 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 59704 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 59705 | // are different ways to succeed at wrapping the object. | ||||
| 59706 | do { | ||||
| 59707 | JS::ExposeValueToActiveJS(arg[sequenceIdx0]); | ||||
| 59708 | tmp.set(arg[sequenceIdx0]); | ||||
| 59709 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 59710 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59711 | return; | ||||
| 59712 | } | ||||
| 59713 | break; | ||||
| 59714 | } while (false); | ||||
| 59715 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 59716 | JSPROP_ENUMERATE)) { | ||||
| 59717 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59718 | return; | ||||
| 59719 | } | ||||
| 59720 | } | ||||
| 59721 | } | ||||
| 59722 | argv[0].setObject(*returnArray); | ||||
| 59723 | break; | ||||
| 59724 | } while (false); | ||||
| 59725 | |||||
| 59726 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59727 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59728 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59729 | !InitIds(cx, atomsCache)) || | ||||
| 59730 | !GetCallableProperty(cx, atomsCache->passSequenceOfAny_id, &callable)) { | ||||
| 59731 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59732 | return; | ||||
| 59733 | } | ||||
| 59734 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59735 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59736 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59737 | aRv.NoteJSContextException(cx); | ||||
| 59738 | return; | ||||
| 59739 | } | ||||
| 59740 | } | ||||
| 59741 | |||||
| 59742 | void | ||||
| 59743 | TestJSImplInterfaceJSImpl::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59744 | { | ||||
| 59745 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59746 | if (aRv.Failed()) { | ||||
| 59747 | return; | ||||
| 59748 | } | ||||
| 59749 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59749); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59749; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59750 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59751 | |||||
| 59752 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59753 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59754 | if (!argv.resize(1)) { | ||||
| 59755 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59756 | // the right thing with that. | ||||
| 59757 | return; | ||||
| 59758 | } | ||||
| 59759 | unsigned argc = 1; | ||||
| 59760 | |||||
| 59761 | do { | ||||
| 59762 | |||||
| 59763 | if (arg.IsNull()) { | ||||
| 59764 | argv[0].setNull(); | ||||
| 59765 | break; | ||||
| 59766 | } | ||||
| 59767 | |||||
| 59768 | uint32_t length = arg.Value().Length(); | ||||
| 59769 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 59770 | if (!returnArray) { | ||||
| 59771 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59772 | return; | ||||
| 59773 | } | ||||
| 59774 | // Scope for 'tmp' | ||||
| 59775 | { | ||||
| 59776 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 59777 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 59778 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 59779 | // are different ways to succeed at wrapping the object. | ||||
| 59780 | do { | ||||
| 59781 | JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]); | ||||
| 59782 | tmp.set(arg.Value()[sequenceIdx0]); | ||||
| 59783 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 59784 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59785 | return; | ||||
| 59786 | } | ||||
| 59787 | break; | ||||
| 59788 | } while (false); | ||||
| 59789 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 59790 | JSPROP_ENUMERATE)) { | ||||
| 59791 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59792 | return; | ||||
| 59793 | } | ||||
| 59794 | } | ||||
| 59795 | } | ||||
| 59796 | argv[0].setObject(*returnArray); | ||||
| 59797 | break; | ||||
| 59798 | } while (false); | ||||
| 59799 | |||||
| 59800 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59801 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59802 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59803 | !InitIds(cx, atomsCache)) || | ||||
| 59804 | !GetCallableProperty(cx, atomsCache->passNullableSequenceOfAny_id, &callable)) { | ||||
| 59805 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59806 | return; | ||||
| 59807 | } | ||||
| 59808 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59809 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59810 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59811 | aRv.NoteJSContextException(cx); | ||||
| 59812 | return; | ||||
| 59813 | } | ||||
| 59814 | } | ||||
| 59815 | |||||
| 59816 | void | ||||
| 59817 | TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59818 | { | ||||
| 59819 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59820 | if (aRv.Failed()) { | ||||
| 59821 | return; | ||||
| 59822 | } | ||||
| 59823 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59823); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59823; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59824 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59825 | |||||
| 59826 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59827 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59828 | if (!argv.resize(1)) { | ||||
| 59829 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59830 | // the right thing with that. | ||||
| 59831 | return; | ||||
| 59832 | } | ||||
| 59833 | unsigned argc = 1; | ||||
| 59834 | |||||
| 59835 | do { | ||||
| 59836 | if (arg.WasPassed()) { | ||||
| 59837 | |||||
| 59838 | uint32_t length = arg.Value().Length(); | ||||
| 59839 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 59840 | if (!returnArray) { | ||||
| 59841 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59842 | return; | ||||
| 59843 | } | ||||
| 59844 | // Scope for 'tmp' | ||||
| 59845 | { | ||||
| 59846 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 59847 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 59848 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 59849 | // are different ways to succeed at wrapping the object. | ||||
| 59850 | do { | ||||
| 59851 | JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]); | ||||
| 59852 | tmp.set(arg.Value()[sequenceIdx0]); | ||||
| 59853 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 59854 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59855 | return; | ||||
| 59856 | } | ||||
| 59857 | break; | ||||
| 59858 | } while (false); | ||||
| 59859 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 59860 | JSPROP_ENUMERATE)) { | ||||
| 59861 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59862 | return; | ||||
| 59863 | } | ||||
| 59864 | } | ||||
| 59865 | } | ||||
| 59866 | argv[0].setObject(*returnArray); | ||||
| 59867 | break; | ||||
| 59868 | } else if (argc == 1) { | ||||
| 59869 | // This is our current trailing argument; reduce argc | ||||
| 59870 | --argc; | ||||
| 59871 | } else { | ||||
| 59872 | argv[0].setUndefined(); | ||||
| 59873 | } | ||||
| 59874 | } while (false); | ||||
| 59875 | |||||
| 59876 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59877 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59878 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59879 | !InitIds(cx, atomsCache)) || | ||||
| 59880 | !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAny_id, &callable)) { | ||||
| 59881 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59882 | return; | ||||
| 59883 | } | ||||
| 59884 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59885 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59886 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59887 | aRv.NoteJSContextException(cx); | ||||
| 59888 | return; | ||||
| 59889 | } | ||||
| 59890 | } | ||||
| 59891 | |||||
| 59892 | void | ||||
| 59893 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59894 | { | ||||
| 59895 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59896 | if (aRv.Failed()) { | ||||
| 59897 | return; | ||||
| 59898 | } | ||||
| 59899 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59899); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59899; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59900 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59901 | |||||
| 59902 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59903 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59904 | if (!argv.resize(1)) { | ||||
| 59905 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59906 | // the right thing with that. | ||||
| 59907 | return; | ||||
| 59908 | } | ||||
| 59909 | unsigned argc = 1; | ||||
| 59910 | |||||
| 59911 | do { | ||||
| 59912 | if (arg.WasPassed()) { | ||||
| 59913 | |||||
| 59914 | if (arg.Value().IsNull()) { | ||||
| 59915 | argv[0].setNull(); | ||||
| 59916 | break; | ||||
| 59917 | } | ||||
| 59918 | |||||
| 59919 | uint32_t length = arg.Value().Value().Length(); | ||||
| 59920 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 59921 | if (!returnArray) { | ||||
| 59922 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59923 | return; | ||||
| 59924 | } | ||||
| 59925 | // Scope for 'tmp' | ||||
| 59926 | { | ||||
| 59927 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 59928 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 59929 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 59930 | // are different ways to succeed at wrapping the object. | ||||
| 59931 | do { | ||||
| 59932 | JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0]); | ||||
| 59933 | tmp.set(arg.Value().Value()[sequenceIdx0]); | ||||
| 59934 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 59935 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59936 | return; | ||||
| 59937 | } | ||||
| 59938 | break; | ||||
| 59939 | } while (false); | ||||
| 59940 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 59941 | JSPROP_ENUMERATE)) { | ||||
| 59942 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59943 | return; | ||||
| 59944 | } | ||||
| 59945 | } | ||||
| 59946 | } | ||||
| 59947 | argv[0].setObject(*returnArray); | ||||
| 59948 | break; | ||||
| 59949 | } else if (argc == 1) { | ||||
| 59950 | // This is our current trailing argument; reduce argc | ||||
| 59951 | --argc; | ||||
| 59952 | } else { | ||||
| 59953 | argv[0].setUndefined(); | ||||
| 59954 | } | ||||
| 59955 | } while (false); | ||||
| 59956 | |||||
| 59957 | JS::Rooted<JS::Value> callable(cx); | ||||
| 59958 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 59959 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 59960 | !InitIds(cx, atomsCache)) || | ||||
| 59961 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfAny_id, &callable)) { | ||||
| 59962 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 59963 | return; | ||||
| 59964 | } | ||||
| 59965 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 59966 | if (!JS::Call(cx, thisValue, callable, | ||||
| 59967 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 59968 | aRv.NoteJSContextException(cx); | ||||
| 59969 | return; | ||||
| 59970 | } | ||||
| 59971 | } | ||||
| 59972 | |||||
| 59973 | void | ||||
| 59974 | TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 59975 | { | ||||
| 59976 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 59977 | if (aRv.Failed()) { | ||||
| 59978 | return; | ||||
| 59979 | } | ||||
| 59980 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 59980); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 59980; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 59981 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 59982 | |||||
| 59983 | JS::Rooted<JS::Value> rval(cx); | ||||
| 59984 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 59985 | if (!argv.resize(1)) { | ||||
| 59986 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 59987 | // the right thing with that. | ||||
| 59988 | return; | ||||
| 59989 | } | ||||
| 59990 | unsigned argc = 1; | ||||
| 59991 | |||||
| 59992 | do { | ||||
| 59993 | |||||
| 59994 | if (arg.IsNull()) { | ||||
| 59995 | argv[0].setNull(); | ||||
| 59996 | break; | ||||
| 59997 | } | ||||
| 59998 | |||||
| 59999 | uint32_t length = arg.Value().Length(); | ||||
| 60000 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60001 | if (!returnArray) { | ||||
| 60002 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60003 | return; | ||||
| 60004 | } | ||||
| 60005 | // Scope for 'tmp' | ||||
| 60006 | { | ||||
| 60007 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60008 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 60009 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60010 | // are different ways to succeed at wrapping the object. | ||||
| 60011 | do { | ||||
| 60012 | JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]); | ||||
| 60013 | tmp.set(arg.Value()[sequenceIdx0]); | ||||
| 60014 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60015 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60016 | return; | ||||
| 60017 | } | ||||
| 60018 | break; | ||||
| 60019 | } while (false); | ||||
| 60020 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 60021 | JSPROP_ENUMERATE)) { | ||||
| 60022 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60023 | return; | ||||
| 60024 | } | ||||
| 60025 | } | ||||
| 60026 | } | ||||
| 60027 | argv[0].setObject(*returnArray); | ||||
| 60028 | break; | ||||
| 60029 | } while (false); | ||||
| 60030 | |||||
| 60031 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60032 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60033 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60034 | !InitIds(cx, atomsCache)) || | ||||
| 60035 | !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id, &callable)) { | ||||
| 60036 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60037 | return; | ||||
| 60038 | } | ||||
| 60039 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60040 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60041 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60042 | aRv.NoteJSContextException(cx); | ||||
| 60043 | return; | ||||
| 60044 | } | ||||
| 60045 | } | ||||
| 60046 | |||||
| 60047 | void | ||||
| 60048 | TestJSImplInterfaceJSImpl::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60049 | { | ||||
| 60050 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60051 | if (aRv.Failed()) { | ||||
| 60052 | return; | ||||
| 60053 | } | ||||
| 60054 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60054); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60054; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60055 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60056 | |||||
| 60057 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60058 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60059 | if (!argv.resize(1)) { | ||||
| 60060 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60061 | // the right thing with that. | ||||
| 60062 | return; | ||||
| 60063 | } | ||||
| 60064 | unsigned argc = 1; | ||||
| 60065 | |||||
| 60066 | do { | ||||
| 60067 | |||||
| 60068 | uint32_t length = arg.Length(); | ||||
| 60069 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60070 | if (!returnArray) { | ||||
| 60071 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60072 | return; | ||||
| 60073 | } | ||||
| 60074 | // Scope for 'tmp' | ||||
| 60075 | { | ||||
| 60076 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60077 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 60078 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60079 | // are different ways to succeed at wrapping the object. | ||||
| 60080 | do { | ||||
| 60081 | |||||
| 60082 | uint32_t length = arg[sequenceIdx0].Length(); | ||||
| 60083 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60084 | if (!returnArray) { | ||||
| 60085 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60086 | return; | ||||
| 60087 | } | ||||
| 60088 | // Scope for 'tmp' | ||||
| 60089 | { | ||||
| 60090 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60091 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 60092 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60093 | // are different ways to succeed at wrapping the object. | ||||
| 60094 | do { | ||||
| 60095 | JS::ExposeValueToActiveJS(arg[sequenceIdx0][sequenceIdx1]); | ||||
| 60096 | tmp.set(arg[sequenceIdx0][sequenceIdx1]); | ||||
| 60097 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60098 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60099 | return; | ||||
| 60100 | } | ||||
| 60101 | break; | ||||
| 60102 | } while (false); | ||||
| 60103 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 60104 | JSPROP_ENUMERATE)) { | ||||
| 60105 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60106 | return; | ||||
| 60107 | } | ||||
| 60108 | } | ||||
| 60109 | } | ||||
| 60110 | tmp.setObject(*returnArray); | ||||
| 60111 | break; | ||||
| 60112 | } while (false); | ||||
| 60113 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 60114 | JSPROP_ENUMERATE)) { | ||||
| 60115 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60116 | return; | ||||
| 60117 | } | ||||
| 60118 | } | ||||
| 60119 | } | ||||
| 60120 | argv[0].setObject(*returnArray); | ||||
| 60121 | break; | ||||
| 60122 | } while (false); | ||||
| 60123 | |||||
| 60124 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60125 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60126 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60127 | !InitIds(cx, atomsCache)) || | ||||
| 60128 | !GetCallableProperty(cx, atomsCache->passSequenceOfSequenceOfAny_id, &callable)) { | ||||
| 60129 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60130 | return; | ||||
| 60131 | } | ||||
| 60132 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60133 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60134 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60135 | aRv.NoteJSContextException(cx); | ||||
| 60136 | return; | ||||
| 60137 | } | ||||
| 60138 | } | ||||
| 60139 | |||||
| 60140 | void | ||||
| 60141 | TestJSImplInterfaceJSImpl::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60142 | { | ||||
| 60143 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60144 | if (aRv.Failed()) { | ||||
| 60145 | return; | ||||
| 60146 | } | ||||
| 60147 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60147); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60147; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60148 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60149 | |||||
| 60150 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60151 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60152 | if (!argv.resize(1)) { | ||||
| 60153 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60154 | // the right thing with that. | ||||
| 60155 | return; | ||||
| 60156 | } | ||||
| 60157 | unsigned argc = 1; | ||||
| 60158 | |||||
| 60159 | do { | ||||
| 60160 | |||||
| 60161 | uint32_t length = arg.Length(); | ||||
| 60162 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60163 | if (!returnArray) { | ||||
| 60164 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60165 | return; | ||||
| 60166 | } | ||||
| 60167 | // Scope for 'tmp' | ||||
| 60168 | { | ||||
| 60169 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60170 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 60171 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60172 | // are different ways to succeed at wrapping the object. | ||||
| 60173 | do { | ||||
| 60174 | |||||
| 60175 | if (arg[sequenceIdx0].IsNull()) { | ||||
| 60176 | tmp.setNull(); | ||||
| 60177 | break; | ||||
| 60178 | } | ||||
| 60179 | |||||
| 60180 | uint32_t length = arg[sequenceIdx0].Value().Length(); | ||||
| 60181 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60182 | if (!returnArray) { | ||||
| 60183 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60184 | return; | ||||
| 60185 | } | ||||
| 60186 | // Scope for 'tmp' | ||||
| 60187 | { | ||||
| 60188 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60189 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 60190 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60191 | // are different ways to succeed at wrapping the object. | ||||
| 60192 | do { | ||||
| 60193 | JS::ExposeValueToActiveJS(arg[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60194 | tmp.set(arg[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60195 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60196 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60197 | return; | ||||
| 60198 | } | ||||
| 60199 | break; | ||||
| 60200 | } while (false); | ||||
| 60201 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 60202 | JSPROP_ENUMERATE)) { | ||||
| 60203 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60204 | return; | ||||
| 60205 | } | ||||
| 60206 | } | ||||
| 60207 | } | ||||
| 60208 | tmp.setObject(*returnArray); | ||||
| 60209 | break; | ||||
| 60210 | } while (false); | ||||
| 60211 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 60212 | JSPROP_ENUMERATE)) { | ||||
| 60213 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60214 | return; | ||||
| 60215 | } | ||||
| 60216 | } | ||||
| 60217 | } | ||||
| 60218 | argv[0].setObject(*returnArray); | ||||
| 60219 | break; | ||||
| 60220 | } while (false); | ||||
| 60221 | |||||
| 60222 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60223 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60224 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60225 | !InitIds(cx, atomsCache)) || | ||||
| 60226 | !GetCallableProperty(cx, atomsCache->passSequenceOfNullableSequenceOfAny_id, &callable)) { | ||||
| 60227 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60228 | return; | ||||
| 60229 | } | ||||
| 60230 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60231 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60232 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60233 | aRv.NoteJSContextException(cx); | ||||
| 60234 | return; | ||||
| 60235 | } | ||||
| 60236 | } | ||||
| 60237 | |||||
| 60238 | void | ||||
| 60239 | TestJSImplInterfaceJSImpl::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60240 | { | ||||
| 60241 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60242 | if (aRv.Failed()) { | ||||
| 60243 | return; | ||||
| 60244 | } | ||||
| 60245 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60245); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60245; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60246 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60247 | |||||
| 60248 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60249 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60250 | if (!argv.resize(1)) { | ||||
| 60251 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60252 | // the right thing with that. | ||||
| 60253 | return; | ||||
| 60254 | } | ||||
| 60255 | unsigned argc = 1; | ||||
| 60256 | |||||
| 60257 | do { | ||||
| 60258 | |||||
| 60259 | if (arg.IsNull()) { | ||||
| 60260 | argv[0].setNull(); | ||||
| 60261 | break; | ||||
| 60262 | } | ||||
| 60263 | |||||
| 60264 | uint32_t length = arg.Value().Length(); | ||||
| 60265 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60266 | if (!returnArray) { | ||||
| 60267 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60268 | return; | ||||
| 60269 | } | ||||
| 60270 | // Scope for 'tmp' | ||||
| 60271 | { | ||||
| 60272 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60273 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 60274 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60275 | // are different ways to succeed at wrapping the object. | ||||
| 60276 | do { | ||||
| 60277 | |||||
| 60278 | if (arg.Value()[sequenceIdx0].IsNull()) { | ||||
| 60279 | tmp.setNull(); | ||||
| 60280 | break; | ||||
| 60281 | } | ||||
| 60282 | |||||
| 60283 | uint32_t length = arg.Value()[sequenceIdx0].Value().Length(); | ||||
| 60284 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60285 | if (!returnArray) { | ||||
| 60286 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60287 | return; | ||||
| 60288 | } | ||||
| 60289 | // Scope for 'tmp' | ||||
| 60290 | { | ||||
| 60291 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60292 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 60293 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60294 | // are different ways to succeed at wrapping the object. | ||||
| 60295 | do { | ||||
| 60296 | JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60297 | tmp.set(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60298 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60299 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60300 | return; | ||||
| 60301 | } | ||||
| 60302 | break; | ||||
| 60303 | } while (false); | ||||
| 60304 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 60305 | JSPROP_ENUMERATE)) { | ||||
| 60306 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60307 | return; | ||||
| 60308 | } | ||||
| 60309 | } | ||||
| 60310 | } | ||||
| 60311 | tmp.setObject(*returnArray); | ||||
| 60312 | break; | ||||
| 60313 | } while (false); | ||||
| 60314 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 60315 | JSPROP_ENUMERATE)) { | ||||
| 60316 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60317 | return; | ||||
| 60318 | } | ||||
| 60319 | } | ||||
| 60320 | } | ||||
| 60321 | argv[0].setObject(*returnArray); | ||||
| 60322 | break; | ||||
| 60323 | } while (false); | ||||
| 60324 | |||||
| 60325 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60326 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60327 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60328 | !InitIds(cx, atomsCache)) || | ||||
| 60329 | !GetCallableProperty(cx, atomsCache->passNullableSequenceOfNullableSequenceOfAny_id, &callable)) { | ||||
| 60330 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60331 | return; | ||||
| 60332 | } | ||||
| 60333 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60334 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60335 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60336 | aRv.NoteJSContextException(cx); | ||||
| 60337 | return; | ||||
| 60338 | } | ||||
| 60339 | } | ||||
| 60340 | |||||
| 60341 | void | ||||
| 60342 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60343 | { | ||||
| 60344 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60345 | if (aRv.Failed()) { | ||||
| 60346 | return; | ||||
| 60347 | } | ||||
| 60348 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60348); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60348; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60349 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60350 | |||||
| 60351 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60352 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60353 | if (!argv.resize(1)) { | ||||
| 60354 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60355 | // the right thing with that. | ||||
| 60356 | return; | ||||
| 60357 | } | ||||
| 60358 | unsigned argc = 1; | ||||
| 60359 | |||||
| 60360 | do { | ||||
| 60361 | if (arg.WasPassed()) { | ||||
| 60362 | |||||
| 60363 | if (arg.Value().IsNull()) { | ||||
| 60364 | argv[0].setNull(); | ||||
| 60365 | break; | ||||
| 60366 | } | ||||
| 60367 | |||||
| 60368 | uint32_t length = arg.Value().Value().Length(); | ||||
| 60369 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60370 | if (!returnArray) { | ||||
| 60371 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60372 | return; | ||||
| 60373 | } | ||||
| 60374 | // Scope for 'tmp' | ||||
| 60375 | { | ||||
| 60376 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60377 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 60378 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60379 | // are different ways to succeed at wrapping the object. | ||||
| 60380 | do { | ||||
| 60381 | |||||
| 60382 | if (arg.Value().Value()[sequenceIdx0].IsNull()) { | ||||
| 60383 | tmp.setNull(); | ||||
| 60384 | break; | ||||
| 60385 | } | ||||
| 60386 | |||||
| 60387 | uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length(); | ||||
| 60388 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 60389 | if (!returnArray) { | ||||
| 60390 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60391 | return; | ||||
| 60392 | } | ||||
| 60393 | // Scope for 'tmp' | ||||
| 60394 | { | ||||
| 60395 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60396 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 60397 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 60398 | // are different ways to succeed at wrapping the object. | ||||
| 60399 | do { | ||||
| 60400 | JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60401 | tmp.set(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 60402 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60403 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60404 | return; | ||||
| 60405 | } | ||||
| 60406 | break; | ||||
| 60407 | } while (false); | ||||
| 60408 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 60409 | JSPROP_ENUMERATE)) { | ||||
| 60410 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60411 | return; | ||||
| 60412 | } | ||||
| 60413 | } | ||||
| 60414 | } | ||||
| 60415 | tmp.setObject(*returnArray); | ||||
| 60416 | break; | ||||
| 60417 | } while (false); | ||||
| 60418 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 60419 | JSPROP_ENUMERATE)) { | ||||
| 60420 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60421 | return; | ||||
| 60422 | } | ||||
| 60423 | } | ||||
| 60424 | } | ||||
| 60425 | argv[0].setObject(*returnArray); | ||||
| 60426 | break; | ||||
| 60427 | } else if (argc == 1) { | ||||
| 60428 | // This is our current trailing argument; reduce argc | ||||
| 60429 | --argc; | ||||
| 60430 | } else { | ||||
| 60431 | argv[0].setUndefined(); | ||||
| 60432 | } | ||||
| 60433 | } while (false); | ||||
| 60434 | |||||
| 60435 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60436 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60437 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60438 | !InitIds(cx, atomsCache)) || | ||||
| 60439 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id, &callable)) { | ||||
| 60440 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60441 | return; | ||||
| 60442 | } | ||||
| 60443 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60444 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60445 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60446 | aRv.NoteJSContextException(cx); | ||||
| 60447 | return; | ||||
| 60448 | } | ||||
| 60449 | } | ||||
| 60450 | |||||
| 60451 | void | ||||
| 60452 | TestJSImplInterfaceJSImpl::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60453 | { | ||||
| 60454 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60455 | if (aRv.Failed()) { | ||||
| 60456 | return; | ||||
| 60457 | } | ||||
| 60458 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60458); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60458; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60459 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60460 | |||||
| 60461 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60462 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60463 | if (!argv.resize(1)) { | ||||
| 60464 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60465 | // the right thing with that. | ||||
| 60466 | return; | ||||
| 60467 | } | ||||
| 60468 | unsigned argc = 1; | ||||
| 60469 | |||||
| 60470 | do { | ||||
| 60471 | |||||
| 60472 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60473 | if (!returnObj) { | ||||
| 60474 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60475 | return; | ||||
| 60476 | } | ||||
| 60477 | // Scope for 'tmp' | ||||
| 60478 | { | ||||
| 60479 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60480 | for (auto& entry : arg.Entries()) { | ||||
| 60481 | auto& recordValue0 = entry.mValue; | ||||
| 60482 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60483 | // are different ways to succeed at wrapping the value. | ||||
| 60484 | do { | ||||
| 60485 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 60486 | tmp.set(recordValue0); | ||||
| 60487 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60488 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60489 | return; | ||||
| 60490 | } | ||||
| 60491 | break; | ||||
| 60492 | } while (false); | ||||
| 60493 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60494 | entry.mKey.BeginReading(), | ||||
| 60495 | entry.mKey.Length(), tmp, | ||||
| 60496 | JSPROP_ENUMERATE)) { | ||||
| 60497 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60498 | return; | ||||
| 60499 | } | ||||
| 60500 | } | ||||
| 60501 | } | ||||
| 60502 | argv[0].setObject(*returnObj); | ||||
| 60503 | break; | ||||
| 60504 | } while (false); | ||||
| 60505 | |||||
| 60506 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60507 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60508 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60509 | !InitIds(cx, atomsCache)) || | ||||
| 60510 | !GetCallableProperty(cx, atomsCache->passRecordOfAny_id, &callable)) { | ||||
| 60511 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60512 | return; | ||||
| 60513 | } | ||||
| 60514 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60515 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60516 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60517 | aRv.NoteJSContextException(cx); | ||||
| 60518 | return; | ||||
| 60519 | } | ||||
| 60520 | } | ||||
| 60521 | |||||
| 60522 | void | ||||
| 60523 | TestJSImplInterfaceJSImpl::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60524 | { | ||||
| 60525 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60526 | if (aRv.Failed()) { | ||||
| 60527 | return; | ||||
| 60528 | } | ||||
| 60529 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60529); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60529; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60530 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60531 | |||||
| 60532 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60533 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60534 | if (!argv.resize(1)) { | ||||
| 60535 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60536 | // the right thing with that. | ||||
| 60537 | return; | ||||
| 60538 | } | ||||
| 60539 | unsigned argc = 1; | ||||
| 60540 | |||||
| 60541 | do { | ||||
| 60542 | |||||
| 60543 | if (arg.IsNull()) { | ||||
| 60544 | argv[0].setNull(); | ||||
| 60545 | break; | ||||
| 60546 | } | ||||
| 60547 | |||||
| 60548 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60549 | if (!returnObj) { | ||||
| 60550 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60551 | return; | ||||
| 60552 | } | ||||
| 60553 | // Scope for 'tmp' | ||||
| 60554 | { | ||||
| 60555 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60556 | for (auto& entry : arg.Value().Entries()) { | ||||
| 60557 | auto& recordValue0 = entry.mValue; | ||||
| 60558 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60559 | // are different ways to succeed at wrapping the value. | ||||
| 60560 | do { | ||||
| 60561 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 60562 | tmp.set(recordValue0); | ||||
| 60563 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60564 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60565 | return; | ||||
| 60566 | } | ||||
| 60567 | break; | ||||
| 60568 | } while (false); | ||||
| 60569 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60570 | entry.mKey.BeginReading(), | ||||
| 60571 | entry.mKey.Length(), tmp, | ||||
| 60572 | JSPROP_ENUMERATE)) { | ||||
| 60573 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60574 | return; | ||||
| 60575 | } | ||||
| 60576 | } | ||||
| 60577 | } | ||||
| 60578 | argv[0].setObject(*returnObj); | ||||
| 60579 | break; | ||||
| 60580 | } while (false); | ||||
| 60581 | |||||
| 60582 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60583 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60584 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60585 | !InitIds(cx, atomsCache)) || | ||||
| 60586 | !GetCallableProperty(cx, atomsCache->passNullableRecordOfAny_id, &callable)) { | ||||
| 60587 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60588 | return; | ||||
| 60589 | } | ||||
| 60590 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60591 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60592 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60593 | aRv.NoteJSContextException(cx); | ||||
| 60594 | return; | ||||
| 60595 | } | ||||
| 60596 | } | ||||
| 60597 | |||||
| 60598 | void | ||||
| 60599 | TestJSImplInterfaceJSImpl::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60600 | { | ||||
| 60601 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60602 | if (aRv.Failed()) { | ||||
| 60603 | return; | ||||
| 60604 | } | ||||
| 60605 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60605); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60605; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60606 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60607 | |||||
| 60608 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60609 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60610 | if (!argv.resize(1)) { | ||||
| 60611 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60612 | // the right thing with that. | ||||
| 60613 | return; | ||||
| 60614 | } | ||||
| 60615 | unsigned argc = 1; | ||||
| 60616 | |||||
| 60617 | do { | ||||
| 60618 | if (arg.WasPassed()) { | ||||
| 60619 | |||||
| 60620 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60621 | if (!returnObj) { | ||||
| 60622 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60623 | return; | ||||
| 60624 | } | ||||
| 60625 | // Scope for 'tmp' | ||||
| 60626 | { | ||||
| 60627 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60628 | for (auto& entry : arg.Value().Entries()) { | ||||
| 60629 | auto& recordValue0 = entry.mValue; | ||||
| 60630 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60631 | // are different ways to succeed at wrapping the value. | ||||
| 60632 | do { | ||||
| 60633 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 60634 | tmp.set(recordValue0); | ||||
| 60635 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60636 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60637 | return; | ||||
| 60638 | } | ||||
| 60639 | break; | ||||
| 60640 | } while (false); | ||||
| 60641 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60642 | entry.mKey.BeginReading(), | ||||
| 60643 | entry.mKey.Length(), tmp, | ||||
| 60644 | JSPROP_ENUMERATE)) { | ||||
| 60645 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60646 | return; | ||||
| 60647 | } | ||||
| 60648 | } | ||||
| 60649 | } | ||||
| 60650 | argv[0].setObject(*returnObj); | ||||
| 60651 | break; | ||||
| 60652 | } else if (argc == 1) { | ||||
| 60653 | // This is our current trailing argument; reduce argc | ||||
| 60654 | --argc; | ||||
| 60655 | } else { | ||||
| 60656 | argv[0].setUndefined(); | ||||
| 60657 | } | ||||
| 60658 | } while (false); | ||||
| 60659 | |||||
| 60660 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60661 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60662 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60663 | !InitIds(cx, atomsCache)) || | ||||
| 60664 | !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAny_id, &callable)) { | ||||
| 60665 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60666 | return; | ||||
| 60667 | } | ||||
| 60668 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60669 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60670 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60671 | aRv.NoteJSContextException(cx); | ||||
| 60672 | return; | ||||
| 60673 | } | ||||
| 60674 | } | ||||
| 60675 | |||||
| 60676 | void | ||||
| 60677 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60678 | { | ||||
| 60679 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60680 | if (aRv.Failed()) { | ||||
| 60681 | return; | ||||
| 60682 | } | ||||
| 60683 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60683); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60683; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60684 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60685 | |||||
| 60686 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60687 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60688 | if (!argv.resize(1)) { | ||||
| 60689 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60690 | // the right thing with that. | ||||
| 60691 | return; | ||||
| 60692 | } | ||||
| 60693 | unsigned argc = 1; | ||||
| 60694 | |||||
| 60695 | do { | ||||
| 60696 | if (arg.WasPassed()) { | ||||
| 60697 | |||||
| 60698 | if (arg.Value().IsNull()) { | ||||
| 60699 | argv[0].setNull(); | ||||
| 60700 | break; | ||||
| 60701 | } | ||||
| 60702 | |||||
| 60703 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60704 | if (!returnObj) { | ||||
| 60705 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60706 | return; | ||||
| 60707 | } | ||||
| 60708 | // Scope for 'tmp' | ||||
| 60709 | { | ||||
| 60710 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60711 | for (auto& entry : arg.Value().Value().Entries()) { | ||||
| 60712 | auto& recordValue0 = entry.mValue; | ||||
| 60713 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60714 | // are different ways to succeed at wrapping the value. | ||||
| 60715 | do { | ||||
| 60716 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 60717 | tmp.set(recordValue0); | ||||
| 60718 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60719 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60720 | return; | ||||
| 60721 | } | ||||
| 60722 | break; | ||||
| 60723 | } while (false); | ||||
| 60724 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60725 | entry.mKey.BeginReading(), | ||||
| 60726 | entry.mKey.Length(), tmp, | ||||
| 60727 | JSPROP_ENUMERATE)) { | ||||
| 60728 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60729 | return; | ||||
| 60730 | } | ||||
| 60731 | } | ||||
| 60732 | } | ||||
| 60733 | argv[0].setObject(*returnObj); | ||||
| 60734 | break; | ||||
| 60735 | } else if (argc == 1) { | ||||
| 60736 | // This is our current trailing argument; reduce argc | ||||
| 60737 | --argc; | ||||
| 60738 | } else { | ||||
| 60739 | argv[0].setUndefined(); | ||||
| 60740 | } | ||||
| 60741 | } while (false); | ||||
| 60742 | |||||
| 60743 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60744 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60745 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60746 | !InitIds(cx, atomsCache)) || | ||||
| 60747 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfAny_id, &callable)) { | ||||
| 60748 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60749 | return; | ||||
| 60750 | } | ||||
| 60751 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60752 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60753 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60754 | aRv.NoteJSContextException(cx); | ||||
| 60755 | return; | ||||
| 60756 | } | ||||
| 60757 | } | ||||
| 60758 | |||||
| 60759 | void | ||||
| 60760 | TestJSImplInterfaceJSImpl::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60761 | { | ||||
| 60762 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60763 | if (aRv.Failed()) { | ||||
| 60764 | return; | ||||
| 60765 | } | ||||
| 60766 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60766); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60766; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60767 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60768 | |||||
| 60769 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60770 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60771 | if (!argv.resize(1)) { | ||||
| 60772 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60773 | // the right thing with that. | ||||
| 60774 | return; | ||||
| 60775 | } | ||||
| 60776 | unsigned argc = 1; | ||||
| 60777 | |||||
| 60778 | do { | ||||
| 60779 | |||||
| 60780 | if (arg.IsNull()) { | ||||
| 60781 | argv[0].setNull(); | ||||
| 60782 | break; | ||||
| 60783 | } | ||||
| 60784 | |||||
| 60785 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60786 | if (!returnObj) { | ||||
| 60787 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60788 | return; | ||||
| 60789 | } | ||||
| 60790 | // Scope for 'tmp' | ||||
| 60791 | { | ||||
| 60792 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60793 | for (auto& entry : arg.Value().Entries()) { | ||||
| 60794 | auto& recordValue0 = entry.mValue; | ||||
| 60795 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60796 | // are different ways to succeed at wrapping the value. | ||||
| 60797 | do { | ||||
| 60798 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 60799 | tmp.set(recordValue0); | ||||
| 60800 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60801 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60802 | return; | ||||
| 60803 | } | ||||
| 60804 | break; | ||||
| 60805 | } while (false); | ||||
| 60806 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60807 | entry.mKey.BeginReading(), | ||||
| 60808 | entry.mKey.Length(), tmp, | ||||
| 60809 | JSPROP_ENUMERATE)) { | ||||
| 60810 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60811 | return; | ||||
| 60812 | } | ||||
| 60813 | } | ||||
| 60814 | } | ||||
| 60815 | argv[0].setObject(*returnObj); | ||||
| 60816 | break; | ||||
| 60817 | } while (false); | ||||
| 60818 | |||||
| 60819 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60820 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60821 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60822 | !InitIds(cx, atomsCache)) || | ||||
| 60823 | !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAnyWithDefaultValue_id, &callable)) { | ||||
| 60824 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60825 | return; | ||||
| 60826 | } | ||||
| 60827 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60828 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60829 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60830 | aRv.NoteJSContextException(cx); | ||||
| 60831 | return; | ||||
| 60832 | } | ||||
| 60833 | } | ||||
| 60834 | |||||
| 60835 | void | ||||
| 60836 | TestJSImplInterfaceJSImpl::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60837 | { | ||||
| 60838 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60839 | if (aRv.Failed()) { | ||||
| 60840 | return; | ||||
| 60841 | } | ||||
| 60842 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60842); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60842; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60843 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60844 | |||||
| 60845 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60846 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60847 | if (!argv.resize(1)) { | ||||
| 60848 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60849 | // the right thing with that. | ||||
| 60850 | return; | ||||
| 60851 | } | ||||
| 60852 | unsigned argc = 1; | ||||
| 60853 | |||||
| 60854 | do { | ||||
| 60855 | |||||
| 60856 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60857 | if (!returnObj) { | ||||
| 60858 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60859 | return; | ||||
| 60860 | } | ||||
| 60861 | // Scope for 'tmp' | ||||
| 60862 | { | ||||
| 60863 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60864 | for (auto& entry : arg.Entries()) { | ||||
| 60865 | auto& recordValue0 = entry.mValue; | ||||
| 60866 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60867 | // are different ways to succeed at wrapping the value. | ||||
| 60868 | do { | ||||
| 60869 | |||||
| 60870 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60871 | if (!returnObj) { | ||||
| 60872 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60873 | return; | ||||
| 60874 | } | ||||
| 60875 | // Scope for 'tmp' | ||||
| 60876 | { | ||||
| 60877 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60878 | for (auto& entry : recordValue0.Entries()) { | ||||
| 60879 | auto& recordValue1 = entry.mValue; | ||||
| 60880 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60881 | // are different ways to succeed at wrapping the value. | ||||
| 60882 | do { | ||||
| 60883 | JS::ExposeValueToActiveJS(recordValue1); | ||||
| 60884 | tmp.set(recordValue1); | ||||
| 60885 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60886 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60887 | return; | ||||
| 60888 | } | ||||
| 60889 | break; | ||||
| 60890 | } while (false); | ||||
| 60891 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60892 | entry.mKey.BeginReading(), | ||||
| 60893 | entry.mKey.Length(), tmp, | ||||
| 60894 | JSPROP_ENUMERATE)) { | ||||
| 60895 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60896 | return; | ||||
| 60897 | } | ||||
| 60898 | } | ||||
| 60899 | } | ||||
| 60900 | tmp.setObject(*returnObj); | ||||
| 60901 | break; | ||||
| 60902 | } while (false); | ||||
| 60903 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60904 | entry.mKey.BeginReading(), | ||||
| 60905 | entry.mKey.Length(), tmp, | ||||
| 60906 | JSPROP_ENUMERATE)) { | ||||
| 60907 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60908 | return; | ||||
| 60909 | } | ||||
| 60910 | } | ||||
| 60911 | } | ||||
| 60912 | argv[0].setObject(*returnObj); | ||||
| 60913 | break; | ||||
| 60914 | } while (false); | ||||
| 60915 | |||||
| 60916 | JS::Rooted<JS::Value> callable(cx); | ||||
| 60917 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 60918 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 60919 | !InitIds(cx, atomsCache)) || | ||||
| 60920 | !GetCallableProperty(cx, atomsCache->passRecordOfRecordOfAny_id, &callable)) { | ||||
| 60921 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60922 | return; | ||||
| 60923 | } | ||||
| 60924 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 60925 | if (!JS::Call(cx, thisValue, callable, | ||||
| 60926 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 60927 | aRv.NoteJSContextException(cx); | ||||
| 60928 | return; | ||||
| 60929 | } | ||||
| 60930 | } | ||||
| 60931 | |||||
| 60932 | void | ||||
| 60933 | TestJSImplInterfaceJSImpl::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 60934 | { | ||||
| 60935 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 60936 | if (aRv.Failed()) { | ||||
| 60937 | return; | ||||
| 60938 | } | ||||
| 60939 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 60939); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 60939; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 60940 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 60941 | |||||
| 60942 | JS::Rooted<JS::Value> rval(cx); | ||||
| 60943 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 60944 | if (!argv.resize(1)) { | ||||
| 60945 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 60946 | // the right thing with that. | ||||
| 60947 | return; | ||||
| 60948 | } | ||||
| 60949 | unsigned argc = 1; | ||||
| 60950 | |||||
| 60951 | do { | ||||
| 60952 | |||||
| 60953 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60954 | if (!returnObj) { | ||||
| 60955 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60956 | return; | ||||
| 60957 | } | ||||
| 60958 | // Scope for 'tmp' | ||||
| 60959 | { | ||||
| 60960 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60961 | for (auto& entry : arg.Entries()) { | ||||
| 60962 | auto& recordValue0 = entry.mValue; | ||||
| 60963 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60964 | // are different ways to succeed at wrapping the value. | ||||
| 60965 | do { | ||||
| 60966 | |||||
| 60967 | if (recordValue0.IsNull()) { | ||||
| 60968 | tmp.setNull(); | ||||
| 60969 | break; | ||||
| 60970 | } | ||||
| 60971 | |||||
| 60972 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 60973 | if (!returnObj) { | ||||
| 60974 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60975 | return; | ||||
| 60976 | } | ||||
| 60977 | // Scope for 'tmp' | ||||
| 60978 | { | ||||
| 60979 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 60980 | for (auto& entry : recordValue0.Value().Entries()) { | ||||
| 60981 | auto& recordValue1 = entry.mValue; | ||||
| 60982 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 60983 | // are different ways to succeed at wrapping the value. | ||||
| 60984 | do { | ||||
| 60985 | JS::ExposeValueToActiveJS(recordValue1); | ||||
| 60986 | tmp.set(recordValue1); | ||||
| 60987 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 60988 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60989 | return; | ||||
| 60990 | } | ||||
| 60991 | break; | ||||
| 60992 | } while (false); | ||||
| 60993 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 60994 | entry.mKey.BeginReading(), | ||||
| 60995 | entry.mKey.Length(), tmp, | ||||
| 60996 | JSPROP_ENUMERATE)) { | ||||
| 60997 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 60998 | return; | ||||
| 60999 | } | ||||
| 61000 | } | ||||
| 61001 | } | ||||
| 61002 | tmp.setObject(*returnObj); | ||||
| 61003 | break; | ||||
| 61004 | } while (false); | ||||
| 61005 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61006 | entry.mKey.BeginReading(), | ||||
| 61007 | entry.mKey.Length(), tmp, | ||||
| 61008 | JSPROP_ENUMERATE)) { | ||||
| 61009 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61010 | return; | ||||
| 61011 | } | ||||
| 61012 | } | ||||
| 61013 | } | ||||
| 61014 | argv[0].setObject(*returnObj); | ||||
| 61015 | break; | ||||
| 61016 | } while (false); | ||||
| 61017 | |||||
| 61018 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61019 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61020 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61021 | !InitIds(cx, atomsCache)) || | ||||
| 61022 | !GetCallableProperty(cx, atomsCache->passRecordOfNullableRecordOfAny_id, &callable)) { | ||||
| 61023 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61024 | return; | ||||
| 61025 | } | ||||
| 61026 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61027 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61028 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61029 | aRv.NoteJSContextException(cx); | ||||
| 61030 | return; | ||||
| 61031 | } | ||||
| 61032 | } | ||||
| 61033 | |||||
| 61034 | void | ||||
| 61035 | TestJSImplInterfaceJSImpl::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61036 | { | ||||
| 61037 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61038 | if (aRv.Failed()) { | ||||
| 61039 | return; | ||||
| 61040 | } | ||||
| 61041 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61041); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61041; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61042 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61043 | |||||
| 61044 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61045 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61046 | if (!argv.resize(1)) { | ||||
| 61047 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61048 | // the right thing with that. | ||||
| 61049 | return; | ||||
| 61050 | } | ||||
| 61051 | unsigned argc = 1; | ||||
| 61052 | |||||
| 61053 | do { | ||||
| 61054 | |||||
| 61055 | if (arg.IsNull()) { | ||||
| 61056 | argv[0].setNull(); | ||||
| 61057 | break; | ||||
| 61058 | } | ||||
| 61059 | |||||
| 61060 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61061 | if (!returnObj) { | ||||
| 61062 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61063 | return; | ||||
| 61064 | } | ||||
| 61065 | // Scope for 'tmp' | ||||
| 61066 | { | ||||
| 61067 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61068 | for (auto& entry : arg.Value().Entries()) { | ||||
| 61069 | auto& recordValue0 = entry.mValue; | ||||
| 61070 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61071 | // are different ways to succeed at wrapping the value. | ||||
| 61072 | do { | ||||
| 61073 | |||||
| 61074 | if (recordValue0.IsNull()) { | ||||
| 61075 | tmp.setNull(); | ||||
| 61076 | break; | ||||
| 61077 | } | ||||
| 61078 | |||||
| 61079 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61080 | if (!returnObj) { | ||||
| 61081 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61082 | return; | ||||
| 61083 | } | ||||
| 61084 | // Scope for 'tmp' | ||||
| 61085 | { | ||||
| 61086 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61087 | for (auto& entry : recordValue0.Value().Entries()) { | ||||
| 61088 | auto& recordValue1 = entry.mValue; | ||||
| 61089 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61090 | // are different ways to succeed at wrapping the value. | ||||
| 61091 | do { | ||||
| 61092 | JS::ExposeValueToActiveJS(recordValue1); | ||||
| 61093 | tmp.set(recordValue1); | ||||
| 61094 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 61095 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61096 | return; | ||||
| 61097 | } | ||||
| 61098 | break; | ||||
| 61099 | } while (false); | ||||
| 61100 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61101 | entry.mKey.BeginReading(), | ||||
| 61102 | entry.mKey.Length(), tmp, | ||||
| 61103 | JSPROP_ENUMERATE)) { | ||||
| 61104 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61105 | return; | ||||
| 61106 | } | ||||
| 61107 | } | ||||
| 61108 | } | ||||
| 61109 | tmp.setObject(*returnObj); | ||||
| 61110 | break; | ||||
| 61111 | } while (false); | ||||
| 61112 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61113 | entry.mKey.BeginReading(), | ||||
| 61114 | entry.mKey.Length(), tmp, | ||||
| 61115 | JSPROP_ENUMERATE)) { | ||||
| 61116 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61117 | return; | ||||
| 61118 | } | ||||
| 61119 | } | ||||
| 61120 | } | ||||
| 61121 | argv[0].setObject(*returnObj); | ||||
| 61122 | break; | ||||
| 61123 | } while (false); | ||||
| 61124 | |||||
| 61125 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61126 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61127 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61128 | !InitIds(cx, atomsCache)) || | ||||
| 61129 | !GetCallableProperty(cx, atomsCache->passNullableRecordOfNullableRecordOfAny_id, &callable)) { | ||||
| 61130 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61131 | return; | ||||
| 61132 | } | ||||
| 61133 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61134 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61135 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61136 | aRv.NoteJSContextException(cx); | ||||
| 61137 | return; | ||||
| 61138 | } | ||||
| 61139 | } | ||||
| 61140 | |||||
| 61141 | void | ||||
| 61142 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61143 | { | ||||
| 61144 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61145 | if (aRv.Failed()) { | ||||
| 61146 | return; | ||||
| 61147 | } | ||||
| 61148 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61148); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61148; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61149 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61150 | |||||
| 61151 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61152 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61153 | if (!argv.resize(1)) { | ||||
| 61154 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61155 | // the right thing with that. | ||||
| 61156 | return; | ||||
| 61157 | } | ||||
| 61158 | unsigned argc = 1; | ||||
| 61159 | |||||
| 61160 | do { | ||||
| 61161 | if (arg.WasPassed()) { | ||||
| 61162 | |||||
| 61163 | if (arg.Value().IsNull()) { | ||||
| 61164 | argv[0].setNull(); | ||||
| 61165 | break; | ||||
| 61166 | } | ||||
| 61167 | |||||
| 61168 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61169 | if (!returnObj) { | ||||
| 61170 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61171 | return; | ||||
| 61172 | } | ||||
| 61173 | // Scope for 'tmp' | ||||
| 61174 | { | ||||
| 61175 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61176 | for (auto& entry : arg.Value().Value().Entries()) { | ||||
| 61177 | auto& recordValue0 = entry.mValue; | ||||
| 61178 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61179 | // are different ways to succeed at wrapping the value. | ||||
| 61180 | do { | ||||
| 61181 | |||||
| 61182 | if (recordValue0.IsNull()) { | ||||
| 61183 | tmp.setNull(); | ||||
| 61184 | break; | ||||
| 61185 | } | ||||
| 61186 | |||||
| 61187 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61188 | if (!returnObj) { | ||||
| 61189 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61190 | return; | ||||
| 61191 | } | ||||
| 61192 | // Scope for 'tmp' | ||||
| 61193 | { | ||||
| 61194 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61195 | for (auto& entry : recordValue0.Value().Entries()) { | ||||
| 61196 | auto& recordValue1 = entry.mValue; | ||||
| 61197 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61198 | // are different ways to succeed at wrapping the value. | ||||
| 61199 | do { | ||||
| 61200 | JS::ExposeValueToActiveJS(recordValue1); | ||||
| 61201 | tmp.set(recordValue1); | ||||
| 61202 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 61203 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61204 | return; | ||||
| 61205 | } | ||||
| 61206 | break; | ||||
| 61207 | } while (false); | ||||
| 61208 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61209 | entry.mKey.BeginReading(), | ||||
| 61210 | entry.mKey.Length(), tmp, | ||||
| 61211 | JSPROP_ENUMERATE)) { | ||||
| 61212 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61213 | return; | ||||
| 61214 | } | ||||
| 61215 | } | ||||
| 61216 | } | ||||
| 61217 | tmp.setObject(*returnObj); | ||||
| 61218 | break; | ||||
| 61219 | } while (false); | ||||
| 61220 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61221 | entry.mKey.BeginReading(), | ||||
| 61222 | entry.mKey.Length(), tmp, | ||||
| 61223 | JSPROP_ENUMERATE)) { | ||||
| 61224 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61225 | return; | ||||
| 61226 | } | ||||
| 61227 | } | ||||
| 61228 | } | ||||
| 61229 | argv[0].setObject(*returnObj); | ||||
| 61230 | break; | ||||
| 61231 | } else if (argc == 1) { | ||||
| 61232 | // This is our current trailing argument; reduce argc | ||||
| 61233 | --argc; | ||||
| 61234 | } else { | ||||
| 61235 | argv[0].setUndefined(); | ||||
| 61236 | } | ||||
| 61237 | } while (false); | ||||
| 61238 | |||||
| 61239 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61240 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61241 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61242 | !InitIds(cx, atomsCache)) || | ||||
| 61243 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id, &callable)) { | ||||
| 61244 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61245 | return; | ||||
| 61246 | } | ||||
| 61247 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61248 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61249 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61250 | aRv.NoteJSContextException(cx); | ||||
| 61251 | return; | ||||
| 61252 | } | ||||
| 61253 | } | ||||
| 61254 | |||||
| 61255 | void | ||||
| 61256 | TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61257 | { | ||||
| 61258 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61259 | if (aRv.Failed()) { | ||||
| 61260 | return; | ||||
| 61261 | } | ||||
| 61262 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61262); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61262; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61263 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61264 | |||||
| 61265 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61266 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61267 | if (!argv.resize(1)) { | ||||
| 61268 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61269 | // the right thing with that. | ||||
| 61270 | return; | ||||
| 61271 | } | ||||
| 61272 | unsigned argc = 1; | ||||
| 61273 | |||||
| 61274 | do { | ||||
| 61275 | if (arg.WasPassed()) { | ||||
| 61276 | |||||
| 61277 | if (arg.Value().IsNull()) { | ||||
| 61278 | argv[0].setNull(); | ||||
| 61279 | break; | ||||
| 61280 | } | ||||
| 61281 | |||||
| 61282 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61283 | if (!returnObj) { | ||||
| 61284 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61285 | return; | ||||
| 61286 | } | ||||
| 61287 | // Scope for 'tmp' | ||||
| 61288 | { | ||||
| 61289 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61290 | for (auto& entry : arg.Value().Value().Entries()) { | ||||
| 61291 | auto& recordValue0 = entry.mValue; | ||||
| 61292 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61293 | // are different ways to succeed at wrapping the value. | ||||
| 61294 | do { | ||||
| 61295 | |||||
| 61296 | if (recordValue0.IsNull()) { | ||||
| 61297 | tmp.setNull(); | ||||
| 61298 | break; | ||||
| 61299 | } | ||||
| 61300 | |||||
| 61301 | uint32_t length = recordValue0.Value().Length(); | ||||
| 61302 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 61303 | if (!returnArray) { | ||||
| 61304 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61305 | return; | ||||
| 61306 | } | ||||
| 61307 | // Scope for 'tmp' | ||||
| 61308 | { | ||||
| 61309 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61310 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 61311 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 61312 | // are different ways to succeed at wrapping the object. | ||||
| 61313 | do { | ||||
| 61314 | JS::ExposeValueToActiveJS(recordValue0.Value()[sequenceIdx0]); | ||||
| 61315 | tmp.set(recordValue0.Value()[sequenceIdx0]); | ||||
| 61316 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 61317 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61318 | return; | ||||
| 61319 | } | ||||
| 61320 | break; | ||||
| 61321 | } while (false); | ||||
| 61322 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 61323 | JSPROP_ENUMERATE)) { | ||||
| 61324 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61325 | return; | ||||
| 61326 | } | ||||
| 61327 | } | ||||
| 61328 | } | ||||
| 61329 | tmp.setObject(*returnArray); | ||||
| 61330 | break; | ||||
| 61331 | } while (false); | ||||
| 61332 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61333 | entry.mKey.BeginReading(), | ||||
| 61334 | entry.mKey.Length(), tmp, | ||||
| 61335 | JSPROP_ENUMERATE)) { | ||||
| 61336 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61337 | return; | ||||
| 61338 | } | ||||
| 61339 | } | ||||
| 61340 | } | ||||
| 61341 | argv[0].setObject(*returnObj); | ||||
| 61342 | break; | ||||
| 61343 | } else if (argc == 1) { | ||||
| 61344 | // This is our current trailing argument; reduce argc | ||||
| 61345 | --argc; | ||||
| 61346 | } else { | ||||
| 61347 | argv[0].setUndefined(); | ||||
| 61348 | } | ||||
| 61349 | } while (false); | ||||
| 61350 | |||||
| 61351 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61352 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61353 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61354 | !InitIds(cx, atomsCache)) || | ||||
| 61355 | !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id, &callable)) { | ||||
| 61356 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61357 | return; | ||||
| 61358 | } | ||||
| 61359 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61360 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61361 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61362 | aRv.NoteJSContextException(cx); | ||||
| 61363 | return; | ||||
| 61364 | } | ||||
| 61365 | } | ||||
| 61366 | |||||
| 61367 | void | ||||
| 61368 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61369 | { | ||||
| 61370 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61371 | if (aRv.Failed()) { | ||||
| 61372 | return; | ||||
| 61373 | } | ||||
| 61374 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61374); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61374; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61375 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61376 | |||||
| 61377 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61378 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61379 | if (!argv.resize(1)) { | ||||
| 61380 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61381 | // the right thing with that. | ||||
| 61382 | return; | ||||
| 61383 | } | ||||
| 61384 | unsigned argc = 1; | ||||
| 61385 | |||||
| 61386 | do { | ||||
| 61387 | if (arg.WasPassed()) { | ||||
| 61388 | |||||
| 61389 | if (arg.Value().IsNull()) { | ||||
| 61390 | argv[0].setNull(); | ||||
| 61391 | break; | ||||
| 61392 | } | ||||
| 61393 | |||||
| 61394 | uint32_t length = arg.Value().Value().Length(); | ||||
| 61395 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 61396 | if (!returnArray) { | ||||
| 61397 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61398 | return; | ||||
| 61399 | } | ||||
| 61400 | // Scope for 'tmp' | ||||
| 61401 | { | ||||
| 61402 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61403 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 61404 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 61405 | // are different ways to succeed at wrapping the object. | ||||
| 61406 | do { | ||||
| 61407 | |||||
| 61408 | if (arg.Value().Value()[sequenceIdx0].IsNull()) { | ||||
| 61409 | tmp.setNull(); | ||||
| 61410 | break; | ||||
| 61411 | } | ||||
| 61412 | |||||
| 61413 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 61414 | if (!returnObj) { | ||||
| 61415 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61416 | return; | ||||
| 61417 | } | ||||
| 61418 | // Scope for 'tmp' | ||||
| 61419 | { | ||||
| 61420 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61421 | for (auto& entry : arg.Value().Value()[sequenceIdx0].Value().Entries()) { | ||||
| 61422 | auto& recordValue0 = entry.mValue; | ||||
| 61423 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 61424 | // are different ways to succeed at wrapping the value. | ||||
| 61425 | do { | ||||
| 61426 | JS::ExposeValueToActiveJS(recordValue0); | ||||
| 61427 | tmp.set(recordValue0); | ||||
| 61428 | if (!MaybeWrapValue(cx, &tmp)) { | ||||
| 61429 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61430 | return; | ||||
| 61431 | } | ||||
| 61432 | break; | ||||
| 61433 | } while (false); | ||||
| 61434 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 61435 | entry.mKey.BeginReading(), | ||||
| 61436 | entry.mKey.Length(), tmp, | ||||
| 61437 | JSPROP_ENUMERATE)) { | ||||
| 61438 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61439 | return; | ||||
| 61440 | } | ||||
| 61441 | } | ||||
| 61442 | } | ||||
| 61443 | tmp.setObject(*returnObj); | ||||
| 61444 | break; | ||||
| 61445 | } while (false); | ||||
| 61446 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 61447 | JSPROP_ENUMERATE)) { | ||||
| 61448 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61449 | return; | ||||
| 61450 | } | ||||
| 61451 | } | ||||
| 61452 | } | ||||
| 61453 | argv[0].setObject(*returnArray); | ||||
| 61454 | break; | ||||
| 61455 | } else if (argc == 1) { | ||||
| 61456 | // This is our current trailing argument; reduce argc | ||||
| 61457 | --argc; | ||||
| 61458 | } else { | ||||
| 61459 | argv[0].setUndefined(); | ||||
| 61460 | } | ||||
| 61461 | } while (false); | ||||
| 61462 | |||||
| 61463 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61464 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61465 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61466 | !InitIds(cx, atomsCache)) || | ||||
| 61467 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id, &callable)) { | ||||
| 61468 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61469 | return; | ||||
| 61470 | } | ||||
| 61471 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61472 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61473 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61474 | aRv.NoteJSContextException(cx); | ||||
| 61475 | return; | ||||
| 61476 | } | ||||
| 61477 | } | ||||
| 61478 | |||||
| 61479 | void | ||||
| 61480 | TestJSImplInterfaceJSImpl::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61481 | { | ||||
| 61482 | CallSetup s(this, aRv, "TestJSImplInterface.receiveAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61483 | if (aRv.Failed()) { | ||||
| 61484 | return; | ||||
| 61485 | } | ||||
| 61486 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61486); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61486; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61487 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61488 | |||||
| 61489 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61490 | |||||
| 61491 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61492 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61493 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61494 | !InitIds(cx, atomsCache)) || | ||||
| 61495 | !GetCallableProperty(cx, atomsCache->receiveAny_id, &callable)) { | ||||
| 61496 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61497 | return; | ||||
| 61498 | } | ||||
| 61499 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61500 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61501 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 61502 | aRv.NoteJSContextException(cx); | ||||
| 61503 | return; | ||||
| 61504 | } | ||||
| 61505 | JS::Rooted<JS::Value> rvalDecl(cx); | ||||
| 61506 | #ifdef __clang__1 | ||||
| 61507 | #pragma clang diagnostic push | ||||
| 61508 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 61509 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 61510 | #endif // __clang__ | ||||
| 61511 | if ((false) && !CallerSubsumes(rval)) { | ||||
| 61512 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveAny"); | ||||
| 61513 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61514 | return; | ||||
| 61515 | } | ||||
| 61516 | #ifdef __clang__1 | ||||
| 61517 | #pragma clang diagnostic pop | ||||
| 61518 | #endif // __clang__ | ||||
| 61519 | rvalDecl = rval; | ||||
| 61520 | aRetVal.set(rvalDecl); | ||||
| 61521 | } | ||||
| 61522 | |||||
| 61523 | void | ||||
| 61524 | TestJSImplInterfaceJSImpl::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61525 | { | ||||
| 61526 | CallSetup s(this, aRv, "TestJSImplInterface.passObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61527 | if (aRv.Failed()) { | ||||
| 61528 | return; | ||||
| 61529 | } | ||||
| 61530 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61530); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61530; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61531 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61532 | |||||
| 61533 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61534 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61535 | if (!argv.resize(1)) { | ||||
| 61536 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61537 | // the right thing with that. | ||||
| 61538 | return; | ||||
| 61539 | } | ||||
| 61540 | unsigned argc = 1; | ||||
| 61541 | |||||
| 61542 | do { | ||||
| 61543 | JS::ExposeObjectToActiveJS(arg); | ||||
| 61544 | argv[0].setObject(*arg); | ||||
| 61545 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 61546 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61547 | return; | ||||
| 61548 | } | ||||
| 61549 | break; | ||||
| 61550 | } while (false); | ||||
| 61551 | |||||
| 61552 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61553 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61554 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61555 | !InitIds(cx, atomsCache)) || | ||||
| 61556 | !GetCallableProperty(cx, atomsCache->passObject_id, &callable)) { | ||||
| 61557 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61558 | return; | ||||
| 61559 | } | ||||
| 61560 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61561 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61562 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61563 | aRv.NoteJSContextException(cx); | ||||
| 61564 | return; | ||||
| 61565 | } | ||||
| 61566 | } | ||||
| 61567 | |||||
| 61568 | void | ||||
| 61569 | TestJSImplInterfaceJSImpl::PassVariadicObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61570 | { | ||||
| 61571 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61572 | if (aRv.Failed()) { | ||||
| 61573 | return; | ||||
| 61574 | } | ||||
| 61575 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61575); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61575; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61576 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61577 | |||||
| 61578 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61579 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61580 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 61581 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61582 | // the right thing with that. | ||||
| 61583 | return; | ||||
| 61584 | } | ||||
| 61585 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 61586 | |||||
| 61587 | do { | ||||
| 61588 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 61589 | JS::ExposeObjectToActiveJS(arg[idx]); | ||||
| 61590 | argv[0 + idx].setObject(*arg[idx]); | ||||
| 61591 | if (!MaybeWrapObjectValue(cx, argv[0 + idx])) { | ||||
| 61592 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61593 | return; | ||||
| 61594 | } | ||||
| 61595 | continue; | ||||
| 61596 | } | ||||
| 61597 | break; | ||||
| 61598 | } while (false); | ||||
| 61599 | |||||
| 61600 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61601 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61602 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61603 | !InitIds(cx, atomsCache)) || | ||||
| 61604 | !GetCallableProperty(cx, atomsCache->passVariadicObject_id, &callable)) { | ||||
| 61605 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61606 | return; | ||||
| 61607 | } | ||||
| 61608 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61609 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61610 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61611 | aRv.NoteJSContextException(cx); | ||||
| 61612 | return; | ||||
| 61613 | } | ||||
| 61614 | } | ||||
| 61615 | |||||
| 61616 | void | ||||
| 61617 | TestJSImplInterfaceJSImpl::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61618 | { | ||||
| 61619 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61620 | if (aRv.Failed()) { | ||||
| 61621 | return; | ||||
| 61622 | } | ||||
| 61623 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61623); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61623; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61624 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61625 | |||||
| 61626 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61627 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61628 | if (!argv.resize(1)) { | ||||
| 61629 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61630 | // the right thing with that. | ||||
| 61631 | return; | ||||
| 61632 | } | ||||
| 61633 | unsigned argc = 1; | ||||
| 61634 | |||||
| 61635 | do { | ||||
| 61636 | if (arg) { | ||||
| 61637 | JS::ExposeObjectToActiveJS(arg); | ||||
| 61638 | } | ||||
| 61639 | argv[0].setObjectOrNull(arg); | ||||
| 61640 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 61641 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61642 | return; | ||||
| 61643 | } | ||||
| 61644 | break; | ||||
| 61645 | } while (false); | ||||
| 61646 | |||||
| 61647 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61648 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61649 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61650 | !InitIds(cx, atomsCache)) || | ||||
| 61651 | !GetCallableProperty(cx, atomsCache->passNullableObject_id, &callable)) { | ||||
| 61652 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61653 | return; | ||||
| 61654 | } | ||||
| 61655 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61656 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61657 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61658 | aRv.NoteJSContextException(cx); | ||||
| 61659 | return; | ||||
| 61660 | } | ||||
| 61661 | } | ||||
| 61662 | |||||
| 61663 | void | ||||
| 61664 | TestJSImplInterfaceJSImpl::PassVariadicNullableObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61665 | { | ||||
| 61666 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61667 | if (aRv.Failed()) { | ||||
| 61668 | return; | ||||
| 61669 | } | ||||
| 61670 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61670); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61670; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61671 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61672 | |||||
| 61673 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61674 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61675 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 61676 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61677 | // the right thing with that. | ||||
| 61678 | return; | ||||
| 61679 | } | ||||
| 61680 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 61681 | |||||
| 61682 | do { | ||||
| 61683 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 61684 | JS::ExposeObjectToActiveJS(arg[idx]); | ||||
| 61685 | argv[0 + idx].setObject(*arg[idx]); | ||||
| 61686 | if (!MaybeWrapObjectValue(cx, argv[0 + idx])) { | ||||
| 61687 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61688 | return; | ||||
| 61689 | } | ||||
| 61690 | continue; | ||||
| 61691 | } | ||||
| 61692 | break; | ||||
| 61693 | } while (false); | ||||
| 61694 | |||||
| 61695 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61696 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61697 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61698 | !InitIds(cx, atomsCache)) || | ||||
| 61699 | !GetCallableProperty(cx, atomsCache->passVariadicNullableObject_id, &callable)) { | ||||
| 61700 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61701 | return; | ||||
| 61702 | } | ||||
| 61703 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61704 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61705 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61706 | aRv.NoteJSContextException(cx); | ||||
| 61707 | return; | ||||
| 61708 | } | ||||
| 61709 | } | ||||
| 61710 | |||||
| 61711 | void | ||||
| 61712 | TestJSImplInterfaceJSImpl::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61713 | { | ||||
| 61714 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61715 | if (aRv.Failed()) { | ||||
| 61716 | return; | ||||
| 61717 | } | ||||
| 61718 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61718); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61718; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61719 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61720 | |||||
| 61721 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61722 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61723 | if (!argv.resize(1)) { | ||||
| 61724 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61725 | // the right thing with that. | ||||
| 61726 | return; | ||||
| 61727 | } | ||||
| 61728 | unsigned argc = 1; | ||||
| 61729 | |||||
| 61730 | do { | ||||
| 61731 | if (arg.WasPassed()) { | ||||
| 61732 | JS::ExposeObjectToActiveJS(arg.Value()); | ||||
| 61733 | argv[0].setObject(*arg.Value()); | ||||
| 61734 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 61735 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61736 | return; | ||||
| 61737 | } | ||||
| 61738 | break; | ||||
| 61739 | } else if (argc == 1) { | ||||
| 61740 | // This is our current trailing argument; reduce argc | ||||
| 61741 | --argc; | ||||
| 61742 | } else { | ||||
| 61743 | argv[0].setUndefined(); | ||||
| 61744 | } | ||||
| 61745 | } while (false); | ||||
| 61746 | |||||
| 61747 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61748 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61749 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61750 | !InitIds(cx, atomsCache)) || | ||||
| 61751 | !GetCallableProperty(cx, atomsCache->passOptionalObject_id, &callable)) { | ||||
| 61752 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61753 | return; | ||||
| 61754 | } | ||||
| 61755 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61756 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61757 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61758 | aRv.NoteJSContextException(cx); | ||||
| 61759 | return; | ||||
| 61760 | } | ||||
| 61761 | } | ||||
| 61762 | |||||
| 61763 | void | ||||
| 61764 | TestJSImplInterfaceJSImpl::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61765 | { | ||||
| 61766 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61767 | if (aRv.Failed()) { | ||||
| 61768 | return; | ||||
| 61769 | } | ||||
| 61770 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61770); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61770; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61771 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61772 | |||||
| 61773 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61774 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61775 | if (!argv.resize(1)) { | ||||
| 61776 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61777 | // the right thing with that. | ||||
| 61778 | return; | ||||
| 61779 | } | ||||
| 61780 | unsigned argc = 1; | ||||
| 61781 | |||||
| 61782 | do { | ||||
| 61783 | if (arg.WasPassed()) { | ||||
| 61784 | if (arg.Value()) { | ||||
| 61785 | JS::ExposeObjectToActiveJS(arg.Value()); | ||||
| 61786 | } | ||||
| 61787 | argv[0].setObjectOrNull(arg.Value()); | ||||
| 61788 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 61789 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61790 | return; | ||||
| 61791 | } | ||||
| 61792 | break; | ||||
| 61793 | } else if (argc == 1) { | ||||
| 61794 | // This is our current trailing argument; reduce argc | ||||
| 61795 | --argc; | ||||
| 61796 | } else { | ||||
| 61797 | argv[0].setUndefined(); | ||||
| 61798 | } | ||||
| 61799 | } while (false); | ||||
| 61800 | |||||
| 61801 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61802 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61803 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61804 | !InitIds(cx, atomsCache)) || | ||||
| 61805 | !GetCallableProperty(cx, atomsCache->passOptionalNullableObject_id, &callable)) { | ||||
| 61806 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61807 | return; | ||||
| 61808 | } | ||||
| 61809 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61810 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61811 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61812 | aRv.NoteJSContextException(cx); | ||||
| 61813 | return; | ||||
| 61814 | } | ||||
| 61815 | } | ||||
| 61816 | |||||
| 61817 | void | ||||
| 61818 | TestJSImplInterfaceJSImpl::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61819 | { | ||||
| 61820 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61821 | if (aRv.Failed()) { | ||||
| 61822 | return; | ||||
| 61823 | } | ||||
| 61824 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61824); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61824; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61825 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61826 | |||||
| 61827 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61828 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61829 | if (!argv.resize(1)) { | ||||
| 61830 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61831 | // the right thing with that. | ||||
| 61832 | return; | ||||
| 61833 | } | ||||
| 61834 | unsigned argc = 1; | ||||
| 61835 | |||||
| 61836 | do { | ||||
| 61837 | if (arg) { | ||||
| 61838 | JS::ExposeObjectToActiveJS(arg); | ||||
| 61839 | } | ||||
| 61840 | argv[0].setObjectOrNull(arg); | ||||
| 61841 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 61842 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61843 | return; | ||||
| 61844 | } | ||||
| 61845 | break; | ||||
| 61846 | } while (false); | ||||
| 61847 | |||||
| 61848 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61849 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61850 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61851 | !InitIds(cx, atomsCache)) || | ||||
| 61852 | !GetCallableProperty(cx, atomsCache->passOptionalNullableObjectWithDefaultValue_id, &callable)) { | ||||
| 61853 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61854 | return; | ||||
| 61855 | } | ||||
| 61856 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61857 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61858 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61859 | aRv.NoteJSContextException(cx); | ||||
| 61860 | return; | ||||
| 61861 | } | ||||
| 61862 | } | ||||
| 61863 | |||||
| 61864 | void | ||||
| 61865 | TestJSImplInterfaceJSImpl::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61866 | { | ||||
| 61867 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61868 | if (aRv.Failed()) { | ||||
| 61869 | return; | ||||
| 61870 | } | ||||
| 61871 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61871); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61871; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61872 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61873 | |||||
| 61874 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61875 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61876 | if (!argv.resize(1)) { | ||||
| 61877 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61878 | // the right thing with that. | ||||
| 61879 | return; | ||||
| 61880 | } | ||||
| 61881 | unsigned argc = 1; | ||||
| 61882 | |||||
| 61883 | do { | ||||
| 61884 | |||||
| 61885 | uint32_t length = arg.Length(); | ||||
| 61886 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 61887 | if (!returnArray) { | ||||
| 61888 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61889 | return; | ||||
| 61890 | } | ||||
| 61891 | // Scope for 'tmp' | ||||
| 61892 | { | ||||
| 61893 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61894 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 61895 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 61896 | // are different ways to succeed at wrapping the object. | ||||
| 61897 | do { | ||||
| 61898 | JS::ExposeObjectToActiveJS(arg[sequenceIdx0]); | ||||
| 61899 | tmp.setObject(*arg[sequenceIdx0]); | ||||
| 61900 | if (!MaybeWrapObjectValue(cx, &tmp)) { | ||||
| 61901 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61902 | return; | ||||
| 61903 | } | ||||
| 61904 | break; | ||||
| 61905 | } while (false); | ||||
| 61906 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 61907 | JSPROP_ENUMERATE)) { | ||||
| 61908 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61909 | return; | ||||
| 61910 | } | ||||
| 61911 | } | ||||
| 61912 | } | ||||
| 61913 | argv[0].setObject(*returnArray); | ||||
| 61914 | break; | ||||
| 61915 | } while (false); | ||||
| 61916 | |||||
| 61917 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61918 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61919 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61920 | !InitIds(cx, atomsCache)) || | ||||
| 61921 | !GetCallableProperty(cx, atomsCache->passSequenceOfObject_id, &callable)) { | ||||
| 61922 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61923 | return; | ||||
| 61924 | } | ||||
| 61925 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61926 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61927 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61928 | aRv.NoteJSContextException(cx); | ||||
| 61929 | return; | ||||
| 61930 | } | ||||
| 61931 | } | ||||
| 61932 | |||||
| 61933 | void | ||||
| 61934 | TestJSImplInterfaceJSImpl::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 61935 | { | ||||
| 61936 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 61937 | if (aRv.Failed()) { | ||||
| 61938 | return; | ||||
| 61939 | } | ||||
| 61940 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 61940); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 61940; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 61941 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 61942 | |||||
| 61943 | JS::Rooted<JS::Value> rval(cx); | ||||
| 61944 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 61945 | if (!argv.resize(1)) { | ||||
| 61946 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 61947 | // the right thing with that. | ||||
| 61948 | return; | ||||
| 61949 | } | ||||
| 61950 | unsigned argc = 1; | ||||
| 61951 | |||||
| 61952 | do { | ||||
| 61953 | |||||
| 61954 | uint32_t length = arg.Length(); | ||||
| 61955 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 61956 | if (!returnArray) { | ||||
| 61957 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61958 | return; | ||||
| 61959 | } | ||||
| 61960 | // Scope for 'tmp' | ||||
| 61961 | { | ||||
| 61962 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 61963 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 61964 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 61965 | // are different ways to succeed at wrapping the object. | ||||
| 61966 | do { | ||||
| 61967 | if (arg[sequenceIdx0]) { | ||||
| 61968 | JS::ExposeObjectToActiveJS(arg[sequenceIdx0]); | ||||
| 61969 | } | ||||
| 61970 | tmp.setObjectOrNull(arg[sequenceIdx0]); | ||||
| 61971 | if (!MaybeWrapObjectOrNullValue(cx, &tmp)) { | ||||
| 61972 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61973 | return; | ||||
| 61974 | } | ||||
| 61975 | break; | ||||
| 61976 | } while (false); | ||||
| 61977 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 61978 | JSPROP_ENUMERATE)) { | ||||
| 61979 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61980 | return; | ||||
| 61981 | } | ||||
| 61982 | } | ||||
| 61983 | } | ||||
| 61984 | argv[0].setObject(*returnArray); | ||||
| 61985 | break; | ||||
| 61986 | } while (false); | ||||
| 61987 | |||||
| 61988 | JS::Rooted<JS::Value> callable(cx); | ||||
| 61989 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 61990 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 61991 | !InitIds(cx, atomsCache)) || | ||||
| 61992 | !GetCallableProperty(cx, atomsCache->passSequenceOfNullableObject_id, &callable)) { | ||||
| 61993 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 61994 | return; | ||||
| 61995 | } | ||||
| 61996 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 61997 | if (!JS::Call(cx, thisValue, callable, | ||||
| 61998 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 61999 | aRv.NoteJSContextException(cx); | ||||
| 62000 | return; | ||||
| 62001 | } | ||||
| 62002 | } | ||||
| 62003 | |||||
| 62004 | void | ||||
| 62005 | TestJSImplInterfaceJSImpl::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62006 | { | ||||
| 62007 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62008 | if (aRv.Failed()) { | ||||
| 62009 | return; | ||||
| 62010 | } | ||||
| 62011 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62011); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62011; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62012 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62013 | |||||
| 62014 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62015 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62016 | if (!argv.resize(1)) { | ||||
| 62017 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62018 | // the right thing with that. | ||||
| 62019 | return; | ||||
| 62020 | } | ||||
| 62021 | unsigned argc = 1; | ||||
| 62022 | |||||
| 62023 | do { | ||||
| 62024 | |||||
| 62025 | if (arg.IsNull()) { | ||||
| 62026 | argv[0].setNull(); | ||||
| 62027 | break; | ||||
| 62028 | } | ||||
| 62029 | |||||
| 62030 | uint32_t length = arg.Value().Length(); | ||||
| 62031 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 62032 | if (!returnArray) { | ||||
| 62033 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62034 | return; | ||||
| 62035 | } | ||||
| 62036 | // Scope for 'tmp' | ||||
| 62037 | { | ||||
| 62038 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62039 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 62040 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 62041 | // are different ways to succeed at wrapping the object. | ||||
| 62042 | do { | ||||
| 62043 | JS::ExposeObjectToActiveJS(arg.Value()[sequenceIdx0]); | ||||
| 62044 | tmp.setObject(*arg.Value()[sequenceIdx0]); | ||||
| 62045 | if (!MaybeWrapObjectValue(cx, &tmp)) { | ||||
| 62046 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62047 | return; | ||||
| 62048 | } | ||||
| 62049 | break; | ||||
| 62050 | } while (false); | ||||
| 62051 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 62052 | JSPROP_ENUMERATE)) { | ||||
| 62053 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62054 | return; | ||||
| 62055 | } | ||||
| 62056 | } | ||||
| 62057 | } | ||||
| 62058 | argv[0].setObject(*returnArray); | ||||
| 62059 | break; | ||||
| 62060 | } while (false); | ||||
| 62061 | |||||
| 62062 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62063 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62064 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62065 | !InitIds(cx, atomsCache)) || | ||||
| 62066 | !GetCallableProperty(cx, atomsCache->passNullableSequenceOfObject_id, &callable)) { | ||||
| 62067 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62068 | return; | ||||
| 62069 | } | ||||
| 62070 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62071 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62072 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62073 | aRv.NoteJSContextException(cx); | ||||
| 62074 | return; | ||||
| 62075 | } | ||||
| 62076 | } | ||||
| 62077 | |||||
| 62078 | void | ||||
| 62079 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62080 | { | ||||
| 62081 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62082 | if (aRv.Failed()) { | ||||
| 62083 | return; | ||||
| 62084 | } | ||||
| 62085 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62085); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62085; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62086 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62087 | |||||
| 62088 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62089 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62090 | if (!argv.resize(1)) { | ||||
| 62091 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62092 | // the right thing with that. | ||||
| 62093 | return; | ||||
| 62094 | } | ||||
| 62095 | unsigned argc = 1; | ||||
| 62096 | |||||
| 62097 | do { | ||||
| 62098 | if (arg.WasPassed()) { | ||||
| 62099 | |||||
| 62100 | if (arg.Value().IsNull()) { | ||||
| 62101 | argv[0].setNull(); | ||||
| 62102 | break; | ||||
| 62103 | } | ||||
| 62104 | |||||
| 62105 | uint32_t length = arg.Value().Value().Length(); | ||||
| 62106 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 62107 | if (!returnArray) { | ||||
| 62108 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62109 | return; | ||||
| 62110 | } | ||||
| 62111 | // Scope for 'tmp' | ||||
| 62112 | { | ||||
| 62113 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62114 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 62115 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 62116 | // are different ways to succeed at wrapping the object. | ||||
| 62117 | do { | ||||
| 62118 | |||||
| 62119 | if (arg.Value().Value()[sequenceIdx0].IsNull()) { | ||||
| 62120 | tmp.setNull(); | ||||
| 62121 | break; | ||||
| 62122 | } | ||||
| 62123 | |||||
| 62124 | uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length(); | ||||
| 62125 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 62126 | if (!returnArray) { | ||||
| 62127 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62128 | return; | ||||
| 62129 | } | ||||
| 62130 | // Scope for 'tmp' | ||||
| 62131 | { | ||||
| 62132 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62133 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 62134 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 62135 | // are different ways to succeed at wrapping the object. | ||||
| 62136 | do { | ||||
| 62137 | JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 62138 | tmp.setObject(*arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 62139 | if (!MaybeWrapObjectValue(cx, &tmp)) { | ||||
| 62140 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62141 | return; | ||||
| 62142 | } | ||||
| 62143 | break; | ||||
| 62144 | } while (false); | ||||
| 62145 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 62146 | JSPROP_ENUMERATE)) { | ||||
| 62147 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62148 | return; | ||||
| 62149 | } | ||||
| 62150 | } | ||||
| 62151 | } | ||||
| 62152 | tmp.setObject(*returnArray); | ||||
| 62153 | break; | ||||
| 62154 | } while (false); | ||||
| 62155 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 62156 | JSPROP_ENUMERATE)) { | ||||
| 62157 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62158 | return; | ||||
| 62159 | } | ||||
| 62160 | } | ||||
| 62161 | } | ||||
| 62162 | argv[0].setObject(*returnArray); | ||||
| 62163 | break; | ||||
| 62164 | } else if (argc == 1) { | ||||
| 62165 | // This is our current trailing argument; reduce argc | ||||
| 62166 | --argc; | ||||
| 62167 | } else { | ||||
| 62168 | argv[0].setUndefined(); | ||||
| 62169 | } | ||||
| 62170 | } while (false); | ||||
| 62171 | |||||
| 62172 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62173 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62174 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62175 | !InitIds(cx, atomsCache)) || | ||||
| 62176 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id, &callable)) { | ||||
| 62177 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62178 | return; | ||||
| 62179 | } | ||||
| 62180 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62181 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62182 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62183 | aRv.NoteJSContextException(cx); | ||||
| 62184 | return; | ||||
| 62185 | } | ||||
| 62186 | } | ||||
| 62187 | |||||
| 62188 | void | ||||
| 62189 | TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62190 | { | ||||
| 62191 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62192 | if (aRv.Failed()) { | ||||
| 62193 | return; | ||||
| 62194 | } | ||||
| 62195 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62195); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62195; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62196 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62197 | |||||
| 62198 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62199 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62200 | if (!argv.resize(1)) { | ||||
| 62201 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62202 | // the right thing with that. | ||||
| 62203 | return; | ||||
| 62204 | } | ||||
| 62205 | unsigned argc = 1; | ||||
| 62206 | |||||
| 62207 | do { | ||||
| 62208 | if (arg.WasPassed()) { | ||||
| 62209 | |||||
| 62210 | if (arg.Value().IsNull()) { | ||||
| 62211 | argv[0].setNull(); | ||||
| 62212 | break; | ||||
| 62213 | } | ||||
| 62214 | |||||
| 62215 | uint32_t length = arg.Value().Value().Length(); | ||||
| 62216 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 62217 | if (!returnArray) { | ||||
| 62218 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62219 | return; | ||||
| 62220 | } | ||||
| 62221 | // Scope for 'tmp' | ||||
| 62222 | { | ||||
| 62223 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62224 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 62225 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 62226 | // are different ways to succeed at wrapping the object. | ||||
| 62227 | do { | ||||
| 62228 | |||||
| 62229 | if (arg.Value().Value()[sequenceIdx0].IsNull()) { | ||||
| 62230 | tmp.setNull(); | ||||
| 62231 | break; | ||||
| 62232 | } | ||||
| 62233 | |||||
| 62234 | uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length(); | ||||
| 62235 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 62236 | if (!returnArray) { | ||||
| 62237 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62238 | return; | ||||
| 62239 | } | ||||
| 62240 | // Scope for 'tmp' | ||||
| 62241 | { | ||||
| 62242 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62243 | for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) { | ||||
| 62244 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 62245 | // are different ways to succeed at wrapping the object. | ||||
| 62246 | do { | ||||
| 62247 | if (arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]) { | ||||
| 62248 | JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 62249 | } | ||||
| 62250 | tmp.setObjectOrNull(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]); | ||||
| 62251 | if (!MaybeWrapObjectOrNullValue(cx, &tmp)) { | ||||
| 62252 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62253 | return; | ||||
| 62254 | } | ||||
| 62255 | break; | ||||
| 62256 | } while (false); | ||||
| 62257 | if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp, | ||||
| 62258 | JSPROP_ENUMERATE)) { | ||||
| 62259 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62260 | return; | ||||
| 62261 | } | ||||
| 62262 | } | ||||
| 62263 | } | ||||
| 62264 | tmp.setObject(*returnArray); | ||||
| 62265 | break; | ||||
| 62266 | } while (false); | ||||
| 62267 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 62268 | JSPROP_ENUMERATE)) { | ||||
| 62269 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62270 | return; | ||||
| 62271 | } | ||||
| 62272 | } | ||||
| 62273 | } | ||||
| 62274 | argv[0].setObject(*returnArray); | ||||
| 62275 | break; | ||||
| 62276 | } else if (argc == 1) { | ||||
| 62277 | // This is our current trailing argument; reduce argc | ||||
| 62278 | --argc; | ||||
| 62279 | } else { | ||||
| 62280 | argv[0].setUndefined(); | ||||
| 62281 | } | ||||
| 62282 | } while (false); | ||||
| 62283 | |||||
| 62284 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62285 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62286 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62287 | !InitIds(cx, atomsCache)) || | ||||
| 62288 | !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id, &callable)) { | ||||
| 62289 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62290 | return; | ||||
| 62291 | } | ||||
| 62292 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62293 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62294 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62295 | aRv.NoteJSContextException(cx); | ||||
| 62296 | return; | ||||
| 62297 | } | ||||
| 62298 | } | ||||
| 62299 | |||||
| 62300 | void | ||||
| 62301 | TestJSImplInterfaceJSImpl::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62302 | { | ||||
| 62303 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62304 | if (aRv.Failed()) { | ||||
| 62305 | return; | ||||
| 62306 | } | ||||
| 62307 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62307); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62307; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62308 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62309 | |||||
| 62310 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62311 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62312 | if (!argv.resize(1)) { | ||||
| 62313 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62314 | // the right thing with that. | ||||
| 62315 | return; | ||||
| 62316 | } | ||||
| 62317 | unsigned argc = 1; | ||||
| 62318 | |||||
| 62319 | do { | ||||
| 62320 | |||||
| 62321 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 62322 | if (!returnObj) { | ||||
| 62323 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62324 | return; | ||||
| 62325 | } | ||||
| 62326 | // Scope for 'tmp' | ||||
| 62327 | { | ||||
| 62328 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 62329 | for (auto& entry : arg.Entries()) { | ||||
| 62330 | auto& recordValue0 = entry.mValue; | ||||
| 62331 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 62332 | // are different ways to succeed at wrapping the value. | ||||
| 62333 | do { | ||||
| 62334 | JS::ExposeObjectToActiveJS(recordValue0); | ||||
| 62335 | tmp.setObject(*recordValue0); | ||||
| 62336 | if (!MaybeWrapObjectValue(cx, &tmp)) { | ||||
| 62337 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62338 | return; | ||||
| 62339 | } | ||||
| 62340 | break; | ||||
| 62341 | } while (false); | ||||
| 62342 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 62343 | entry.mKey.BeginReading(), | ||||
| 62344 | entry.mKey.Length(), tmp, | ||||
| 62345 | JSPROP_ENUMERATE)) { | ||||
| 62346 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62347 | return; | ||||
| 62348 | } | ||||
| 62349 | } | ||||
| 62350 | } | ||||
| 62351 | argv[0].setObject(*returnObj); | ||||
| 62352 | break; | ||||
| 62353 | } while (false); | ||||
| 62354 | |||||
| 62355 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62356 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62357 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62358 | !InitIds(cx, atomsCache)) || | ||||
| 62359 | !GetCallableProperty(cx, atomsCache->passRecordOfObject_id, &callable)) { | ||||
| 62360 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62361 | return; | ||||
| 62362 | } | ||||
| 62363 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62364 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62365 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62366 | aRv.NoteJSContextException(cx); | ||||
| 62367 | return; | ||||
| 62368 | } | ||||
| 62369 | } | ||||
| 62370 | |||||
| 62371 | void | ||||
| 62372 | TestJSImplInterfaceJSImpl::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62373 | { | ||||
| 62374 | CallSetup s(this, aRv, "TestJSImplInterface.receiveObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62375 | if (aRv.Failed()) { | ||||
| 62376 | return; | ||||
| 62377 | } | ||||
| 62378 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62378; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62379 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62380 | |||||
| 62381 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62382 | |||||
| 62383 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62384 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62385 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62386 | !InitIds(cx, atomsCache)) || | ||||
| 62387 | !GetCallableProperty(cx, atomsCache->receiveObject_id, &callable)) { | ||||
| 62388 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62389 | return; | ||||
| 62390 | } | ||||
| 62391 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62392 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62393 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 62394 | aRv.NoteJSContextException(cx); | ||||
| 62395 | return; | ||||
| 62396 | } | ||||
| 62397 | JS::Rooted<JSObject*> rvalDecl(cx); | ||||
| 62398 | if (rval.isObject()) { | ||||
| 62399 | #ifdef __clang__1 | ||||
| 62400 | #pragma clang diagnostic push | ||||
| 62401 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 62402 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 62403 | #endif // __clang__ | ||||
| 62404 | if ((false) && !CallerSubsumes(rval)) { | ||||
| 62405 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveObject"); | ||||
| 62406 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62407 | return; | ||||
| 62408 | } | ||||
| 62409 | #ifdef __clang__1 | ||||
| 62410 | #pragma clang diagnostic pop | ||||
| 62411 | #endif // __clang__ | ||||
| 62412 | rvalDecl = &rval.toObject(); | ||||
| 62413 | } else { | ||||
| 62414 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveObject"); | ||||
| 62415 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62416 | return; | ||||
| 62417 | } | ||||
| 62418 | aRetVal.set(rvalDecl); | ||||
| 62419 | } | ||||
| 62420 | |||||
| 62421 | void | ||||
| 62422 | TestJSImplInterfaceJSImpl::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62423 | { | ||||
| 62424 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62425 | if (aRv.Failed()) { | ||||
| 62426 | return; | ||||
| 62427 | } | ||||
| 62428 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62428); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62428; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62429 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62430 | |||||
| 62431 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62432 | |||||
| 62433 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62434 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62435 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62436 | !InitIds(cx, atomsCache)) || | ||||
| 62437 | !GetCallableProperty(cx, atomsCache->receiveNullableObject_id, &callable)) { | ||||
| 62438 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62439 | return; | ||||
| 62440 | } | ||||
| 62441 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62442 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62443 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 62444 | aRv.NoteJSContextException(cx); | ||||
| 62445 | return; | ||||
| 62446 | } | ||||
| 62447 | JS::Rooted<JSObject*> rvalDecl(cx); | ||||
| 62448 | if (rval.isObject()) { | ||||
| 62449 | #ifdef __clang__1 | ||||
| 62450 | #pragma clang diagnostic push | ||||
| 62451 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 62452 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 62453 | #endif // __clang__ | ||||
| 62454 | if ((false) && !CallerSubsumes(rval)) { | ||||
| 62455 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveNullableObject"); | ||||
| 62456 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62457 | return; | ||||
| 62458 | } | ||||
| 62459 | #ifdef __clang__1 | ||||
| 62460 | #pragma clang diagnostic pop | ||||
| 62461 | #endif // __clang__ | ||||
| 62462 | rvalDecl = &rval.toObject(); | ||||
| 62463 | } else if (rval.isNullOrUndefined()) { | ||||
| 62464 | rvalDecl = nullptr; | ||||
| 62465 | } else { | ||||
| 62466 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableObject"); | ||||
| 62467 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62468 | return; | ||||
| 62469 | } | ||||
| 62470 | aRetVal.set(rvalDecl); | ||||
| 62471 | } | ||||
| 62472 | |||||
| 62473 | void | ||||
| 62474 | TestJSImplInterfaceJSImpl::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62475 | { | ||||
| 62476 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62477 | if (aRv.Failed()) { | ||||
| 62478 | return; | ||||
| 62479 | } | ||||
| 62480 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62480); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62480; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62481 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62482 | |||||
| 62483 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62484 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62485 | if (!argv.resize(1)) { | ||||
| 62486 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62487 | // the right thing with that. | ||||
| 62488 | return; | ||||
| 62489 | } | ||||
| 62490 | unsigned argc = 1; | ||||
| 62491 | |||||
| 62492 | do { | ||||
| 62493 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 62494 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 62495 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62496 | return; | ||||
| 62497 | } | ||||
| 62498 | break; | ||||
| 62499 | } while (false); | ||||
| 62500 | |||||
| 62501 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62502 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62503 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62504 | !InitIds(cx, atomsCache)) || | ||||
| 62505 | !GetCallableProperty(cx, atomsCache->passUnion_id, &callable)) { | ||||
| 62506 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62507 | return; | ||||
| 62508 | } | ||||
| 62509 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62510 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62511 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62512 | aRv.NoteJSContextException(cx); | ||||
| 62513 | return; | ||||
| 62514 | } | ||||
| 62515 | } | ||||
| 62516 | |||||
| 62517 | void | ||||
| 62518 | TestJSImplInterfaceJSImpl::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62519 | { | ||||
| 62520 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62521 | if (aRv.Failed()) { | ||||
| 62522 | return; | ||||
| 62523 | } | ||||
| 62524 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62524); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62524; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62525 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62526 | |||||
| 62527 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62528 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62529 | if (!argv.resize(1)) { | ||||
| 62530 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62531 | // the right thing with that. | ||||
| 62532 | return; | ||||
| 62533 | } | ||||
| 62534 | unsigned argc = 1; | ||||
| 62535 | |||||
| 62536 | do { | ||||
| 62537 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 62538 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 62539 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62540 | return; | ||||
| 62541 | } | ||||
| 62542 | break; | ||||
| 62543 | } while (false); | ||||
| 62544 | |||||
| 62545 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62546 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62547 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62548 | !InitIds(cx, atomsCache)) || | ||||
| 62549 | !GetCallableProperty(cx, atomsCache->passUnion2_id, &callable)) { | ||||
| 62550 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62551 | return; | ||||
| 62552 | } | ||||
| 62553 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62554 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62555 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62556 | aRv.NoteJSContextException(cx); | ||||
| 62557 | return; | ||||
| 62558 | } | ||||
| 62559 | } | ||||
| 62560 | |||||
| 62561 | void | ||||
| 62562 | TestJSImplInterfaceJSImpl::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62563 | { | ||||
| 62564 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 62565 | if (aRv.Failed()) { | ||||
| 62566 | return; | ||||
| 62567 | } | ||||
| 62568 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 62568); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 62568; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 62569 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 62570 | |||||
| 62571 | JS::Rooted<JS::Value> rval(cx); | ||||
| 62572 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 62573 | if (!argv.resize(1)) { | ||||
| 62574 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 62575 | // the right thing with that. | ||||
| 62576 | return; | ||||
| 62577 | } | ||||
| 62578 | unsigned argc = 1; | ||||
| 62579 | |||||
| 62580 | do { | ||||
| 62581 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 62582 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 62583 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62584 | return; | ||||
| 62585 | } | ||||
| 62586 | break; | ||||
| 62587 | } while (false); | ||||
| 62588 | |||||
| 62589 | JS::Rooted<JS::Value> callable(cx); | ||||
| 62590 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 62591 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 62592 | !InitIds(cx, atomsCache)) || | ||||
| 62593 | !GetCallableProperty(cx, atomsCache->passUnion3_id, &callable)) { | ||||
| 62594 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 62595 | return; | ||||
| 62596 | } | ||||
| 62597 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 62598 | if (!JS::Call(cx, thisValue, callable, | ||||
| 62599 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 62600 | aRv.NoteJSContextException(cx); | ||||
| 62601 | return; | ||||
| 62602 | } | ||||
| 62603 | } | ||||
| 62604 | |||||
| 62605 | void | ||||
| 62606 | TestJSImplInterfaceJSImpl::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62607 | { | ||||
| 62608 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion4", 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 { *((volatile int *)__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->passUnion4_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 | |||||
| 62649 | void | ||||
| 62650 | TestJSImplInterfaceJSImpl::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62651 | { | ||||
| 62652 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion5", 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 { *((volatile int *)__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->passUnion5_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 | |||||
| 62693 | void | ||||
| 62694 | TestJSImplInterfaceJSImpl::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62695 | { | ||||
| 62696 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion6", 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 { *((volatile int *)__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->passUnion6_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 | |||||
| 62737 | void | ||||
| 62738 | TestJSImplInterfaceJSImpl::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62739 | { | ||||
| 62740 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion7", 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 { *((volatile int *)__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->passUnion7_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 | |||||
| 62781 | void | ||||
| 62782 | TestJSImplInterfaceJSImpl::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62783 | { | ||||
| 62784 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion8", 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 { *((volatile int *)__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->passUnion8_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 | |||||
| 62825 | void | ||||
| 62826 | TestJSImplInterfaceJSImpl::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62827 | { | ||||
| 62828 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion9", 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 { *((volatile int *)__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->passUnion9_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 | |||||
| 62869 | void | ||||
| 62870 | TestJSImplInterfaceJSImpl::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62871 | { | ||||
| 62872 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion10", 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 { *((volatile int *)__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->passUnion10_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 | |||||
| 62913 | void | ||||
| 62914 | TestJSImplInterfaceJSImpl::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62915 | { | ||||
| 62916 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion11", 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 { *((volatile int *)__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->passUnion11_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 | |||||
| 62957 | void | ||||
| 62958 | TestJSImplInterfaceJSImpl::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 62959 | { | ||||
| 62960 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion12", 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 { *((volatile int *)__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->passUnion12_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 | |||||
| 63001 | void | ||||
| 63002 | TestJSImplInterfaceJSImpl::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63003 | { | ||||
| 63004 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion13", 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 { *((volatile int *)__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->passUnion13_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 | |||||
| 63045 | void | ||||
| 63046 | TestJSImplInterfaceJSImpl::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63047 | { | ||||
| 63048 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion14", 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 { *((volatile int *)__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->passUnion14_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 | |||||
| 63089 | void | ||||
| 63090 | TestJSImplInterfaceJSImpl::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63091 | { | ||||
| 63092 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion15", 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 { *((volatile int *)__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->passUnion15_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 | |||||
| 63133 | void | ||||
| 63134 | TestJSImplInterfaceJSImpl::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63135 | { | ||||
| 63136 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion16", 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 { *((volatile int *)__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 | if (arg.WasPassed()) { | ||||
| 63154 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63155 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63156 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63157 | return; | ||||
| 63158 | } | ||||
| 63159 | break; | ||||
| 63160 | } else if (argc == 1) { | ||||
| 63161 | // This is our current trailing argument; reduce argc | ||||
| 63162 | --argc; | ||||
| 63163 | } else { | ||||
| 63164 | argv[0].setUndefined(); | ||||
| 63165 | } | ||||
| 63166 | } while (false); | ||||
| 63167 | |||||
| 63168 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63169 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63170 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63171 | !InitIds(cx, atomsCache)) || | ||||
| 63172 | !GetCallableProperty(cx, atomsCache->passUnion16_id, &callable)) { | ||||
| 63173 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63174 | return; | ||||
| 63175 | } | ||||
| 63176 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63177 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63178 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63179 | aRv.NoteJSContextException(cx); | ||||
| 63180 | return; | ||||
| 63181 | } | ||||
| 63182 | } | ||||
| 63183 | |||||
| 63184 | void | ||||
| 63185 | TestJSImplInterfaceJSImpl::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63186 | { | ||||
| 63187 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63188 | if (aRv.Failed()) { | ||||
| 63189 | return; | ||||
| 63190 | } | ||||
| 63191 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63191); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63191; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63192 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63193 | |||||
| 63194 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63195 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63196 | if (!argv.resize(1)) { | ||||
| 63197 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63198 | // the right thing with that. | ||||
| 63199 | return; | ||||
| 63200 | } | ||||
| 63201 | unsigned argc = 1; | ||||
| 63202 | |||||
| 63203 | do { | ||||
| 63204 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63205 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63206 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63207 | return; | ||||
| 63208 | } | ||||
| 63209 | break; | ||||
| 63210 | } while (false); | ||||
| 63211 | |||||
| 63212 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63213 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63214 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63215 | !InitIds(cx, atomsCache)) || | ||||
| 63216 | !GetCallableProperty(cx, atomsCache->passUnion17_id, &callable)) { | ||||
| 63217 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63218 | return; | ||||
| 63219 | } | ||||
| 63220 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63221 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63222 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63223 | aRv.NoteJSContextException(cx); | ||||
| 63224 | return; | ||||
| 63225 | } | ||||
| 63226 | } | ||||
| 63227 | |||||
| 63228 | void | ||||
| 63229 | TestJSImplInterfaceJSImpl::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63230 | { | ||||
| 63231 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63232 | if (aRv.Failed()) { | ||||
| 63233 | return; | ||||
| 63234 | } | ||||
| 63235 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63235); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63235; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63236 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63237 | |||||
| 63238 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63239 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63240 | if (!argv.resize(1)) { | ||||
| 63241 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63242 | // the right thing with that. | ||||
| 63243 | return; | ||||
| 63244 | } | ||||
| 63245 | unsigned argc = 1; | ||||
| 63246 | |||||
| 63247 | do { | ||||
| 63248 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63249 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63250 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63251 | return; | ||||
| 63252 | } | ||||
| 63253 | break; | ||||
| 63254 | } while (false); | ||||
| 63255 | |||||
| 63256 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63257 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63258 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63259 | !InitIds(cx, atomsCache)) || | ||||
| 63260 | !GetCallableProperty(cx, atomsCache->passUnion18_id, &callable)) { | ||||
| 63261 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63262 | return; | ||||
| 63263 | } | ||||
| 63264 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63265 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63266 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63267 | aRv.NoteJSContextException(cx); | ||||
| 63268 | return; | ||||
| 63269 | } | ||||
| 63270 | } | ||||
| 63271 | |||||
| 63272 | void | ||||
| 63273 | TestJSImplInterfaceJSImpl::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63274 | { | ||||
| 63275 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63276 | if (aRv.Failed()) { | ||||
| 63277 | return; | ||||
| 63278 | } | ||||
| 63279 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63279); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63279; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63280 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63281 | |||||
| 63282 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63283 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63284 | if (!argv.resize(1)) { | ||||
| 63285 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63286 | // the right thing with that. | ||||
| 63287 | return; | ||||
| 63288 | } | ||||
| 63289 | unsigned argc = 1; | ||||
| 63290 | |||||
| 63291 | do { | ||||
| 63292 | if (arg.WasPassed()) { | ||||
| 63293 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63294 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63295 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63296 | return; | ||||
| 63297 | } | ||||
| 63298 | break; | ||||
| 63299 | } else if (argc == 1) { | ||||
| 63300 | // This is our current trailing argument; reduce argc | ||||
| 63301 | --argc; | ||||
| 63302 | } else { | ||||
| 63303 | argv[0].setUndefined(); | ||||
| 63304 | } | ||||
| 63305 | } while (false); | ||||
| 63306 | |||||
| 63307 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63308 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63309 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63310 | !InitIds(cx, atomsCache)) || | ||||
| 63311 | !GetCallableProperty(cx, atomsCache->passUnion19_id, &callable)) { | ||||
| 63312 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63313 | return; | ||||
| 63314 | } | ||||
| 63315 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63316 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63317 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63318 | aRv.NoteJSContextException(cx); | ||||
| 63319 | return; | ||||
| 63320 | } | ||||
| 63321 | } | ||||
| 63322 | |||||
| 63323 | void | ||||
| 63324 | TestJSImplInterfaceJSImpl::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63325 | { | ||||
| 63326 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63327 | if (aRv.Failed()) { | ||||
| 63328 | return; | ||||
| 63329 | } | ||||
| 63330 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63330); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63330; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63331 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63332 | |||||
| 63333 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63334 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63335 | if (!argv.resize(1)) { | ||||
| 63336 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63337 | // the right thing with that. | ||||
| 63338 | return; | ||||
| 63339 | } | ||||
| 63340 | unsigned argc = 1; | ||||
| 63341 | |||||
| 63342 | do { | ||||
| 63343 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63344 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63345 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63346 | return; | ||||
| 63347 | } | ||||
| 63348 | break; | ||||
| 63349 | } while (false); | ||||
| 63350 | |||||
| 63351 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63352 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63353 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63354 | !InitIds(cx, atomsCache)) || | ||||
| 63355 | !GetCallableProperty(cx, atomsCache->passUnion20_id, &callable)) { | ||||
| 63356 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63357 | return; | ||||
| 63358 | } | ||||
| 63359 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63360 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63361 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63362 | aRv.NoteJSContextException(cx); | ||||
| 63363 | return; | ||||
| 63364 | } | ||||
| 63365 | } | ||||
| 63366 | |||||
| 63367 | void | ||||
| 63368 | TestJSImplInterfaceJSImpl::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63369 | { | ||||
| 63370 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63371 | if (aRv.Failed()) { | ||||
| 63372 | return; | ||||
| 63373 | } | ||||
| 63374 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63374); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63374; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63375 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63376 | |||||
| 63377 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63378 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63379 | if (!argv.resize(1)) { | ||||
| 63380 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63381 | // the right thing with that. | ||||
| 63382 | return; | ||||
| 63383 | } | ||||
| 63384 | unsigned argc = 1; | ||||
| 63385 | |||||
| 63386 | do { | ||||
| 63387 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63388 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63389 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63390 | return; | ||||
| 63391 | } | ||||
| 63392 | break; | ||||
| 63393 | } while (false); | ||||
| 63394 | |||||
| 63395 | JS::Rooted<JS::Value> callable(cx); | ||||
| 63396 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 63397 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 63398 | !InitIds(cx, atomsCache)) || | ||||
| 63399 | !GetCallableProperty(cx, atomsCache->passUnion21_id, &callable)) { | ||||
| 63400 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63401 | return; | ||||
| 63402 | } | ||||
| 63403 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 63404 | if (!JS::Call(cx, thisValue, callable, | ||||
| 63405 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 63406 | aRv.NoteJSContextException(cx); | ||||
| 63407 | return; | ||||
| 63408 | } | ||||
| 63409 | } | ||||
| 63410 | |||||
| 63411 | void | ||||
| 63412 | TestJSImplInterfaceJSImpl::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63413 | { | ||||
| 63414 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 63415 | if (aRv.Failed()) { | ||||
| 63416 | return; | ||||
| 63417 | } | ||||
| 63418 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 63418); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 63418; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 63419 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 63420 | |||||
| 63421 | JS::Rooted<JS::Value> rval(cx); | ||||
| 63422 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 63423 | if (!argv.resize(1)) { | ||||
| 63424 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 63425 | // the right thing with that. | ||||
| 63426 | return; | ||||
| 63427 | } | ||||
| 63428 | unsigned argc = 1; | ||||
| 63429 | |||||
| 63430 | do { | ||||
| 63431 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 63432 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 63433 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 63434 | return; | ||||
| 63435 | } | ||||
| 63436 | break; | ||||
| 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->passUnion22_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 | |||||
| 63455 | void | ||||
| 63456 | TestJSImplInterfaceJSImpl::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63457 | { | ||||
| 63458 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion23", 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 { *((volatile int *)__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->passUnion23_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 | |||||
| 63499 | void | ||||
| 63500 | TestJSImplInterfaceJSImpl::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63501 | { | ||||
| 63502 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion24", 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 { *((volatile int *)__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->passUnion24_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 | |||||
| 63543 | void | ||||
| 63544 | TestJSImplInterfaceJSImpl::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63545 | { | ||||
| 63546 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion25", 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 { *((volatile int *)__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->passUnion25_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 | |||||
| 63587 | void | ||||
| 63588 | TestJSImplInterfaceJSImpl::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63589 | { | ||||
| 63590 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion26", 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 { *((volatile int *)__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->passUnion26_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 | |||||
| 63631 | void | ||||
| 63632 | TestJSImplInterfaceJSImpl::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63633 | { | ||||
| 63634 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion27", 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 { *((volatile int *)__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->passUnion27_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 | |||||
| 63675 | void | ||||
| 63676 | TestJSImplInterfaceJSImpl::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63677 | { | ||||
| 63678 | CallSetup s(this, aRv, "TestJSImplInterface.passUnion28", 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 { *((volatile int *)__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->passUnion28_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 | |||||
| 63719 | void | ||||
| 63720 | TestJSImplInterfaceJSImpl::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63721 | { | ||||
| 63722 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithCallback", 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 { *((volatile int *)__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->passUnionWithCallback_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 | |||||
| 63763 | void | ||||
| 63764 | TestJSImplInterfaceJSImpl::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63765 | { | ||||
| 63766 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithByteString", 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 { *((volatile int *)__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->passUnionWithByteString_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 | |||||
| 63807 | void | ||||
| 63808 | TestJSImplInterfaceJSImpl::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63809 | { | ||||
| 63810 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithUTF8String", 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 { *((volatile int *)__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->passUnionWithUTF8String_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 | |||||
| 63851 | void | ||||
| 63852 | TestJSImplInterfaceJSImpl::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63853 | { | ||||
| 63854 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecord", 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 { *((volatile int *)__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->passUnionWithRecord_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 | |||||
| 63895 | void | ||||
| 63896 | TestJSImplInterfaceJSImpl::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63897 | { | ||||
| 63898 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecordAndSequence", 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 { *((volatile int *)__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->passUnionWithRecordAndSequence_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 | |||||
| 63939 | void | ||||
| 63940 | TestJSImplInterfaceJSImpl::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63941 | { | ||||
| 63942 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSequenceAndRecord", 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 { *((volatile int *)__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->passUnionWithSequenceAndRecord_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 | |||||
| 63983 | void | ||||
| 63984 | TestJSImplInterfaceJSImpl::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 63985 | { | ||||
| 63986 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSVS", 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 { *((volatile int *)__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->passUnionWithSVS_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 | |||||
| 64027 | void | ||||
| 64028 | TestJSImplInterfaceJSImpl::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64029 | { | ||||
| 64030 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithNullable", 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 { *((volatile int *)__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->passUnionWithNullable_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 | |||||
| 64071 | void | ||||
| 64072 | TestJSImplInterfaceJSImpl::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64073 | { | ||||
| 64074 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnion", 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 { *((volatile int *)__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.IsNull()) { | ||||
| 64093 | argv[0].setNull(); | ||||
| 64094 | break; | ||||
| 64095 | } | ||||
| 64096 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64097 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64098 | return; | ||||
| 64099 | } | ||||
| 64100 | break; | ||||
| 64101 | } while (false); | ||||
| 64102 | |||||
| 64103 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64104 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64105 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64106 | !InitIds(cx, atomsCache)) || | ||||
| 64107 | !GetCallableProperty(cx, atomsCache->passNullableUnion_id, &callable)) { | ||||
| 64108 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64109 | return; | ||||
| 64110 | } | ||||
| 64111 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64112 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64113 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64114 | aRv.NoteJSContextException(cx); | ||||
| 64115 | return; | ||||
| 64116 | } | ||||
| 64117 | } | ||||
| 64118 | |||||
| 64119 | void | ||||
| 64120 | TestJSImplInterfaceJSImpl::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64121 | { | ||||
| 64122 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64123 | if (aRv.Failed()) { | ||||
| 64124 | return; | ||||
| 64125 | } | ||||
| 64126 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64126); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64126; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64127 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64128 | |||||
| 64129 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64130 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64131 | if (!argv.resize(1)) { | ||||
| 64132 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64133 | // the right thing with that. | ||||
| 64134 | return; | ||||
| 64135 | } | ||||
| 64136 | unsigned argc = 1; | ||||
| 64137 | |||||
| 64138 | do { | ||||
| 64139 | if (arg.WasPassed()) { | ||||
| 64140 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64141 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64142 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64143 | return; | ||||
| 64144 | } | ||||
| 64145 | break; | ||||
| 64146 | } else if (argc == 1) { | ||||
| 64147 | // This is our current trailing argument; reduce argc | ||||
| 64148 | --argc; | ||||
| 64149 | } else { | ||||
| 64150 | argv[0].setUndefined(); | ||||
| 64151 | } | ||||
| 64152 | } while (false); | ||||
| 64153 | |||||
| 64154 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64155 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64156 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64157 | !InitIds(cx, atomsCache)) || | ||||
| 64158 | !GetCallableProperty(cx, atomsCache->passOptionalUnion_id, &callable)) { | ||||
| 64159 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64160 | return; | ||||
| 64161 | } | ||||
| 64162 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64163 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64164 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64165 | aRv.NoteJSContextException(cx); | ||||
| 64166 | return; | ||||
| 64167 | } | ||||
| 64168 | } | ||||
| 64169 | |||||
| 64170 | void | ||||
| 64171 | TestJSImplInterfaceJSImpl::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64172 | { | ||||
| 64173 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64174 | if (aRv.Failed()) { | ||||
| 64175 | return; | ||||
| 64176 | } | ||||
| 64177 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64177); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64177; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64178 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64179 | |||||
| 64180 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64181 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64182 | if (!argv.resize(1)) { | ||||
| 64183 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64184 | // the right thing with that. | ||||
| 64185 | return; | ||||
| 64186 | } | ||||
| 64187 | unsigned argc = 1; | ||||
| 64188 | |||||
| 64189 | do { | ||||
| 64190 | if (arg.WasPassed()) { | ||||
| 64191 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64192 | if (arg.Value().IsNull()) { | ||||
| 64193 | argv[0].setNull(); | ||||
| 64194 | break; | ||||
| 64195 | } | ||||
| 64196 | if (!arg.Value().Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64197 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64198 | return; | ||||
| 64199 | } | ||||
| 64200 | break; | ||||
| 64201 | } else if (argc == 1) { | ||||
| 64202 | // This is our current trailing argument; reduce argc | ||||
| 64203 | --argc; | ||||
| 64204 | } else { | ||||
| 64205 | argv[0].setUndefined(); | ||||
| 64206 | } | ||||
| 64207 | } while (false); | ||||
| 64208 | |||||
| 64209 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64210 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64211 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64212 | !InitIds(cx, atomsCache)) || | ||||
| 64213 | !GetCallableProperty(cx, atomsCache->passOptionalNullableUnion_id, &callable)) { | ||||
| 64214 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64215 | return; | ||||
| 64216 | } | ||||
| 64217 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64218 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64219 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64220 | aRv.NoteJSContextException(cx); | ||||
| 64221 | return; | ||||
| 64222 | } | ||||
| 64223 | } | ||||
| 64224 | |||||
| 64225 | void | ||||
| 64226 | TestJSImplInterfaceJSImpl::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64227 | { | ||||
| 64228 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64229 | if (aRv.Failed()) { | ||||
| 64230 | return; | ||||
| 64231 | } | ||||
| 64232 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64232); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64232; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64233 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64234 | |||||
| 64235 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64236 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64237 | if (!argv.resize(1)) { | ||||
| 64238 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64239 | // the right thing with that. | ||||
| 64240 | return; | ||||
| 64241 | } | ||||
| 64242 | unsigned argc = 1; | ||||
| 64243 | |||||
| 64244 | do { | ||||
| 64245 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64246 | if (arg.IsNull()) { | ||||
| 64247 | argv[0].setNull(); | ||||
| 64248 | break; | ||||
| 64249 | } | ||||
| 64250 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64251 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64252 | return; | ||||
| 64253 | } | ||||
| 64254 | break; | ||||
| 64255 | } while (false); | ||||
| 64256 | |||||
| 64257 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64258 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64259 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64260 | !InitIds(cx, atomsCache)) || | ||||
| 64261 | !GetCallableProperty(cx, atomsCache->passOptionalNullableUnionWithDefaultValue_id, &callable)) { | ||||
| 64262 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64263 | return; | ||||
| 64264 | } | ||||
| 64265 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64266 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64267 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64268 | aRv.NoteJSContextException(cx); | ||||
| 64269 | return; | ||||
| 64270 | } | ||||
| 64271 | } | ||||
| 64272 | |||||
| 64273 | void | ||||
| 64274 | TestJSImplInterfaceJSImpl::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64275 | { | ||||
| 64276 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64277 | if (aRv.Failed()) { | ||||
| 64278 | return; | ||||
| 64279 | } | ||||
| 64280 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64280); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64280; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64281 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64282 | |||||
| 64283 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64284 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64285 | if (!argv.resize(1)) { | ||||
| 64286 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64287 | // the right thing with that. | ||||
| 64288 | return; | ||||
| 64289 | } | ||||
| 64290 | unsigned argc = 1; | ||||
| 64291 | |||||
| 64292 | do { | ||||
| 64293 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64294 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64295 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64296 | return; | ||||
| 64297 | } | ||||
| 64298 | break; | ||||
| 64299 | } while (false); | ||||
| 64300 | |||||
| 64301 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64302 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64303 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64304 | !InitIds(cx, atomsCache)) || | ||||
| 64305 | !GetCallableProperty(cx, atomsCache->passUnionWithArrayBuffer_id, &callable)) { | ||||
| 64306 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64307 | return; | ||||
| 64308 | } | ||||
| 64309 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64310 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64311 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64312 | aRv.NoteJSContextException(cx); | ||||
| 64313 | return; | ||||
| 64314 | } | ||||
| 64315 | } | ||||
| 64316 | |||||
| 64317 | void | ||||
| 64318 | TestJSImplInterfaceJSImpl::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64319 | { | ||||
| 64320 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBufferOrNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64321 | if (aRv.Failed()) { | ||||
| 64322 | return; | ||||
| 64323 | } | ||||
| 64324 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64324); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64324; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64325 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64326 | |||||
| 64327 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64328 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64329 | if (!argv.resize(1)) { | ||||
| 64330 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64331 | // the right thing with that. | ||||
| 64332 | return; | ||||
| 64333 | } | ||||
| 64334 | unsigned argc = 1; | ||||
| 64335 | |||||
| 64336 | do { | ||||
| 64337 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64338 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 64339 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64340 | return; | ||||
| 64341 | } | ||||
| 64342 | break; | ||||
| 64343 | } while (false); | ||||
| 64344 | |||||
| 64345 | JS::Rooted<JS::Value> callable(cx); | ||||
| 64346 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 64347 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 64348 | !InitIds(cx, atomsCache)) || | ||||
| 64349 | !GetCallableProperty(cx, atomsCache->passUnionWithArrayBufferOrNull_id, &callable)) { | ||||
| 64350 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 64351 | return; | ||||
| 64352 | } | ||||
| 64353 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 64354 | if (!JS::Call(cx, thisValue, callable, | ||||
| 64355 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 64356 | aRv.NoteJSContextException(cx); | ||||
| 64357 | return; | ||||
| 64358 | } | ||||
| 64359 | } | ||||
| 64360 | |||||
| 64361 | void | ||||
| 64362 | TestJSImplInterfaceJSImpl::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64363 | { | ||||
| 64364 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArrays", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 64365 | if (aRv.Failed()) { | ||||
| 64366 | return; | ||||
| 64367 | } | ||||
| 64368 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 64368); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 64368; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 64369 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 64370 | |||||
| 64371 | JS::Rooted<JS::Value> rval(cx); | ||||
| 64372 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 64373 | if (!argv.resize(1)) { | ||||
| 64374 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 64375 | // the right thing with that. | ||||
| 64376 | return; | ||||
| 64377 | } | ||||
| 64378 | unsigned argc = 1; | ||||
| 64379 | |||||
| 64380 | do { | ||||
| 64381 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 64382 | if (!arg.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->passUnionWithTypedArrays_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 | |||||
| 64405 | void | ||||
| 64406 | TestJSImplInterfaceJSImpl::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64407 | { | ||||
| 64408 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArraysOrNull", 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 { *((volatile int *)__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->passUnionWithTypedArraysOrNull_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 | |||||
| 64449 | void | ||||
| 64450 | TestJSImplInterfaceJSImpl::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64451 | { | ||||
| 64452 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithString", 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 { *((volatile int *)__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->passUnionWithString_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 | |||||
| 64493 | void | ||||
| 64494 | TestJSImplInterfaceJSImpl::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64495 | { | ||||
| 64496 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithEnum", 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 { *((volatile int *)__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->passUnionWithEnum_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 | |||||
| 64537 | void | ||||
| 64538 | TestJSImplInterfaceJSImpl::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64539 | { | ||||
| 64540 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithObject", 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 { *((volatile int *)__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->passUnionWithObject_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 | |||||
| 64581 | void | ||||
| 64582 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64583 | { | ||||
| 64584 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue1", 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 { *((volatile int *)__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->passUnionWithDefaultValue1_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 | |||||
| 64625 | void | ||||
| 64626 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64627 | { | ||||
| 64628 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue2", 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 { *((volatile int *)__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->passUnionWithDefaultValue2_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 | |||||
| 64669 | void | ||||
| 64670 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64671 | { | ||||
| 64672 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue3", 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 { *((volatile int *)__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->passUnionWithDefaultValue3_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 | |||||
| 64713 | void | ||||
| 64714 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64715 | { | ||||
| 64716 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue4", 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 { *((volatile int *)__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->passUnionWithDefaultValue4_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 | |||||
| 64757 | void | ||||
| 64758 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64759 | { | ||||
| 64760 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue5", 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 { *((volatile int *)__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->passUnionWithDefaultValue5_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 | |||||
| 64801 | void | ||||
| 64802 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64803 | { | ||||
| 64804 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue6", 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 { *((volatile int *)__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->passUnionWithDefaultValue6_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 | |||||
| 64845 | void | ||||
| 64846 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64847 | { | ||||
| 64848 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue7", 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 { *((volatile int *)__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->passUnionWithDefaultValue7_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 | |||||
| 64889 | void | ||||
| 64890 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64891 | { | ||||
| 64892 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue8", 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 { *((volatile int *)__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->passUnionWithDefaultValue8_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 | |||||
| 64933 | void | ||||
| 64934 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64935 | { | ||||
| 64936 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue9", 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 { *((volatile int *)__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->passUnionWithDefaultValue9_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 | |||||
| 64977 | void | ||||
| 64978 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 64979 | { | ||||
| 64980 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue10", 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 { *((volatile int *)__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->passUnionWithDefaultValue10_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 | |||||
| 65021 | void | ||||
| 65022 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65023 | { | ||||
| 65024 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue11", 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 { *((volatile int *)__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->passUnionWithDefaultValue11_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 | |||||
| 65065 | void | ||||
| 65066 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65067 | { | ||||
| 65068 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue12", 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 { *((volatile int *)__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->passUnionWithDefaultValue12_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 | |||||
| 65109 | void | ||||
| 65110 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65111 | { | ||||
| 65112 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue13", 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 { *((volatile int *)__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->passUnionWithDefaultValue13_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 | |||||
| 65153 | void | ||||
| 65154 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65155 | { | ||||
| 65156 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue14", 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 { *((volatile int *)__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->passUnionWithDefaultValue14_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 | |||||
| 65197 | void | ||||
| 65198 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65199 | { | ||||
| 65200 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue15", 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 { *((volatile int *)__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->passUnionWithDefaultValue15_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 | |||||
| 65241 | void | ||||
| 65242 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65243 | { | ||||
| 65244 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue16", 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 { *((volatile int *)__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->passUnionWithDefaultValue16_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 | |||||
| 65285 | void | ||||
| 65286 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65287 | { | ||||
| 65288 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue17", 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 { *((volatile int *)__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->passUnionWithDefaultValue17_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 | |||||
| 65329 | void | ||||
| 65330 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65331 | { | ||||
| 65332 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue18", 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 { *((volatile int *)__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->passUnionWithDefaultValue18_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 | |||||
| 65373 | void | ||||
| 65374 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65375 | { | ||||
| 65376 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue19", 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 { *((volatile int *)__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->passUnionWithDefaultValue19_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 | |||||
| 65417 | void | ||||
| 65418 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65419 | { | ||||
| 65420 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue20", 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 { *((volatile int *)__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->passUnionWithDefaultValue20_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 | |||||
| 65461 | void | ||||
| 65462 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65463 | { | ||||
| 65464 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue21", 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 { *((volatile int *)__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->passUnionWithDefaultValue21_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 | |||||
| 65505 | void | ||||
| 65506 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65507 | { | ||||
| 65508 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue22", 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 { *((volatile int *)__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->passUnionWithDefaultValue22_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 | |||||
| 65549 | void | ||||
| 65550 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65551 | { | ||||
| 65552 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue23", 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 { *((volatile int *)__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->passUnionWithDefaultValue23_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 | |||||
| 65593 | void | ||||
| 65594 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65595 | { | ||||
| 65596 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue24", 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 { *((volatile int *)__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->passUnionWithDefaultValue24_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 | |||||
| 65637 | void | ||||
| 65638 | TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65639 | { | ||||
| 65640 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue25", 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 { *((volatile int *)__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->passUnionWithDefaultValue25_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 | |||||
| 65681 | void | ||||
| 65682 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65683 | { | ||||
| 65684 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue1", 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 { *((volatile int *)__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.IsNull()) { | ||||
| 65703 | argv[0].setNull(); | ||||
| 65704 | break; | ||||
| 65705 | } | ||||
| 65706 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65707 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65708 | return; | ||||
| 65709 | } | ||||
| 65710 | break; | ||||
| 65711 | } while (false); | ||||
| 65712 | |||||
| 65713 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65714 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65715 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65716 | !InitIds(cx, atomsCache)) || | ||||
| 65717 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue1_id, &callable)) { | ||||
| 65718 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65719 | return; | ||||
| 65720 | } | ||||
| 65721 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65722 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65723 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65724 | aRv.NoteJSContextException(cx); | ||||
| 65725 | return; | ||||
| 65726 | } | ||||
| 65727 | } | ||||
| 65728 | |||||
| 65729 | void | ||||
| 65730 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65731 | { | ||||
| 65732 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65733 | if (aRv.Failed()) { | ||||
| 65734 | return; | ||||
| 65735 | } | ||||
| 65736 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65736); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65736; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65737 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65738 | |||||
| 65739 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65740 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65741 | if (!argv.resize(1)) { | ||||
| 65742 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65743 | // the right thing with that. | ||||
| 65744 | return; | ||||
| 65745 | } | ||||
| 65746 | unsigned argc = 1; | ||||
| 65747 | |||||
| 65748 | do { | ||||
| 65749 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65750 | if (arg.IsNull()) { | ||||
| 65751 | argv[0].setNull(); | ||||
| 65752 | break; | ||||
| 65753 | } | ||||
| 65754 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65755 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65756 | return; | ||||
| 65757 | } | ||||
| 65758 | break; | ||||
| 65759 | } while (false); | ||||
| 65760 | |||||
| 65761 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65762 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65763 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65764 | !InitIds(cx, atomsCache)) || | ||||
| 65765 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue2_id, &callable)) { | ||||
| 65766 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65767 | return; | ||||
| 65768 | } | ||||
| 65769 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65770 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65771 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65772 | aRv.NoteJSContextException(cx); | ||||
| 65773 | return; | ||||
| 65774 | } | ||||
| 65775 | } | ||||
| 65776 | |||||
| 65777 | void | ||||
| 65778 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65779 | { | ||||
| 65780 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65781 | if (aRv.Failed()) { | ||||
| 65782 | return; | ||||
| 65783 | } | ||||
| 65784 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65784); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65784; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65785 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65786 | |||||
| 65787 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65788 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65789 | if (!argv.resize(1)) { | ||||
| 65790 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65791 | // the right thing with that. | ||||
| 65792 | return; | ||||
| 65793 | } | ||||
| 65794 | unsigned argc = 1; | ||||
| 65795 | |||||
| 65796 | do { | ||||
| 65797 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65798 | if (arg.IsNull()) { | ||||
| 65799 | argv[0].setNull(); | ||||
| 65800 | break; | ||||
| 65801 | } | ||||
| 65802 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65803 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65804 | return; | ||||
| 65805 | } | ||||
| 65806 | break; | ||||
| 65807 | } while (false); | ||||
| 65808 | |||||
| 65809 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65810 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65811 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65812 | !InitIds(cx, atomsCache)) || | ||||
| 65813 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue3_id, &callable)) { | ||||
| 65814 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65815 | return; | ||||
| 65816 | } | ||||
| 65817 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65818 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65819 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65820 | aRv.NoteJSContextException(cx); | ||||
| 65821 | return; | ||||
| 65822 | } | ||||
| 65823 | } | ||||
| 65824 | |||||
| 65825 | void | ||||
| 65826 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65827 | { | ||||
| 65828 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65829 | if (aRv.Failed()) { | ||||
| 65830 | return; | ||||
| 65831 | } | ||||
| 65832 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65832); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65832; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65833 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65834 | |||||
| 65835 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65836 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65837 | if (!argv.resize(1)) { | ||||
| 65838 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65839 | // the right thing with that. | ||||
| 65840 | return; | ||||
| 65841 | } | ||||
| 65842 | unsigned argc = 1; | ||||
| 65843 | |||||
| 65844 | do { | ||||
| 65845 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65846 | if (arg.IsNull()) { | ||||
| 65847 | argv[0].setNull(); | ||||
| 65848 | break; | ||||
| 65849 | } | ||||
| 65850 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65851 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65852 | return; | ||||
| 65853 | } | ||||
| 65854 | break; | ||||
| 65855 | } while (false); | ||||
| 65856 | |||||
| 65857 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65858 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65859 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65860 | !InitIds(cx, atomsCache)) || | ||||
| 65861 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue4_id, &callable)) { | ||||
| 65862 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65863 | return; | ||||
| 65864 | } | ||||
| 65865 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65866 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65867 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65868 | aRv.NoteJSContextException(cx); | ||||
| 65869 | return; | ||||
| 65870 | } | ||||
| 65871 | } | ||||
| 65872 | |||||
| 65873 | void | ||||
| 65874 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65875 | { | ||||
| 65876 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65877 | if (aRv.Failed()) { | ||||
| 65878 | return; | ||||
| 65879 | } | ||||
| 65880 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65880); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65880; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65881 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65882 | |||||
| 65883 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65884 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65885 | if (!argv.resize(1)) { | ||||
| 65886 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65887 | // the right thing with that. | ||||
| 65888 | return; | ||||
| 65889 | } | ||||
| 65890 | unsigned argc = 1; | ||||
| 65891 | |||||
| 65892 | do { | ||||
| 65893 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65894 | if (arg.IsNull()) { | ||||
| 65895 | argv[0].setNull(); | ||||
| 65896 | break; | ||||
| 65897 | } | ||||
| 65898 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65899 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65900 | return; | ||||
| 65901 | } | ||||
| 65902 | break; | ||||
| 65903 | } while (false); | ||||
| 65904 | |||||
| 65905 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65906 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65907 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65908 | !InitIds(cx, atomsCache)) || | ||||
| 65909 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue5_id, &callable)) { | ||||
| 65910 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65911 | return; | ||||
| 65912 | } | ||||
| 65913 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65914 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65915 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65916 | aRv.NoteJSContextException(cx); | ||||
| 65917 | return; | ||||
| 65918 | } | ||||
| 65919 | } | ||||
| 65920 | |||||
| 65921 | void | ||||
| 65922 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65923 | { | ||||
| 65924 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65925 | if (aRv.Failed()) { | ||||
| 65926 | return; | ||||
| 65927 | } | ||||
| 65928 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65928); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65928; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65929 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65930 | |||||
| 65931 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65932 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65933 | if (!argv.resize(1)) { | ||||
| 65934 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65935 | // the right thing with that. | ||||
| 65936 | return; | ||||
| 65937 | } | ||||
| 65938 | unsigned argc = 1; | ||||
| 65939 | |||||
| 65940 | do { | ||||
| 65941 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65942 | if (arg.IsNull()) { | ||||
| 65943 | argv[0].setNull(); | ||||
| 65944 | break; | ||||
| 65945 | } | ||||
| 65946 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65947 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65948 | return; | ||||
| 65949 | } | ||||
| 65950 | break; | ||||
| 65951 | } while (false); | ||||
| 65952 | |||||
| 65953 | JS::Rooted<JS::Value> callable(cx); | ||||
| 65954 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 65955 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 65956 | !InitIds(cx, atomsCache)) || | ||||
| 65957 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue6_id, &callable)) { | ||||
| 65958 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65959 | return; | ||||
| 65960 | } | ||||
| 65961 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 65962 | if (!JS::Call(cx, thisValue, callable, | ||||
| 65963 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 65964 | aRv.NoteJSContextException(cx); | ||||
| 65965 | return; | ||||
| 65966 | } | ||||
| 65967 | } | ||||
| 65968 | |||||
| 65969 | void | ||||
| 65970 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 65971 | { | ||||
| 65972 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 65973 | if (aRv.Failed()) { | ||||
| 65974 | return; | ||||
| 65975 | } | ||||
| 65976 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 65976); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 65976; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 65977 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 65978 | |||||
| 65979 | JS::Rooted<JS::Value> rval(cx); | ||||
| 65980 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 65981 | if (!argv.resize(1)) { | ||||
| 65982 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 65983 | // the right thing with that. | ||||
| 65984 | return; | ||||
| 65985 | } | ||||
| 65986 | unsigned argc = 1; | ||||
| 65987 | |||||
| 65988 | do { | ||||
| 65989 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 65990 | if (arg.IsNull()) { | ||||
| 65991 | argv[0].setNull(); | ||||
| 65992 | break; | ||||
| 65993 | } | ||||
| 65994 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 65995 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 65996 | return; | ||||
| 65997 | } | ||||
| 65998 | break; | ||||
| 65999 | } while (false); | ||||
| 66000 | |||||
| 66001 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66002 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66003 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66004 | !InitIds(cx, atomsCache)) || | ||||
| 66005 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue7_id, &callable)) { | ||||
| 66006 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66007 | return; | ||||
| 66008 | } | ||||
| 66009 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66010 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66011 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66012 | aRv.NoteJSContextException(cx); | ||||
| 66013 | return; | ||||
| 66014 | } | ||||
| 66015 | } | ||||
| 66016 | |||||
| 66017 | void | ||||
| 66018 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66019 | { | ||||
| 66020 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66021 | if (aRv.Failed()) { | ||||
| 66022 | return; | ||||
| 66023 | } | ||||
| 66024 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66024); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66024; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66025 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66026 | |||||
| 66027 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66028 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66029 | if (!argv.resize(1)) { | ||||
| 66030 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66031 | // the right thing with that. | ||||
| 66032 | return; | ||||
| 66033 | } | ||||
| 66034 | unsigned argc = 1; | ||||
| 66035 | |||||
| 66036 | do { | ||||
| 66037 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66038 | if (arg.IsNull()) { | ||||
| 66039 | argv[0].setNull(); | ||||
| 66040 | break; | ||||
| 66041 | } | ||||
| 66042 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66043 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66044 | return; | ||||
| 66045 | } | ||||
| 66046 | break; | ||||
| 66047 | } while (false); | ||||
| 66048 | |||||
| 66049 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66050 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66051 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66052 | !InitIds(cx, atomsCache)) || | ||||
| 66053 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue8_id, &callable)) { | ||||
| 66054 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66055 | return; | ||||
| 66056 | } | ||||
| 66057 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66058 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66059 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66060 | aRv.NoteJSContextException(cx); | ||||
| 66061 | return; | ||||
| 66062 | } | ||||
| 66063 | } | ||||
| 66064 | |||||
| 66065 | void | ||||
| 66066 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66067 | { | ||||
| 66068 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66069 | if (aRv.Failed()) { | ||||
| 66070 | return; | ||||
| 66071 | } | ||||
| 66072 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66072); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66072; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66073 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66074 | |||||
| 66075 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66076 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66077 | if (!argv.resize(1)) { | ||||
| 66078 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66079 | // the right thing with that. | ||||
| 66080 | return; | ||||
| 66081 | } | ||||
| 66082 | unsigned argc = 1; | ||||
| 66083 | |||||
| 66084 | do { | ||||
| 66085 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66086 | if (arg.IsNull()) { | ||||
| 66087 | argv[0].setNull(); | ||||
| 66088 | break; | ||||
| 66089 | } | ||||
| 66090 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66091 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66092 | return; | ||||
| 66093 | } | ||||
| 66094 | break; | ||||
| 66095 | } while (false); | ||||
| 66096 | |||||
| 66097 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66098 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66099 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66100 | !InitIds(cx, atomsCache)) || | ||||
| 66101 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue9_id, &callable)) { | ||||
| 66102 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66103 | return; | ||||
| 66104 | } | ||||
| 66105 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66106 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66107 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66108 | aRv.NoteJSContextException(cx); | ||||
| 66109 | return; | ||||
| 66110 | } | ||||
| 66111 | } | ||||
| 66112 | |||||
| 66113 | void | ||||
| 66114 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66115 | { | ||||
| 66116 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66117 | if (aRv.Failed()) { | ||||
| 66118 | return; | ||||
| 66119 | } | ||||
| 66120 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66120); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66120; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66121 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66122 | |||||
| 66123 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66124 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66125 | if (!argv.resize(1)) { | ||||
| 66126 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66127 | // the right thing with that. | ||||
| 66128 | return; | ||||
| 66129 | } | ||||
| 66130 | unsigned argc = 1; | ||||
| 66131 | |||||
| 66132 | do { | ||||
| 66133 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66134 | if (arg.IsNull()) { | ||||
| 66135 | argv[0].setNull(); | ||||
| 66136 | break; | ||||
| 66137 | } | ||||
| 66138 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66139 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66140 | return; | ||||
| 66141 | } | ||||
| 66142 | break; | ||||
| 66143 | } while (false); | ||||
| 66144 | |||||
| 66145 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66146 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66147 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66148 | !InitIds(cx, atomsCache)) || | ||||
| 66149 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue10_id, &callable)) { | ||||
| 66150 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66151 | return; | ||||
| 66152 | } | ||||
| 66153 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66154 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66155 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66156 | aRv.NoteJSContextException(cx); | ||||
| 66157 | return; | ||||
| 66158 | } | ||||
| 66159 | } | ||||
| 66160 | |||||
| 66161 | void | ||||
| 66162 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66163 | { | ||||
| 66164 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66165 | if (aRv.Failed()) { | ||||
| 66166 | return; | ||||
| 66167 | } | ||||
| 66168 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66168); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66168; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66169 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66170 | |||||
| 66171 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66172 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66173 | if (!argv.resize(1)) { | ||||
| 66174 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66175 | // the right thing with that. | ||||
| 66176 | return; | ||||
| 66177 | } | ||||
| 66178 | unsigned argc = 1; | ||||
| 66179 | |||||
| 66180 | do { | ||||
| 66181 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66182 | if (arg.IsNull()) { | ||||
| 66183 | argv[0].setNull(); | ||||
| 66184 | break; | ||||
| 66185 | } | ||||
| 66186 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66187 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66188 | return; | ||||
| 66189 | } | ||||
| 66190 | break; | ||||
| 66191 | } while (false); | ||||
| 66192 | |||||
| 66193 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66194 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66195 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66196 | !InitIds(cx, atomsCache)) || | ||||
| 66197 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue11_id, &callable)) { | ||||
| 66198 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66199 | return; | ||||
| 66200 | } | ||||
| 66201 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66202 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66203 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66204 | aRv.NoteJSContextException(cx); | ||||
| 66205 | return; | ||||
| 66206 | } | ||||
| 66207 | } | ||||
| 66208 | |||||
| 66209 | void | ||||
| 66210 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66211 | { | ||||
| 66212 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66213 | if (aRv.Failed()) { | ||||
| 66214 | return; | ||||
| 66215 | } | ||||
| 66216 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66216); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66216; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66217 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66218 | |||||
| 66219 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66220 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66221 | if (!argv.resize(1)) { | ||||
| 66222 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66223 | // the right thing with that. | ||||
| 66224 | return; | ||||
| 66225 | } | ||||
| 66226 | unsigned argc = 1; | ||||
| 66227 | |||||
| 66228 | do { | ||||
| 66229 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66230 | if (arg.IsNull()) { | ||||
| 66231 | argv[0].setNull(); | ||||
| 66232 | break; | ||||
| 66233 | } | ||||
| 66234 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66235 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66236 | return; | ||||
| 66237 | } | ||||
| 66238 | break; | ||||
| 66239 | } while (false); | ||||
| 66240 | |||||
| 66241 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66242 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66243 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66244 | !InitIds(cx, atomsCache)) || | ||||
| 66245 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue12_id, &callable)) { | ||||
| 66246 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66247 | return; | ||||
| 66248 | } | ||||
| 66249 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66250 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66251 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66252 | aRv.NoteJSContextException(cx); | ||||
| 66253 | return; | ||||
| 66254 | } | ||||
| 66255 | } | ||||
| 66256 | |||||
| 66257 | void | ||||
| 66258 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66259 | { | ||||
| 66260 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66261 | if (aRv.Failed()) { | ||||
| 66262 | return; | ||||
| 66263 | } | ||||
| 66264 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66264); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66264; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66265 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66266 | |||||
| 66267 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66268 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66269 | if (!argv.resize(1)) { | ||||
| 66270 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66271 | // the right thing with that. | ||||
| 66272 | return; | ||||
| 66273 | } | ||||
| 66274 | unsigned argc = 1; | ||||
| 66275 | |||||
| 66276 | do { | ||||
| 66277 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66278 | if (arg.IsNull()) { | ||||
| 66279 | argv[0].setNull(); | ||||
| 66280 | break; | ||||
| 66281 | } | ||||
| 66282 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66283 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66284 | return; | ||||
| 66285 | } | ||||
| 66286 | break; | ||||
| 66287 | } while (false); | ||||
| 66288 | |||||
| 66289 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66290 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66291 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66292 | !InitIds(cx, atomsCache)) || | ||||
| 66293 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue13_id, &callable)) { | ||||
| 66294 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66295 | return; | ||||
| 66296 | } | ||||
| 66297 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66298 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66299 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66300 | aRv.NoteJSContextException(cx); | ||||
| 66301 | return; | ||||
| 66302 | } | ||||
| 66303 | } | ||||
| 66304 | |||||
| 66305 | void | ||||
| 66306 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66307 | { | ||||
| 66308 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66309 | if (aRv.Failed()) { | ||||
| 66310 | return; | ||||
| 66311 | } | ||||
| 66312 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66312); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66312; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66313 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66314 | |||||
| 66315 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66316 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66317 | if (!argv.resize(1)) { | ||||
| 66318 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66319 | // the right thing with that. | ||||
| 66320 | return; | ||||
| 66321 | } | ||||
| 66322 | unsigned argc = 1; | ||||
| 66323 | |||||
| 66324 | do { | ||||
| 66325 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66326 | if (arg.IsNull()) { | ||||
| 66327 | argv[0].setNull(); | ||||
| 66328 | break; | ||||
| 66329 | } | ||||
| 66330 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66331 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66332 | return; | ||||
| 66333 | } | ||||
| 66334 | break; | ||||
| 66335 | } while (false); | ||||
| 66336 | |||||
| 66337 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66338 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66339 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66340 | !InitIds(cx, atomsCache)) || | ||||
| 66341 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue14_id, &callable)) { | ||||
| 66342 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66343 | return; | ||||
| 66344 | } | ||||
| 66345 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66346 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66347 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66348 | aRv.NoteJSContextException(cx); | ||||
| 66349 | return; | ||||
| 66350 | } | ||||
| 66351 | } | ||||
| 66352 | |||||
| 66353 | void | ||||
| 66354 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66355 | { | ||||
| 66356 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66357 | if (aRv.Failed()) { | ||||
| 66358 | return; | ||||
| 66359 | } | ||||
| 66360 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66360); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66360; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66361 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66362 | |||||
| 66363 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66364 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66365 | if (!argv.resize(1)) { | ||||
| 66366 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66367 | // the right thing with that. | ||||
| 66368 | return; | ||||
| 66369 | } | ||||
| 66370 | unsigned argc = 1; | ||||
| 66371 | |||||
| 66372 | do { | ||||
| 66373 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66374 | if (arg.IsNull()) { | ||||
| 66375 | argv[0].setNull(); | ||||
| 66376 | break; | ||||
| 66377 | } | ||||
| 66378 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66379 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66380 | return; | ||||
| 66381 | } | ||||
| 66382 | break; | ||||
| 66383 | } while (false); | ||||
| 66384 | |||||
| 66385 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66386 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66387 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66388 | !InitIds(cx, atomsCache)) || | ||||
| 66389 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue15_id, &callable)) { | ||||
| 66390 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66391 | return; | ||||
| 66392 | } | ||||
| 66393 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66394 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66395 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66396 | aRv.NoteJSContextException(cx); | ||||
| 66397 | return; | ||||
| 66398 | } | ||||
| 66399 | } | ||||
| 66400 | |||||
| 66401 | void | ||||
| 66402 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66403 | { | ||||
| 66404 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66405 | if (aRv.Failed()) { | ||||
| 66406 | return; | ||||
| 66407 | } | ||||
| 66408 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66408); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66408; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66409 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66410 | |||||
| 66411 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66412 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66413 | if (!argv.resize(1)) { | ||||
| 66414 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66415 | // the right thing with that. | ||||
| 66416 | return; | ||||
| 66417 | } | ||||
| 66418 | unsigned argc = 1; | ||||
| 66419 | |||||
| 66420 | do { | ||||
| 66421 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66422 | if (arg.IsNull()) { | ||||
| 66423 | argv[0].setNull(); | ||||
| 66424 | break; | ||||
| 66425 | } | ||||
| 66426 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66427 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66428 | return; | ||||
| 66429 | } | ||||
| 66430 | break; | ||||
| 66431 | } while (false); | ||||
| 66432 | |||||
| 66433 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66434 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66435 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66436 | !InitIds(cx, atomsCache)) || | ||||
| 66437 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue16_id, &callable)) { | ||||
| 66438 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66439 | return; | ||||
| 66440 | } | ||||
| 66441 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66442 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66443 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66444 | aRv.NoteJSContextException(cx); | ||||
| 66445 | return; | ||||
| 66446 | } | ||||
| 66447 | } | ||||
| 66448 | |||||
| 66449 | void | ||||
| 66450 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66451 | { | ||||
| 66452 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66453 | if (aRv.Failed()) { | ||||
| 66454 | return; | ||||
| 66455 | } | ||||
| 66456 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66456); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66456; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66457 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66458 | |||||
| 66459 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66460 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66461 | if (!argv.resize(1)) { | ||||
| 66462 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66463 | // the right thing with that. | ||||
| 66464 | return; | ||||
| 66465 | } | ||||
| 66466 | unsigned argc = 1; | ||||
| 66467 | |||||
| 66468 | do { | ||||
| 66469 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66470 | if (arg.IsNull()) { | ||||
| 66471 | argv[0].setNull(); | ||||
| 66472 | break; | ||||
| 66473 | } | ||||
| 66474 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66475 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66476 | return; | ||||
| 66477 | } | ||||
| 66478 | break; | ||||
| 66479 | } while (false); | ||||
| 66480 | |||||
| 66481 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66482 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66483 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66484 | !InitIds(cx, atomsCache)) || | ||||
| 66485 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue17_id, &callable)) { | ||||
| 66486 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66487 | return; | ||||
| 66488 | } | ||||
| 66489 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66490 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66491 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66492 | aRv.NoteJSContextException(cx); | ||||
| 66493 | return; | ||||
| 66494 | } | ||||
| 66495 | } | ||||
| 66496 | |||||
| 66497 | void | ||||
| 66498 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66499 | { | ||||
| 66500 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66501 | if (aRv.Failed()) { | ||||
| 66502 | return; | ||||
| 66503 | } | ||||
| 66504 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66504); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66504; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66505 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66506 | |||||
| 66507 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66508 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66509 | if (!argv.resize(1)) { | ||||
| 66510 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66511 | // the right thing with that. | ||||
| 66512 | return; | ||||
| 66513 | } | ||||
| 66514 | unsigned argc = 1; | ||||
| 66515 | |||||
| 66516 | do { | ||||
| 66517 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66518 | if (arg.IsNull()) { | ||||
| 66519 | argv[0].setNull(); | ||||
| 66520 | break; | ||||
| 66521 | } | ||||
| 66522 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66523 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66524 | return; | ||||
| 66525 | } | ||||
| 66526 | break; | ||||
| 66527 | } while (false); | ||||
| 66528 | |||||
| 66529 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66530 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66531 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66532 | !InitIds(cx, atomsCache)) || | ||||
| 66533 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue18_id, &callable)) { | ||||
| 66534 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66535 | return; | ||||
| 66536 | } | ||||
| 66537 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66538 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66539 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66540 | aRv.NoteJSContextException(cx); | ||||
| 66541 | return; | ||||
| 66542 | } | ||||
| 66543 | } | ||||
| 66544 | |||||
| 66545 | void | ||||
| 66546 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66547 | { | ||||
| 66548 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66549 | if (aRv.Failed()) { | ||||
| 66550 | return; | ||||
| 66551 | } | ||||
| 66552 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66552); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66552; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66553 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66554 | |||||
| 66555 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66556 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66557 | if (!argv.resize(1)) { | ||||
| 66558 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66559 | // the right thing with that. | ||||
| 66560 | return; | ||||
| 66561 | } | ||||
| 66562 | unsigned argc = 1; | ||||
| 66563 | |||||
| 66564 | do { | ||||
| 66565 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66566 | if (arg.IsNull()) { | ||||
| 66567 | argv[0].setNull(); | ||||
| 66568 | break; | ||||
| 66569 | } | ||||
| 66570 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66571 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66572 | return; | ||||
| 66573 | } | ||||
| 66574 | break; | ||||
| 66575 | } while (false); | ||||
| 66576 | |||||
| 66577 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66578 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66579 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66580 | !InitIds(cx, atomsCache)) || | ||||
| 66581 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue19_id, &callable)) { | ||||
| 66582 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66583 | return; | ||||
| 66584 | } | ||||
| 66585 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66586 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66587 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66588 | aRv.NoteJSContextException(cx); | ||||
| 66589 | return; | ||||
| 66590 | } | ||||
| 66591 | } | ||||
| 66592 | |||||
| 66593 | void | ||||
| 66594 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66595 | { | ||||
| 66596 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66597 | if (aRv.Failed()) { | ||||
| 66598 | return; | ||||
| 66599 | } | ||||
| 66600 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66600); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66600; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66601 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66602 | |||||
| 66603 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66604 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66605 | if (!argv.resize(1)) { | ||||
| 66606 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66607 | // the right thing with that. | ||||
| 66608 | return; | ||||
| 66609 | } | ||||
| 66610 | unsigned argc = 1; | ||||
| 66611 | |||||
| 66612 | do { | ||||
| 66613 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66614 | if (arg.IsNull()) { | ||||
| 66615 | argv[0].setNull(); | ||||
| 66616 | break; | ||||
| 66617 | } | ||||
| 66618 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66619 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66620 | return; | ||||
| 66621 | } | ||||
| 66622 | break; | ||||
| 66623 | } while (false); | ||||
| 66624 | |||||
| 66625 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66626 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66627 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66628 | !InitIds(cx, atomsCache)) || | ||||
| 66629 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue20_id, &callable)) { | ||||
| 66630 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66631 | return; | ||||
| 66632 | } | ||||
| 66633 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66634 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66635 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66636 | aRv.NoteJSContextException(cx); | ||||
| 66637 | return; | ||||
| 66638 | } | ||||
| 66639 | } | ||||
| 66640 | |||||
| 66641 | void | ||||
| 66642 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66643 | { | ||||
| 66644 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66645 | if (aRv.Failed()) { | ||||
| 66646 | return; | ||||
| 66647 | } | ||||
| 66648 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66648); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66648; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66649 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66650 | |||||
| 66651 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66652 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66653 | if (!argv.resize(1)) { | ||||
| 66654 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66655 | // the right thing with that. | ||||
| 66656 | return; | ||||
| 66657 | } | ||||
| 66658 | unsigned argc = 1; | ||||
| 66659 | |||||
| 66660 | do { | ||||
| 66661 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66662 | if (arg.IsNull()) { | ||||
| 66663 | argv[0].setNull(); | ||||
| 66664 | break; | ||||
| 66665 | } | ||||
| 66666 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66667 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66668 | return; | ||||
| 66669 | } | ||||
| 66670 | break; | ||||
| 66671 | } while (false); | ||||
| 66672 | |||||
| 66673 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66674 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66675 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66676 | !InitIds(cx, atomsCache)) || | ||||
| 66677 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue21_id, &callable)) { | ||||
| 66678 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66679 | return; | ||||
| 66680 | } | ||||
| 66681 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66682 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66683 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66684 | aRv.NoteJSContextException(cx); | ||||
| 66685 | return; | ||||
| 66686 | } | ||||
| 66687 | } | ||||
| 66688 | |||||
| 66689 | void | ||||
| 66690 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66691 | { | ||||
| 66692 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66693 | if (aRv.Failed()) { | ||||
| 66694 | return; | ||||
| 66695 | } | ||||
| 66696 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66696); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66696; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66697 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66698 | |||||
| 66699 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66700 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66701 | if (!argv.resize(1)) { | ||||
| 66702 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66703 | // the right thing with that. | ||||
| 66704 | return; | ||||
| 66705 | } | ||||
| 66706 | unsigned argc = 1; | ||||
| 66707 | |||||
| 66708 | do { | ||||
| 66709 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66710 | if (arg.IsNull()) { | ||||
| 66711 | argv[0].setNull(); | ||||
| 66712 | break; | ||||
| 66713 | } | ||||
| 66714 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66715 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66716 | return; | ||||
| 66717 | } | ||||
| 66718 | break; | ||||
| 66719 | } while (false); | ||||
| 66720 | |||||
| 66721 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66722 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66723 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66724 | !InitIds(cx, atomsCache)) || | ||||
| 66725 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue22_id, &callable)) { | ||||
| 66726 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66727 | return; | ||||
| 66728 | } | ||||
| 66729 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66730 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66731 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66732 | aRv.NoteJSContextException(cx); | ||||
| 66733 | return; | ||||
| 66734 | } | ||||
| 66735 | } | ||||
| 66736 | |||||
| 66737 | void | ||||
| 66738 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66739 | { | ||||
| 66740 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66741 | if (aRv.Failed()) { | ||||
| 66742 | return; | ||||
| 66743 | } | ||||
| 66744 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66744); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66744; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66745 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66746 | |||||
| 66747 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66748 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66749 | if (!argv.resize(1)) { | ||||
| 66750 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66751 | // the right thing with that. | ||||
| 66752 | return; | ||||
| 66753 | } | ||||
| 66754 | unsigned argc = 1; | ||||
| 66755 | |||||
| 66756 | do { | ||||
| 66757 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66758 | if (arg.IsNull()) { | ||||
| 66759 | argv[0].setNull(); | ||||
| 66760 | break; | ||||
| 66761 | } | ||||
| 66762 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66763 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66764 | return; | ||||
| 66765 | } | ||||
| 66766 | break; | ||||
| 66767 | } while (false); | ||||
| 66768 | |||||
| 66769 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66770 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66771 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66772 | !InitIds(cx, atomsCache)) || | ||||
| 66773 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue23_id, &callable)) { | ||||
| 66774 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66775 | return; | ||||
| 66776 | } | ||||
| 66777 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66778 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66779 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66780 | aRv.NoteJSContextException(cx); | ||||
| 66781 | return; | ||||
| 66782 | } | ||||
| 66783 | } | ||||
| 66784 | |||||
| 66785 | void | ||||
| 66786 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66787 | { | ||||
| 66788 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66789 | if (aRv.Failed()) { | ||||
| 66790 | return; | ||||
| 66791 | } | ||||
| 66792 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66792); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66792; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66793 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66794 | |||||
| 66795 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66796 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66797 | if (!argv.resize(1)) { | ||||
| 66798 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66799 | // the right thing with that. | ||||
| 66800 | return; | ||||
| 66801 | } | ||||
| 66802 | unsigned argc = 1; | ||||
| 66803 | |||||
| 66804 | do { | ||||
| 66805 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66806 | if (arg.IsNull()) { | ||||
| 66807 | argv[0].setNull(); | ||||
| 66808 | break; | ||||
| 66809 | } | ||||
| 66810 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66811 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66812 | return; | ||||
| 66813 | } | ||||
| 66814 | break; | ||||
| 66815 | } while (false); | ||||
| 66816 | |||||
| 66817 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66818 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66819 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66820 | !InitIds(cx, atomsCache)) || | ||||
| 66821 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue24_id, &callable)) { | ||||
| 66822 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66823 | return; | ||||
| 66824 | } | ||||
| 66825 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66826 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66827 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66828 | aRv.NoteJSContextException(cx); | ||||
| 66829 | return; | ||||
| 66830 | } | ||||
| 66831 | } | ||||
| 66832 | |||||
| 66833 | void | ||||
| 66834 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66835 | { | ||||
| 66836 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66837 | if (aRv.Failed()) { | ||||
| 66838 | return; | ||||
| 66839 | } | ||||
| 66840 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66840); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66840; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66841 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66842 | |||||
| 66843 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66844 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66845 | if (!argv.resize(1)) { | ||||
| 66846 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66847 | // the right thing with that. | ||||
| 66848 | return; | ||||
| 66849 | } | ||||
| 66850 | unsigned argc = 1; | ||||
| 66851 | |||||
| 66852 | do { | ||||
| 66853 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66854 | if (arg.IsNull()) { | ||||
| 66855 | argv[0].setNull(); | ||||
| 66856 | break; | ||||
| 66857 | } | ||||
| 66858 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66859 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66860 | return; | ||||
| 66861 | } | ||||
| 66862 | break; | ||||
| 66863 | } while (false); | ||||
| 66864 | |||||
| 66865 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66866 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66867 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66868 | !InitIds(cx, atomsCache)) || | ||||
| 66869 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue25_id, &callable)) { | ||||
| 66870 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66871 | return; | ||||
| 66872 | } | ||||
| 66873 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66874 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66875 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66876 | aRv.NoteJSContextException(cx); | ||||
| 66877 | return; | ||||
| 66878 | } | ||||
| 66879 | } | ||||
| 66880 | |||||
| 66881 | void | ||||
| 66882 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66883 | { | ||||
| 66884 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue26", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66885 | if (aRv.Failed()) { | ||||
| 66886 | return; | ||||
| 66887 | } | ||||
| 66888 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66888); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66888; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66889 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66890 | |||||
| 66891 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66892 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66893 | if (!argv.resize(1)) { | ||||
| 66894 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66895 | // the right thing with that. | ||||
| 66896 | return; | ||||
| 66897 | } | ||||
| 66898 | unsigned argc = 1; | ||||
| 66899 | |||||
| 66900 | do { | ||||
| 66901 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66902 | if (arg.IsNull()) { | ||||
| 66903 | argv[0].setNull(); | ||||
| 66904 | break; | ||||
| 66905 | } | ||||
| 66906 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66907 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66908 | return; | ||||
| 66909 | } | ||||
| 66910 | break; | ||||
| 66911 | } while (false); | ||||
| 66912 | |||||
| 66913 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66914 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66915 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66916 | !InitIds(cx, atomsCache)) || | ||||
| 66917 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue26_id, &callable)) { | ||||
| 66918 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66919 | return; | ||||
| 66920 | } | ||||
| 66921 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66922 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66923 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66924 | aRv.NoteJSContextException(cx); | ||||
| 66925 | return; | ||||
| 66926 | } | ||||
| 66927 | } | ||||
| 66928 | |||||
| 66929 | void | ||||
| 66930 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66931 | { | ||||
| 66932 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue27", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66933 | if (aRv.Failed()) { | ||||
| 66934 | return; | ||||
| 66935 | } | ||||
| 66936 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66936); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66936; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66937 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66938 | |||||
| 66939 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66940 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66941 | if (!argv.resize(1)) { | ||||
| 66942 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66943 | // the right thing with that. | ||||
| 66944 | return; | ||||
| 66945 | } | ||||
| 66946 | unsigned argc = 1; | ||||
| 66947 | |||||
| 66948 | do { | ||||
| 66949 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66950 | if (arg.IsNull()) { | ||||
| 66951 | argv[0].setNull(); | ||||
| 66952 | break; | ||||
| 66953 | } | ||||
| 66954 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 66955 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66956 | return; | ||||
| 66957 | } | ||||
| 66958 | break; | ||||
| 66959 | } while (false); | ||||
| 66960 | |||||
| 66961 | JS::Rooted<JS::Value> callable(cx); | ||||
| 66962 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 66963 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 66964 | !InitIds(cx, atomsCache)) || | ||||
| 66965 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue27_id, &callable)) { | ||||
| 66966 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 66967 | return; | ||||
| 66968 | } | ||||
| 66969 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 66970 | if (!JS::Call(cx, thisValue, callable, | ||||
| 66971 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 66972 | aRv.NoteJSContextException(cx); | ||||
| 66973 | return; | ||||
| 66974 | } | ||||
| 66975 | } | ||||
| 66976 | |||||
| 66977 | void | ||||
| 66978 | TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 66979 | { | ||||
| 66980 | CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue28", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 66981 | if (aRv.Failed()) { | ||||
| 66982 | return; | ||||
| 66983 | } | ||||
| 66984 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 66984); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 66984; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 66985 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 66986 | |||||
| 66987 | JS::Rooted<JS::Value> rval(cx); | ||||
| 66988 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 66989 | if (!argv.resize(1)) { | ||||
| 66990 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 66991 | // the right thing with that. | ||||
| 66992 | return; | ||||
| 66993 | } | ||||
| 66994 | unsigned argc = 1; | ||||
| 66995 | |||||
| 66996 | do { | ||||
| 66997 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 66998 | if (arg.IsNull()) { | ||||
| 66999 | argv[0].setNull(); | ||||
| 67000 | break; | ||||
| 67001 | } | ||||
| 67002 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 67003 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67004 | return; | ||||
| 67005 | } | ||||
| 67006 | break; | ||||
| 67007 | } while (false); | ||||
| 67008 | |||||
| 67009 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67010 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67011 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67012 | !InitIds(cx, atomsCache)) || | ||||
| 67013 | !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue28_id, &callable)) { | ||||
| 67014 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67015 | return; | ||||
| 67016 | } | ||||
| 67017 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67018 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67019 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67020 | aRv.NoteJSContextException(cx); | ||||
| 67021 | return; | ||||
| 67022 | } | ||||
| 67023 | } | ||||
| 67024 | |||||
| 67025 | void | ||||
| 67026 | TestJSImplInterfaceJSImpl::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67027 | { | ||||
| 67028 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67029 | if (aRv.Failed()) { | ||||
| 67030 | return; | ||||
| 67031 | } | ||||
| 67032 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67032); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67032; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67033 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67034 | |||||
| 67035 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67036 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67037 | if (!argv.resize(1)) { | ||||
| 67038 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67039 | // the right thing with that. | ||||
| 67040 | return; | ||||
| 67041 | } | ||||
| 67042 | unsigned argc = 1; | ||||
| 67043 | |||||
| 67044 | do { | ||||
| 67045 | |||||
| 67046 | uint32_t length = arg.Length(); | ||||
| 67047 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 67048 | if (!returnArray) { | ||||
| 67049 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67050 | return; | ||||
| 67051 | } | ||||
| 67052 | // Scope for 'tmp' | ||||
| 67053 | { | ||||
| 67054 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 67055 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 67056 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 67057 | // are different ways to succeed at wrapping the object. | ||||
| 67058 | do { | ||||
| 67059 | if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) { | ||||
| 67060 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67061 | return; | ||||
| 67062 | } | ||||
| 67063 | break; | ||||
| 67064 | } while (false); | ||||
| 67065 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 67066 | JSPROP_ENUMERATE)) { | ||||
| 67067 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67068 | return; | ||||
| 67069 | } | ||||
| 67070 | } | ||||
| 67071 | } | ||||
| 67072 | argv[0].setObject(*returnArray); | ||||
| 67073 | break; | ||||
| 67074 | } while (false); | ||||
| 67075 | |||||
| 67076 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67077 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67078 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67079 | !InitIds(cx, atomsCache)) || | ||||
| 67080 | !GetCallableProperty(cx, atomsCache->passSequenceOfUnions_id, &callable)) { | ||||
| 67081 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67082 | return; | ||||
| 67083 | } | ||||
| 67084 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67085 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67086 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67087 | aRv.NoteJSContextException(cx); | ||||
| 67088 | return; | ||||
| 67089 | } | ||||
| 67090 | } | ||||
| 67091 | |||||
| 67092 | void | ||||
| 67093 | TestJSImplInterfaceJSImpl::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67094 | { | ||||
| 67095 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67096 | if (aRv.Failed()) { | ||||
| 67097 | return; | ||||
| 67098 | } | ||||
| 67099 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67099); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67099; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67100 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67101 | |||||
| 67102 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67103 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67104 | if (!argv.resize(1)) { | ||||
| 67105 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67106 | // the right thing with that. | ||||
| 67107 | return; | ||||
| 67108 | } | ||||
| 67109 | unsigned argc = 1; | ||||
| 67110 | |||||
| 67111 | do { | ||||
| 67112 | |||||
| 67113 | uint32_t length = arg.Length(); | ||||
| 67114 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 67115 | if (!returnArray) { | ||||
| 67116 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67117 | return; | ||||
| 67118 | } | ||||
| 67119 | // Scope for 'tmp' | ||||
| 67120 | { | ||||
| 67121 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 67122 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 67123 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 67124 | // are different ways to succeed at wrapping the object. | ||||
| 67125 | do { | ||||
| 67126 | if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) { | ||||
| 67127 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67128 | return; | ||||
| 67129 | } | ||||
| 67130 | break; | ||||
| 67131 | } while (false); | ||||
| 67132 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 67133 | JSPROP_ENUMERATE)) { | ||||
| 67134 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67135 | return; | ||||
| 67136 | } | ||||
| 67137 | } | ||||
| 67138 | } | ||||
| 67139 | argv[0].setObject(*returnArray); | ||||
| 67140 | break; | ||||
| 67141 | } while (false); | ||||
| 67142 | |||||
| 67143 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67144 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67145 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67146 | !InitIds(cx, atomsCache)) || | ||||
| 67147 | !GetCallableProperty(cx, atomsCache->passSequenceOfUnions2_id, &callable)) { | ||||
| 67148 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67149 | return; | ||||
| 67150 | } | ||||
| 67151 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67152 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67153 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67154 | aRv.NoteJSContextException(cx); | ||||
| 67155 | return; | ||||
| 67156 | } | ||||
| 67157 | } | ||||
| 67158 | |||||
| 67159 | void | ||||
| 67160 | TestJSImplInterfaceJSImpl::PassVariadicUnion(const nsTArray<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67161 | { | ||||
| 67162 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67163 | if (aRv.Failed()) { | ||||
| 67164 | return; | ||||
| 67165 | } | ||||
| 67166 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67166; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67167 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67168 | |||||
| 67169 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67170 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67171 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 67172 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67173 | // the right thing with that. | ||||
| 67174 | return; | ||||
| 67175 | } | ||||
| 67176 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 67177 | |||||
| 67178 | do { | ||||
| 67179 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 67180 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 67181 | if (!arg[idx].ToJSVal(cx, callbackObj, argv[0 + idx])) { | ||||
| 67182 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67183 | return; | ||||
| 67184 | } | ||||
| 67185 | continue; | ||||
| 67186 | } | ||||
| 67187 | break; | ||||
| 67188 | } while (false); | ||||
| 67189 | |||||
| 67190 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67191 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67192 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67193 | !InitIds(cx, atomsCache)) || | ||||
| 67194 | !GetCallableProperty(cx, atomsCache->passVariadicUnion_id, &callable)) { | ||||
| 67195 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67196 | return; | ||||
| 67197 | } | ||||
| 67198 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67199 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67200 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67201 | aRv.NoteJSContextException(cx); | ||||
| 67202 | return; | ||||
| 67203 | } | ||||
| 67204 | } | ||||
| 67205 | |||||
| 67206 | void | ||||
| 67207 | TestJSImplInterfaceJSImpl::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67208 | { | ||||
| 67209 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67210 | if (aRv.Failed()) { | ||||
| 67211 | return; | ||||
| 67212 | } | ||||
| 67213 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67213); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67213; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67214 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67215 | |||||
| 67216 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67217 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67218 | if (!argv.resize(1)) { | ||||
| 67219 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67220 | // the right thing with that. | ||||
| 67221 | return; | ||||
| 67222 | } | ||||
| 67223 | unsigned argc = 1; | ||||
| 67224 | |||||
| 67225 | do { | ||||
| 67226 | |||||
| 67227 | uint32_t length = arg.Length(); | ||||
| 67228 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 67229 | if (!returnArray) { | ||||
| 67230 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67231 | return; | ||||
| 67232 | } | ||||
| 67233 | // Scope for 'tmp' | ||||
| 67234 | { | ||||
| 67235 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 67236 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 67237 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 67238 | // are different ways to succeed at wrapping the object. | ||||
| 67239 | do { | ||||
| 67240 | if (arg[sequenceIdx0].IsNull()) { | ||||
| 67241 | tmp.setNull(); | ||||
| 67242 | break; | ||||
| 67243 | } | ||||
| 67244 | if (!arg[sequenceIdx0].Value().ToJSVal(cx, returnArray, &tmp)) { | ||||
| 67245 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67246 | return; | ||||
| 67247 | } | ||||
| 67248 | break; | ||||
| 67249 | } while (false); | ||||
| 67250 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 67251 | JSPROP_ENUMERATE)) { | ||||
| 67252 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67253 | return; | ||||
| 67254 | } | ||||
| 67255 | } | ||||
| 67256 | } | ||||
| 67257 | argv[0].setObject(*returnArray); | ||||
| 67258 | break; | ||||
| 67259 | } while (false); | ||||
| 67260 | |||||
| 67261 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67262 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67263 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67264 | !InitIds(cx, atomsCache)) || | ||||
| 67265 | !GetCallableProperty(cx, atomsCache->passSequenceOfNullableUnions_id, &callable)) { | ||||
| 67266 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67267 | return; | ||||
| 67268 | } | ||||
| 67269 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67270 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67271 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67272 | aRv.NoteJSContextException(cx); | ||||
| 67273 | return; | ||||
| 67274 | } | ||||
| 67275 | } | ||||
| 67276 | |||||
| 67277 | void | ||||
| 67278 | TestJSImplInterfaceJSImpl::PassVariadicNullableUnion(const nsTArray<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67279 | { | ||||
| 67280 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67281 | if (aRv.Failed()) { | ||||
| 67282 | return; | ||||
| 67283 | } | ||||
| 67284 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67284); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67284; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67285 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67286 | |||||
| 67287 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67288 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67289 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 67290 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67291 | // the right thing with that. | ||||
| 67292 | return; | ||||
| 67293 | } | ||||
| 67294 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 67295 | |||||
| 67296 | do { | ||||
| 67297 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 67298 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 67299 | if (arg[idx].IsNull()) { | ||||
| 67300 | argv[0 + idx].setNull(); | ||||
| 67301 | continue; | ||||
| 67302 | } | ||||
| 67303 | if (!arg[idx].Value().ToJSVal(cx, callbackObj, argv[0 + idx])) { | ||||
| 67304 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67305 | return; | ||||
| 67306 | } | ||||
| 67307 | continue; | ||||
| 67308 | } | ||||
| 67309 | break; | ||||
| 67310 | } while (false); | ||||
| 67311 | |||||
| 67312 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67313 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67314 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67315 | !InitIds(cx, atomsCache)) || | ||||
| 67316 | !GetCallableProperty(cx, atomsCache->passVariadicNullableUnion_id, &callable)) { | ||||
| 67317 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67318 | return; | ||||
| 67319 | } | ||||
| 67320 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67321 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67322 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67323 | aRv.NoteJSContextException(cx); | ||||
| 67324 | return; | ||||
| 67325 | } | ||||
| 67326 | } | ||||
| 67327 | |||||
| 67328 | void | ||||
| 67329 | TestJSImplInterfaceJSImpl::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67330 | { | ||||
| 67331 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67332 | if (aRv.Failed()) { | ||||
| 67333 | return; | ||||
| 67334 | } | ||||
| 67335 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67335); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67335; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67336 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67337 | |||||
| 67338 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67339 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67340 | if (!argv.resize(1)) { | ||||
| 67341 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67342 | // the right thing with that. | ||||
| 67343 | return; | ||||
| 67344 | } | ||||
| 67345 | unsigned argc = 1; | ||||
| 67346 | |||||
| 67347 | do { | ||||
| 67348 | |||||
| 67349 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 67350 | if (!returnObj) { | ||||
| 67351 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67352 | return; | ||||
| 67353 | } | ||||
| 67354 | // Scope for 'tmp' | ||||
| 67355 | { | ||||
| 67356 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 67357 | for (auto& entry : arg.Entries()) { | ||||
| 67358 | auto& recordValue0 = entry.mValue; | ||||
| 67359 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 67360 | // are different ways to succeed at wrapping the value. | ||||
| 67361 | do { | ||||
| 67362 | if (!recordValue0.ToJSVal(cx, returnObj, &tmp)) { | ||||
| 67363 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67364 | return; | ||||
| 67365 | } | ||||
| 67366 | break; | ||||
| 67367 | } while (false); | ||||
| 67368 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 67369 | entry.mKey.BeginReading(), | ||||
| 67370 | entry.mKey.Length(), tmp, | ||||
| 67371 | JSPROP_ENUMERATE)) { | ||||
| 67372 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67373 | return; | ||||
| 67374 | } | ||||
| 67375 | } | ||||
| 67376 | } | ||||
| 67377 | argv[0].setObject(*returnObj); | ||||
| 67378 | break; | ||||
| 67379 | } while (false); | ||||
| 67380 | |||||
| 67381 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67382 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67383 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67384 | !InitIds(cx, atomsCache)) || | ||||
| 67385 | !GetCallableProperty(cx, atomsCache->passRecordOfUnions_id, &callable)) { | ||||
| 67386 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67387 | return; | ||||
| 67388 | } | ||||
| 67389 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67390 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67391 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67392 | aRv.NoteJSContextException(cx); | ||||
| 67393 | return; | ||||
| 67394 | } | ||||
| 67395 | } | ||||
| 67396 | |||||
| 67397 | void | ||||
| 67398 | TestJSImplInterfaceJSImpl::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67399 | { | ||||
| 67400 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67401 | if (aRv.Failed()) { | ||||
| 67402 | return; | ||||
| 67403 | } | ||||
| 67404 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67404); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67404; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67405 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67406 | |||||
| 67407 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67408 | |||||
| 67409 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67410 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67411 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67412 | !InitIds(cx, atomsCache)) || | ||||
| 67413 | !GetCallableProperty(cx, atomsCache->receiveUnion_id, &callable)) { | ||||
| 67414 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67415 | return; | ||||
| 67416 | } | ||||
| 67417 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67418 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67419 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67420 | aRv.NoteJSContextException(cx); | ||||
| 67421 | return; | ||||
| 67422 | } | ||||
| 67423 | OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal); | ||||
| 67424 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion", false)) { | ||||
| 67425 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67426 | return; | ||||
| 67427 | } | ||||
| 67428 | } | ||||
| 67429 | |||||
| 67430 | void | ||||
| 67431 | TestJSImplInterfaceJSImpl::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67432 | { | ||||
| 67433 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67434 | if (aRv.Failed()) { | ||||
| 67435 | return; | ||||
| 67436 | } | ||||
| 67437 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67437); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67437; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67438 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67439 | |||||
| 67440 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67441 | |||||
| 67442 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67443 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67444 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67445 | !InitIds(cx, atomsCache)) || | ||||
| 67446 | !GetCallableProperty(cx, atomsCache->receiveUnion2_id, &callable)) { | ||||
| 67447 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67448 | return; | ||||
| 67449 | } | ||||
| 67450 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67451 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67452 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67453 | aRv.NoteJSContextException(cx); | ||||
| 67454 | return; | ||||
| 67455 | } | ||||
| 67456 | OwningObjectOrLong& rvalDecl(aRetVal); | ||||
| 67457 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion2", false)) { | ||||
| 67458 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67459 | return; | ||||
| 67460 | } | ||||
| 67461 | } | ||||
| 67462 | |||||
| 67463 | void | ||||
| 67464 | TestJSImplInterfaceJSImpl::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67465 | { | ||||
| 67466 | CallSetup s(this, aRv, "TestJSImplInterface.receiveUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67467 | if (aRv.Failed()) { | ||||
| 67468 | return; | ||||
| 67469 | } | ||||
| 67470 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67470); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67470; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67471 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67472 | |||||
| 67473 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67474 | |||||
| 67475 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67476 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67477 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67478 | !InitIds(cx, atomsCache)) || | ||||
| 67479 | !GetCallableProperty(cx, atomsCache->receiveUnionContainingNull_id, &callable)) { | ||||
| 67480 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67481 | return; | ||||
| 67482 | } | ||||
| 67483 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67484 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67485 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67486 | aRv.NoteJSContextException(cx); | ||||
| 67487 | return; | ||||
| 67488 | } | ||||
| 67489 | OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal); | ||||
| 67490 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnionContainingNull", false)) { | ||||
| 67491 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67492 | return; | ||||
| 67493 | } | ||||
| 67494 | } | ||||
| 67495 | |||||
| 67496 | void | ||||
| 67497 | TestJSImplInterfaceJSImpl::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67498 | { | ||||
| 67499 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67500 | if (aRv.Failed()) { | ||||
| 67501 | return; | ||||
| 67502 | } | ||||
| 67503 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67503); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67503; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67504 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67505 | |||||
| 67506 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67507 | |||||
| 67508 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67509 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67510 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67511 | !InitIds(cx, atomsCache)) || | ||||
| 67512 | !GetCallableProperty(cx, atomsCache->receiveNullableUnion_id, &callable)) { | ||||
| 67513 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67514 | return; | ||||
| 67515 | } | ||||
| 67516 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67517 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67518 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67519 | aRv.NoteJSContextException(cx); | ||||
| 67520 | return; | ||||
| 67521 | } | ||||
| 67522 | Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal); | ||||
| 67523 | if (rval.isNullOrUndefined()) { | ||||
| 67524 | rvalDecl.SetNull(); | ||||
| 67525 | } else { | ||||
| 67526 | if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion", false)) { | ||||
| 67527 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67528 | return; | ||||
| 67529 | } | ||||
| 67530 | } | ||||
| 67531 | } | ||||
| 67532 | |||||
| 67533 | void | ||||
| 67534 | TestJSImplInterfaceJSImpl::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67535 | { | ||||
| 67536 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67537 | if (aRv.Failed()) { | ||||
| 67538 | return; | ||||
| 67539 | } | ||||
| 67540 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67540); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67540; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67541 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67542 | |||||
| 67543 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67544 | |||||
| 67545 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67546 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67547 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67548 | !InitIds(cx, atomsCache)) || | ||||
| 67549 | !GetCallableProperty(cx, atomsCache->receiveNullableUnion2_id, &callable)) { | ||||
| 67550 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67551 | return; | ||||
| 67552 | } | ||||
| 67553 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67554 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67555 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67556 | aRv.NoteJSContextException(cx); | ||||
| 67557 | return; | ||||
| 67558 | } | ||||
| 67559 | Nullable<OwningObjectOrLong >& rvalDecl(aRetVal); | ||||
| 67560 | if (rval.isNullOrUndefined()) { | ||||
| 67561 | rvalDecl.SetNull(); | ||||
| 67562 | } else { | ||||
| 67563 | if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion2", false)) { | ||||
| 67564 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67565 | return; | ||||
| 67566 | } | ||||
| 67567 | } | ||||
| 67568 | } | ||||
| 67569 | |||||
| 67570 | void | ||||
| 67571 | TestJSImplInterfaceJSImpl::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67572 | { | ||||
| 67573 | CallSetup s(this, aRv, "TestJSImplInterface.passPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67574 | if (aRv.Failed()) { | ||||
| 67575 | return; | ||||
| 67576 | } | ||||
| 67577 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67577); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67577; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67578 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67579 | |||||
| 67580 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67581 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67582 | if (!argv.resize(1)) { | ||||
| 67583 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67584 | // the right thing with that. | ||||
| 67585 | return; | ||||
| 67586 | } | ||||
| 67587 | unsigned argc = 1; | ||||
| 67588 | |||||
| 67589 | do { | ||||
| 67590 | if (!ToJSValue(cx, arg, argv[0])) { | ||||
| 67591 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67592 | return; | ||||
| 67593 | } | ||||
| 67594 | break; | ||||
| 67595 | } while (false); | ||||
| 67596 | |||||
| 67597 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67598 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67599 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67600 | !InitIds(cx, atomsCache)) || | ||||
| 67601 | !GetCallableProperty(cx, atomsCache->passPromise_id, &callable)) { | ||||
| 67602 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67603 | return; | ||||
| 67604 | } | ||||
| 67605 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67606 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67607 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67608 | aRv.NoteJSContextException(cx); | ||||
| 67609 | return; | ||||
| 67610 | } | ||||
| 67611 | } | ||||
| 67612 | |||||
| 67613 | void | ||||
| 67614 | TestJSImplInterfaceJSImpl::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67615 | { | ||||
| 67616 | CallSetup s(this, aRv, "TestJSImplInterface.passOptionalPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67617 | if (aRv.Failed()) { | ||||
| 67618 | return; | ||||
| 67619 | } | ||||
| 67620 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67620); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67620; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67621 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67622 | |||||
| 67623 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67624 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67625 | if (!argv.resize(1)) { | ||||
| 67626 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67627 | // the right thing with that. | ||||
| 67628 | return; | ||||
| 67629 | } | ||||
| 67630 | unsigned argc = 1; | ||||
| 67631 | |||||
| 67632 | do { | ||||
| 67633 | if (arg.WasPassed()) { | ||||
| 67634 | if (!ToJSValue(cx, arg.Value(), argv[0])) { | ||||
| 67635 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67636 | return; | ||||
| 67637 | } | ||||
| 67638 | break; | ||||
| 67639 | } else if (argc == 1) { | ||||
| 67640 | // This is our current trailing argument; reduce argc | ||||
| 67641 | --argc; | ||||
| 67642 | } else { | ||||
| 67643 | argv[0].setUndefined(); | ||||
| 67644 | } | ||||
| 67645 | } while (false); | ||||
| 67646 | |||||
| 67647 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67648 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67649 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67650 | !InitIds(cx, atomsCache)) || | ||||
| 67651 | !GetCallableProperty(cx, atomsCache->passOptionalPromise_id, &callable)) { | ||||
| 67652 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67653 | return; | ||||
| 67654 | } | ||||
| 67655 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67656 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67657 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67658 | aRv.NoteJSContextException(cx); | ||||
| 67659 | return; | ||||
| 67660 | } | ||||
| 67661 | } | ||||
| 67662 | |||||
| 67663 | void | ||||
| 67664 | TestJSImplInterfaceJSImpl::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67665 | { | ||||
| 67666 | CallSetup s(this, aRv, "TestJSImplInterface.passPromiseSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67667 | if (aRv.Failed()) { | ||||
| 67668 | return; | ||||
| 67669 | } | ||||
| 67670 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67670); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67670; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67671 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67672 | |||||
| 67673 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67674 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67675 | if (!argv.resize(1)) { | ||||
| 67676 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67677 | // the right thing with that. | ||||
| 67678 | return; | ||||
| 67679 | } | ||||
| 67680 | unsigned argc = 1; | ||||
| 67681 | |||||
| 67682 | do { | ||||
| 67683 | |||||
| 67684 | uint32_t length = arg.Length(); | ||||
| 67685 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 67686 | if (!returnArray) { | ||||
| 67687 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67688 | return; | ||||
| 67689 | } | ||||
| 67690 | // Scope for 'tmp' | ||||
| 67691 | { | ||||
| 67692 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 67693 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 67694 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 67695 | // are different ways to succeed at wrapping the object. | ||||
| 67696 | do { | ||||
| 67697 | if (!ToJSValue(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 67698 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67699 | return; | ||||
| 67700 | } | ||||
| 67701 | break; | ||||
| 67702 | } while (false); | ||||
| 67703 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 67704 | JSPROP_ENUMERATE)) { | ||||
| 67705 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67706 | return; | ||||
| 67707 | } | ||||
| 67708 | } | ||||
| 67709 | } | ||||
| 67710 | argv[0].setObject(*returnArray); | ||||
| 67711 | break; | ||||
| 67712 | } while (false); | ||||
| 67713 | |||||
| 67714 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67715 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67716 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67717 | !InitIds(cx, atomsCache)) || | ||||
| 67718 | !GetCallableProperty(cx, atomsCache->passPromiseSequence_id, &callable)) { | ||||
| 67719 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67720 | return; | ||||
| 67721 | } | ||||
| 67722 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67723 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67724 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67725 | aRv.NoteJSContextException(cx); | ||||
| 67726 | return; | ||||
| 67727 | } | ||||
| 67728 | } | ||||
| 67729 | |||||
| 67730 | already_AddRefed<Promise> | ||||
| 67731 | TestJSImplInterfaceJSImpl::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67732 | { | ||||
| 67733 | CallSetup s(this, aRv, "TestJSImplInterface.receivePromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67734 | if (aRv.Failed()) { | ||||
| 67735 | return nullptr; | ||||
| 67736 | } | ||||
| 67737 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67737); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67737; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67738 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67739 | |||||
| 67740 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67741 | |||||
| 67742 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67743 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67744 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67745 | !InitIds(cx, atomsCache)) || | ||||
| 67746 | !GetCallableProperty(cx, atomsCache->receivePromise_id, &callable)) { | ||||
| 67747 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67748 | return nullptr; | ||||
| 67749 | } | ||||
| 67750 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67751 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67752 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67753 | aRv.NoteJSContextException(cx); | ||||
| 67754 | return nullptr; | ||||
| 67755 | } | ||||
| 67756 | RefPtr<Promise> rvalDecl; | ||||
| 67757 | { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm, | ||||
| 67758 | // etc. | ||||
| 67759 | |||||
| 67760 | JS::Rooted<JSObject*> globalObj(cx); | ||||
| 67761 | if (!rval.isObject()) { | ||||
| 67762 | aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise"); | ||||
| 67763 | return nullptr; | ||||
| 67764 | } | ||||
| 67765 | JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject()); | ||||
| 67766 | if (!unwrappedVal) { | ||||
| 67767 | // A slight lie, but not much of one, for a dead object wrapper. | ||||
| 67768 | aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise"); | ||||
| 67769 | return nullptr; | ||||
| 67770 | } | ||||
| 67771 | globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal); | ||||
| 67772 | JSAutoRealm ar(cx, globalObj); | ||||
| 67773 | GlobalObject promiseGlobal(cx, globalObj); | ||||
| 67774 | if (promiseGlobal.Failed()) { | ||||
| 67775 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67776 | return nullptr; | ||||
| 67777 | } | ||||
| 67778 | |||||
| 67779 | JS::Rooted<JS::Value> valueToResolve(cx, rval); | ||||
| 67780 | if (!JS_WrapValue(cx, &valueToResolve)) { | ||||
| 67781 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67782 | return nullptr; | ||||
| 67783 | } | ||||
| 67784 | binding_detail::FastErrorResult promiseRv; | ||||
| 67785 | nsCOMPtr<nsIGlobalObject> global = | ||||
| 67786 | do_QueryInterface(promiseGlobal.GetAsSupports()); | ||||
| 67787 | if (!global) { | ||||
| 67788 | promiseRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67789 | 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" , 67789); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)" ")"); do { *((volatile int*)__null) = 67789; __attribute__(( nomerge)) ::abort(); } while (false); } while (false); } } while (false); | ||||
| 67790 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67791 | return nullptr; | ||||
| 67792 | } | ||||
| 67793 | rvalDecl = Promise::Resolve(global, cx, valueToResolve, | ||||
| 67794 | promiseRv); | ||||
| 67795 | if (promiseRv.MaybeSetPendingException(cx)) { | ||||
| 67796 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67797 | return nullptr; | ||||
| 67798 | } | ||||
| 67799 | } | ||||
| 67800 | return rvalDecl.forget(); | ||||
| 67801 | } | ||||
| 67802 | |||||
| 67803 | already_AddRefed<Promise> | ||||
| 67804 | TestJSImplInterfaceJSImpl::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67805 | { | ||||
| 67806 | CallSetup s(this, aRv, "TestJSImplInterface.receiveAddrefedPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67807 | if (aRv.Failed()) { | ||||
| 67808 | return nullptr; | ||||
| 67809 | } | ||||
| 67810 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67810); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67810; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67811 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67812 | |||||
| 67813 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67814 | |||||
| 67815 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67816 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67817 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67818 | !InitIds(cx, atomsCache)) || | ||||
| 67819 | !GetCallableProperty(cx, atomsCache->receiveAddrefedPromise_id, &callable)) { | ||||
| 67820 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67821 | return nullptr; | ||||
| 67822 | } | ||||
| 67823 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67824 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67825 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67826 | aRv.NoteJSContextException(cx); | ||||
| 67827 | return nullptr; | ||||
| 67828 | } | ||||
| 67829 | RefPtr<Promise> rvalDecl; | ||||
| 67830 | { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm, | ||||
| 67831 | // etc. | ||||
| 67832 | |||||
| 67833 | JS::Rooted<JSObject*> globalObj(cx); | ||||
| 67834 | if (!rval.isObject()) { | ||||
| 67835 | aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise"); | ||||
| 67836 | return nullptr; | ||||
| 67837 | } | ||||
| 67838 | JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject()); | ||||
| 67839 | if (!unwrappedVal) { | ||||
| 67840 | // A slight lie, but not much of one, for a dead object wrapper. | ||||
| 67841 | aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise"); | ||||
| 67842 | return nullptr; | ||||
| 67843 | } | ||||
| 67844 | globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal); | ||||
| 67845 | JSAutoRealm ar(cx, globalObj); | ||||
| 67846 | GlobalObject promiseGlobal(cx, globalObj); | ||||
| 67847 | if (promiseGlobal.Failed()) { | ||||
| 67848 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67849 | return nullptr; | ||||
| 67850 | } | ||||
| 67851 | |||||
| 67852 | JS::Rooted<JS::Value> valueToResolve(cx, rval); | ||||
| 67853 | if (!JS_WrapValue(cx, &valueToResolve)) { | ||||
| 67854 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67855 | return nullptr; | ||||
| 67856 | } | ||||
| 67857 | binding_detail::FastErrorResult promiseRv; | ||||
| 67858 | nsCOMPtr<nsIGlobalObject> global = | ||||
| 67859 | do_QueryInterface(promiseGlobal.GetAsSupports()); | ||||
| 67860 | if (!global) { | ||||
| 67861 | promiseRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67862 | 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" , 67862); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)" ")"); do { *((volatile int*)__null) = 67862; __attribute__(( nomerge)) ::abort(); } while (false); } while (false); } } while (false); | ||||
| 67863 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67864 | return nullptr; | ||||
| 67865 | } | ||||
| 67866 | rvalDecl = Promise::Resolve(global, cx, valueToResolve, | ||||
| 67867 | promiseRv); | ||||
| 67868 | if (promiseRv.MaybeSetPendingException(cx)) { | ||||
| 67869 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67870 | return nullptr; | ||||
| 67871 | } | ||||
| 67872 | } | ||||
| 67873 | return rvalDecl.forget(); | ||||
| 67874 | } | ||||
| 67875 | |||||
| 67876 | void | ||||
| 67877 | TestJSImplInterfaceJSImpl::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67878 | { | ||||
| 67879 | CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67880 | if (aRv.Failed()) { | ||||
| 67881 | return; | ||||
| 67882 | } | ||||
| 67883 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67883); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67883; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67884 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67885 | |||||
| 67886 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67887 | |||||
| 67888 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67889 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67890 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67891 | !InitIds(cx, atomsCache)) || | ||||
| 67892 | !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) { | ||||
| 67893 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67894 | return; | ||||
| 67895 | } | ||||
| 67896 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67897 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67898 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 67899 | aRv.NoteJSContextException(cx); | ||||
| 67900 | return; | ||||
| 67901 | } | ||||
| 67902 | } | ||||
| 67903 | |||||
| 67904 | void | ||||
| 67905 | TestJSImplInterfaceJSImpl::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67906 | { | ||||
| 67907 | CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67908 | if (aRv.Failed()) { | ||||
| 67909 | return; | ||||
| 67910 | } | ||||
| 67911 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67911); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67911; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67912 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67913 | |||||
| 67914 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67915 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67916 | if (!argv.resize(1)) { | ||||
| 67917 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67918 | // the right thing with that. | ||||
| 67919 | return; | ||||
| 67920 | } | ||||
| 67921 | unsigned argc = 1; | ||||
| 67922 | |||||
| 67923 | do { | ||||
| 67924 | argv[0].setInt32(int32_t(argument)); | ||||
| 67925 | break; | ||||
| 67926 | } while (false); | ||||
| 67927 | |||||
| 67928 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67929 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67930 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67931 | !InitIds(cx, atomsCache)) || | ||||
| 67932 | !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) { | ||||
| 67933 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67934 | return; | ||||
| 67935 | } | ||||
| 67936 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67937 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67938 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67939 | aRv.NoteJSContextException(cx); | ||||
| 67940 | return; | ||||
| 67941 | } | ||||
| 67942 | } | ||||
| 67943 | |||||
| 67944 | void | ||||
| 67945 | TestJSImplInterfaceJSImpl::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67946 | { | ||||
| 67947 | CallSetup s(this, aRv, "TestJSImplInterface.passDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67948 | if (aRv.Failed()) { | ||||
| 67949 | return; | ||||
| 67950 | } | ||||
| 67951 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67951); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67951; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67952 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67953 | |||||
| 67954 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67955 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67956 | if (!argv.resize(1)) { | ||||
| 67957 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 67958 | // the right thing with that. | ||||
| 67959 | return; | ||||
| 67960 | } | ||||
| 67961 | unsigned argc = 1; | ||||
| 67962 | |||||
| 67963 | do { | ||||
| 67964 | if (!x.ToObjectInternal(cx, argv[0])) { | ||||
| 67965 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67966 | return; | ||||
| 67967 | } | ||||
| 67968 | break; | ||||
| 67969 | } while (false); | ||||
| 67970 | |||||
| 67971 | JS::Rooted<JS::Value> callable(cx); | ||||
| 67972 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 67973 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 67974 | !InitIds(cx, atomsCache)) || | ||||
| 67975 | !GetCallableProperty(cx, atomsCache->passDictionary_id, &callable)) { | ||||
| 67976 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 67977 | return; | ||||
| 67978 | } | ||||
| 67979 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 67980 | if (!JS::Call(cx, thisValue, callable, | ||||
| 67981 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 67982 | aRv.NoteJSContextException(cx); | ||||
| 67983 | return; | ||||
| 67984 | } | ||||
| 67985 | } | ||||
| 67986 | |||||
| 67987 | void | ||||
| 67988 | TestJSImplInterfaceJSImpl::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 67989 | { | ||||
| 67990 | CallSetup s(this, aRv, "TestJSImplInterface.passDictionary2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 67991 | if (aRv.Failed()) { | ||||
| 67992 | return; | ||||
| 67993 | } | ||||
| 67994 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 67994); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 67994; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 67995 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 67996 | |||||
| 67997 | JS::Rooted<JS::Value> rval(cx); | ||||
| 67998 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 67999 | if (!argv.resize(1)) { | ||||
| 68000 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68001 | // the right thing with that. | ||||
| 68002 | return; | ||||
| 68003 | } | ||||
| 68004 | unsigned argc = 1; | ||||
| 68005 | |||||
| 68006 | do { | ||||
| 68007 | if (!x.ToObjectInternal(cx, argv[0])) { | ||||
| 68008 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68009 | return; | ||||
| 68010 | } | ||||
| 68011 | break; | ||||
| 68012 | } while (false); | ||||
| 68013 | |||||
| 68014 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68015 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68016 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68017 | !InitIds(cx, atomsCache)) || | ||||
| 68018 | !GetCallableProperty(cx, atomsCache->passDictionary2_id, &callable)) { | ||||
| 68019 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68020 | return; | ||||
| 68021 | } | ||||
| 68022 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68023 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68024 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68025 | aRv.NoteJSContextException(cx); | ||||
| 68026 | return; | ||||
| 68027 | } | ||||
| 68028 | } | ||||
| 68029 | |||||
| 68030 | void | ||||
| 68031 | TestJSImplInterfaceJSImpl::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68032 | { | ||||
| 68033 | CallSetup s(this, aRv, "TestJSImplInterface.receiveDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68034 | if (aRv.Failed()) { | ||||
| 68035 | return; | ||||
| 68036 | } | ||||
| 68037 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68037); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68037; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68038 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68039 | |||||
| 68040 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68041 | |||||
| 68042 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68043 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68044 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68045 | !InitIds(cx, atomsCache)) || | ||||
| 68046 | !GetCallableProperty(cx, atomsCache->receiveDictionary_id, &callable)) { | ||||
| 68047 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68048 | return; | ||||
| 68049 | } | ||||
| 68050 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68051 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68052 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 68053 | aRv.NoteJSContextException(cx); | ||||
| 68054 | return; | ||||
| 68055 | } | ||||
| 68056 | Dict& rvalDecl(aRetVal); | ||||
| 68057 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictionary", false)) { | ||||
| 68058 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68059 | return; | ||||
| 68060 | } | ||||
| 68061 | } | ||||
| 68062 | |||||
| 68063 | void | ||||
| 68064 | TestJSImplInterfaceJSImpl::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68065 | { | ||||
| 68066 | CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68067 | if (aRv.Failed()) { | ||||
| 68068 | return; | ||||
| 68069 | } | ||||
| 68070 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68070); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68070; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68071 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68072 | |||||
| 68073 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68074 | |||||
| 68075 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68076 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68077 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68078 | !InitIds(cx, atomsCache)) || | ||||
| 68079 | !GetCallableProperty(cx, atomsCache->receiveNullableDictionary_id, &callable)) { | ||||
| 68080 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68081 | return; | ||||
| 68082 | } | ||||
| 68083 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68084 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68085 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 68086 | aRv.NoteJSContextException(cx); | ||||
| 68087 | return; | ||||
| 68088 | } | ||||
| 68089 | Nullable<Dict>& rvalDecl(aRetVal); | ||||
| 68090 | if (rval.isNullOrUndefined()) { | ||||
| 68091 | rvalDecl.SetNull(); | ||||
| 68092 | } else { | ||||
| 68093 | if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableDictionary", false)) { | ||||
| 68094 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68095 | return; | ||||
| 68096 | } | ||||
| 68097 | } | ||||
| 68098 | } | ||||
| 68099 | |||||
| 68100 | void | ||||
| 68101 | TestJSImplInterfaceJSImpl::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68102 | { | ||||
| 68103 | CallSetup s(this, aRv, "TestJSImplInterface.passOtherDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68104 | if (aRv.Failed()) { | ||||
| 68105 | return; | ||||
| 68106 | } | ||||
| 68107 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68107); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68107; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68108 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68109 | |||||
| 68110 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68111 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68112 | if (!argv.resize(1)) { | ||||
| 68113 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68114 | // the right thing with that. | ||||
| 68115 | return; | ||||
| 68116 | } | ||||
| 68117 | unsigned argc = 1; | ||||
| 68118 | |||||
| 68119 | do { | ||||
| 68120 | if (!x.ToObjectInternal(cx, argv[0])) { | ||||
| 68121 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68122 | return; | ||||
| 68123 | } | ||||
| 68124 | break; | ||||
| 68125 | } while (false); | ||||
| 68126 | |||||
| 68127 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68128 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68129 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68130 | !InitIds(cx, atomsCache)) || | ||||
| 68131 | !GetCallableProperty(cx, atomsCache->passOtherDictionary_id, &callable)) { | ||||
| 68132 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68133 | return; | ||||
| 68134 | } | ||||
| 68135 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68136 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68137 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68138 | aRv.NoteJSContextException(cx); | ||||
| 68139 | return; | ||||
| 68140 | } | ||||
| 68141 | } | ||||
| 68142 | |||||
| 68143 | void | ||||
| 68144 | TestJSImplInterfaceJSImpl::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68145 | { | ||||
| 68146 | CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68147 | if (aRv.Failed()) { | ||||
| 68148 | return; | ||||
| 68149 | } | ||||
| 68150 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68150); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68150; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68151 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68152 | |||||
| 68153 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68154 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68155 | if (!argv.resize(1)) { | ||||
| 68156 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68157 | // the right thing with that. | ||||
| 68158 | return; | ||||
| 68159 | } | ||||
| 68160 | unsigned argc = 1; | ||||
| 68161 | |||||
| 68162 | do { | ||||
| 68163 | |||||
| 68164 | uint32_t length = x.Length(); | ||||
| 68165 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 68166 | if (!returnArray) { | ||||
| 68167 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68168 | return; | ||||
| 68169 | } | ||||
| 68170 | // Scope for 'tmp' | ||||
| 68171 | { | ||||
| 68172 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 68173 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 68174 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 68175 | // are different ways to succeed at wrapping the object. | ||||
| 68176 | do { | ||||
| 68177 | if (!x[sequenceIdx0].ToObjectInternal(cx, &tmp)) { | ||||
| 68178 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68179 | return; | ||||
| 68180 | } | ||||
| 68181 | break; | ||||
| 68182 | } while (false); | ||||
| 68183 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 68184 | JSPROP_ENUMERATE)) { | ||||
| 68185 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68186 | return; | ||||
| 68187 | } | ||||
| 68188 | } | ||||
| 68189 | } | ||||
| 68190 | argv[0].setObject(*returnArray); | ||||
| 68191 | break; | ||||
| 68192 | } while (false); | ||||
| 68193 | |||||
| 68194 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68195 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68196 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68197 | !InitIds(cx, atomsCache)) || | ||||
| 68198 | !GetCallableProperty(cx, atomsCache->passSequenceOfDictionaries_id, &callable)) { | ||||
| 68199 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68200 | return; | ||||
| 68201 | } | ||||
| 68202 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68203 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68204 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68205 | aRv.NoteJSContextException(cx); | ||||
| 68206 | return; | ||||
| 68207 | } | ||||
| 68208 | } | ||||
| 68209 | |||||
| 68210 | void | ||||
| 68211 | TestJSImplInterfaceJSImpl::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68212 | { | ||||
| 68213 | CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68214 | if (aRv.Failed()) { | ||||
| 68215 | return; | ||||
| 68216 | } | ||||
| 68217 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68217); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68217; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68218 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68219 | |||||
| 68220 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68221 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68222 | if (!argv.resize(1)) { | ||||
| 68223 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68224 | // the right thing with that. | ||||
| 68225 | return; | ||||
| 68226 | } | ||||
| 68227 | unsigned argc = 1; | ||||
| 68228 | |||||
| 68229 | do { | ||||
| 68230 | |||||
| 68231 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 68232 | if (!returnObj) { | ||||
| 68233 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68234 | return; | ||||
| 68235 | } | ||||
| 68236 | // Scope for 'tmp' | ||||
| 68237 | { | ||||
| 68238 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 68239 | for (auto& entry : x.Entries()) { | ||||
| 68240 | auto& recordValue0 = entry.mValue; | ||||
| 68241 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 68242 | // are different ways to succeed at wrapping the value. | ||||
| 68243 | do { | ||||
| 68244 | if (!recordValue0.ToObjectInternal(cx, &tmp)) { | ||||
| 68245 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68246 | return; | ||||
| 68247 | } | ||||
| 68248 | break; | ||||
| 68249 | } while (false); | ||||
| 68250 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 68251 | entry.mKey.BeginReading(), | ||||
| 68252 | entry.mKey.Length(), tmp, | ||||
| 68253 | JSPROP_ENUMERATE)) { | ||||
| 68254 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68255 | return; | ||||
| 68256 | } | ||||
| 68257 | } | ||||
| 68258 | } | ||||
| 68259 | argv[0].setObject(*returnObj); | ||||
| 68260 | break; | ||||
| 68261 | } while (false); | ||||
| 68262 | |||||
| 68263 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68264 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68265 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68266 | !InitIds(cx, atomsCache)) || | ||||
| 68267 | !GetCallableProperty(cx, atomsCache->passRecordOfDictionaries_id, &callable)) { | ||||
| 68268 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68269 | return; | ||||
| 68270 | } | ||||
| 68271 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68272 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68273 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68274 | aRv.NoteJSContextException(cx); | ||||
| 68275 | return; | ||||
| 68276 | } | ||||
| 68277 | } | ||||
| 68278 | |||||
| 68279 | void | ||||
| 68280 | TestJSImplInterfaceJSImpl::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68281 | { | ||||
| 68282 | CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68283 | if (aRv.Failed()) { | ||||
| 68284 | return; | ||||
| 68285 | } | ||||
| 68286 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68286); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68286; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68287 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68288 | |||||
| 68289 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68290 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68291 | if (!argv.resize(1)) { | ||||
| 68292 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68293 | // the right thing with that. | ||||
| 68294 | return; | ||||
| 68295 | } | ||||
| 68296 | unsigned argc = 1; | ||||
| 68297 | |||||
| 68298 | do { | ||||
| 68299 | if (!x.ToObjectInternal(cx, argv[0])) { | ||||
| 68300 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68301 | return; | ||||
| 68302 | } | ||||
| 68303 | break; | ||||
| 68304 | } while (false); | ||||
| 68305 | |||||
| 68306 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68307 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68308 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68309 | !InitIds(cx, atomsCache)) || | ||||
| 68310 | !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) { | ||||
| 68311 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68312 | return; | ||||
| 68313 | } | ||||
| 68314 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68315 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68316 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68317 | aRv.NoteJSContextException(cx); | ||||
| 68318 | return; | ||||
| 68319 | } | ||||
| 68320 | } | ||||
| 68321 | |||||
| 68322 | void | ||||
| 68323 | TestJSImplInterfaceJSImpl::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68324 | { | ||||
| 68325 | CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68326 | if (aRv.Failed()) { | ||||
| 68327 | return; | ||||
| 68328 | } | ||||
| 68329 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68329); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68329; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68330 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68331 | |||||
| 68332 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68333 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68334 | if (!argv.resize(1)) { | ||||
| 68335 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68336 | // the right thing with that. | ||||
| 68337 | return; | ||||
| 68338 | } | ||||
| 68339 | unsigned argc = 1; | ||||
| 68340 | |||||
| 68341 | do { | ||||
| 68342 | argv[0].setInt32(int32_t(x)); | ||||
| 68343 | break; | ||||
| 68344 | } while (false); | ||||
| 68345 | |||||
| 68346 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68347 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68348 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68349 | !InitIds(cx, atomsCache)) || | ||||
| 68350 | !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) { | ||||
| 68351 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68352 | return; | ||||
| 68353 | } | ||||
| 68354 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68355 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68356 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68357 | aRv.NoteJSContextException(cx); | ||||
| 68358 | return; | ||||
| 68359 | } | ||||
| 68360 | } | ||||
| 68361 | |||||
| 68362 | void | ||||
| 68363 | TestJSImplInterfaceJSImpl::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68364 | { | ||||
| 68365 | CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingDict", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68366 | if (aRv.Failed()) { | ||||
| 68367 | return; | ||||
| 68368 | } | ||||
| 68369 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68369); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68369; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68370 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68371 | |||||
| 68372 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68373 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68374 | if (!argv.resize(1)) { | ||||
| 68375 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68376 | // the right thing with that. | ||||
| 68377 | return; | ||||
| 68378 | } | ||||
| 68379 | unsigned argc = 1; | ||||
| 68380 | |||||
| 68381 | do { | ||||
| 68382 | if (!arg.ToObjectInternal(cx, argv[0])) { | ||||
| 68383 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68384 | return; | ||||
| 68385 | } | ||||
| 68386 | break; | ||||
| 68387 | } while (false); | ||||
| 68388 | |||||
| 68389 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68390 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68391 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68392 | !InitIds(cx, atomsCache)) || | ||||
| 68393 | !GetCallableProperty(cx, atomsCache->passDictContainingDict_id, &callable)) { | ||||
| 68394 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68395 | return; | ||||
| 68396 | } | ||||
| 68397 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68398 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68399 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68400 | aRv.NoteJSContextException(cx); | ||||
| 68401 | return; | ||||
| 68402 | } | ||||
| 68403 | } | ||||
| 68404 | |||||
| 68405 | void | ||||
| 68406 | TestJSImplInterfaceJSImpl::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68407 | { | ||||
| 68408 | CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68409 | if (aRv.Failed()) { | ||||
| 68410 | return; | ||||
| 68411 | } | ||||
| 68412 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68412); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68412; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68413 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68414 | |||||
| 68415 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68416 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68417 | if (!argv.resize(1)) { | ||||
| 68418 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68419 | // the right thing with that. | ||||
| 68420 | return; | ||||
| 68421 | } | ||||
| 68422 | unsigned argc = 1; | ||||
| 68423 | |||||
| 68424 | do { | ||||
| 68425 | if (!arg.ToObjectInternal(cx, argv[0])) { | ||||
| 68426 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68427 | return; | ||||
| 68428 | } | ||||
| 68429 | break; | ||||
| 68430 | } while (false); | ||||
| 68431 | |||||
| 68432 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68433 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68434 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68435 | !InitIds(cx, atomsCache)) || | ||||
| 68436 | !GetCallableProperty(cx, atomsCache->passDictContainingSequence_id, &callable)) { | ||||
| 68437 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68438 | return; | ||||
| 68439 | } | ||||
| 68440 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68441 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68442 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68443 | aRv.NoteJSContextException(cx); | ||||
| 68444 | return; | ||||
| 68445 | } | ||||
| 68446 | } | ||||
| 68447 | |||||
| 68448 | void | ||||
| 68449 | TestJSImplInterfaceJSImpl::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68450 | { | ||||
| 68451 | CallSetup s(this, aRv, "TestJSImplInterface.receiveDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68452 | if (aRv.Failed()) { | ||||
| 68453 | return; | ||||
| 68454 | } | ||||
| 68455 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68455); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68455; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68456 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68457 | |||||
| 68458 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68459 | |||||
| 68460 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68461 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68462 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68463 | !InitIds(cx, atomsCache)) || | ||||
| 68464 | !GetCallableProperty(cx, atomsCache->receiveDictContainingSequence_id, &callable)) { | ||||
| 68465 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68466 | return; | ||||
| 68467 | } | ||||
| 68468 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68469 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68470 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 68471 | aRv.NoteJSContextException(cx); | ||||
| 68472 | return; | ||||
| 68473 | } | ||||
| 68474 | DictContainingSequence& rvalDecl(aRetVal); | ||||
| 68475 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictContainingSequence", false)) { | ||||
| 68476 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68477 | return; | ||||
| 68478 | } | ||||
| 68479 | } | ||||
| 68480 | |||||
| 68481 | void | ||||
| 68482 | TestJSImplInterfaceJSImpl::PassVariadicDictionary(const nsTArray<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68483 | { | ||||
| 68484 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68485 | if (aRv.Failed()) { | ||||
| 68486 | return; | ||||
| 68487 | } | ||||
| 68488 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68488); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68488; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68489 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68490 | |||||
| 68491 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68492 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68493 | if (!argv.resize((1 - 1) + arg.Length())) { | ||||
| 68494 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68495 | // the right thing with that. | ||||
| 68496 | return; | ||||
| 68497 | } | ||||
| 68498 | unsigned argc = (1 - 1) + arg.Length(); | ||||
| 68499 | |||||
| 68500 | do { | ||||
| 68501 | for (uint32_t idx = 0; idx < arg.Length(); ++idx) { | ||||
| 68502 | if (!arg[idx].ToObjectInternal(cx, argv[0 + idx])) { | ||||
| 68503 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68504 | return; | ||||
| 68505 | } | ||||
| 68506 | continue; | ||||
| 68507 | } | ||||
| 68508 | break; | ||||
| 68509 | } while (false); | ||||
| 68510 | |||||
| 68511 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68512 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68513 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68514 | !InitIds(cx, atomsCache)) || | ||||
| 68515 | !GetCallableProperty(cx, atomsCache->passVariadicDictionary_id, &callable)) { | ||||
| 68516 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68517 | return; | ||||
| 68518 | } | ||||
| 68519 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68520 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68521 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68522 | aRv.NoteJSContextException(cx); | ||||
| 68523 | return; | ||||
| 68524 | } | ||||
| 68525 | } | ||||
| 68526 | |||||
| 68527 | void | ||||
| 68528 | TestJSImplInterfaceJSImpl::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68529 | { | ||||
| 68530 | CallSetup s(this, aRv, "TestJSImplInterface.dontEnforceRangeOrClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68531 | if (aRv.Failed()) { | ||||
| 68532 | return; | ||||
| 68533 | } | ||||
| 68534 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68534); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68534; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68535 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68536 | |||||
| 68537 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68538 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68539 | if (!argv.resize(1)) { | ||||
| 68540 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68541 | // the right thing with that. | ||||
| 68542 | return; | ||||
| 68543 | } | ||||
| 68544 | unsigned argc = 1; | ||||
| 68545 | |||||
| 68546 | do { | ||||
| 68547 | argv[0].setInt32(int32_t(arg)); | ||||
| 68548 | break; | ||||
| 68549 | } while (false); | ||||
| 68550 | |||||
| 68551 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68552 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68553 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68554 | !InitIds(cx, atomsCache)) || | ||||
| 68555 | !GetCallableProperty(cx, atomsCache->dontEnforceRangeOrClamp_id, &callable)) { | ||||
| 68556 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68557 | return; | ||||
| 68558 | } | ||||
| 68559 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68560 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68561 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68562 | aRv.NoteJSContextException(cx); | ||||
| 68563 | return; | ||||
| 68564 | } | ||||
| 68565 | } | ||||
| 68566 | |||||
| 68567 | void | ||||
| 68568 | TestJSImplInterfaceJSImpl::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68569 | { | ||||
| 68570 | CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRange", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68571 | if (aRv.Failed()) { | ||||
| 68572 | return; | ||||
| 68573 | } | ||||
| 68574 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68574); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68574; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68575 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68576 | |||||
| 68577 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68578 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68579 | if (!argv.resize(1)) { | ||||
| 68580 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68581 | // the right thing with that. | ||||
| 68582 | return; | ||||
| 68583 | } | ||||
| 68584 | unsigned argc = 1; | ||||
| 68585 | |||||
| 68586 | do { | ||||
| 68587 | argv[0].setInt32(int32_t(arg)); | ||||
| 68588 | break; | ||||
| 68589 | } while (false); | ||||
| 68590 | |||||
| 68591 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68592 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68593 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68594 | !InitIds(cx, atomsCache)) || | ||||
| 68595 | !GetCallableProperty(cx, atomsCache->doEnforceRange_id, &callable)) { | ||||
| 68596 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68597 | return; | ||||
| 68598 | } | ||||
| 68599 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68600 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68601 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68602 | aRv.NoteJSContextException(cx); | ||||
| 68603 | return; | ||||
| 68604 | } | ||||
| 68605 | } | ||||
| 68606 | |||||
| 68607 | void | ||||
| 68608 | TestJSImplInterfaceJSImpl::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68609 | { | ||||
| 68610 | CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRangeNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68611 | if (aRv.Failed()) { | ||||
| 68612 | return; | ||||
| 68613 | } | ||||
| 68614 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68614); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68614; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68615 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68616 | |||||
| 68617 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68618 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68619 | if (!argv.resize(1)) { | ||||
| 68620 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68621 | // the right thing with that. | ||||
| 68622 | return; | ||||
| 68623 | } | ||||
| 68624 | unsigned argc = 1; | ||||
| 68625 | |||||
| 68626 | do { | ||||
| 68627 | if (arg.IsNull()) { | ||||
| 68628 | argv[0].setNull(); | ||||
| 68629 | break; | ||||
| 68630 | } | ||||
| 68631 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 68632 | break; | ||||
| 68633 | } while (false); | ||||
| 68634 | |||||
| 68635 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68636 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68637 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68638 | !InitIds(cx, atomsCache)) || | ||||
| 68639 | !GetCallableProperty(cx, atomsCache->doEnforceRangeNullable_id, &callable)) { | ||||
| 68640 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68641 | return; | ||||
| 68642 | } | ||||
| 68643 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68644 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68645 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68646 | aRv.NoteJSContextException(cx); | ||||
| 68647 | return; | ||||
| 68648 | } | ||||
| 68649 | } | ||||
| 68650 | |||||
| 68651 | void | ||||
| 68652 | TestJSImplInterfaceJSImpl::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68653 | { | ||||
| 68654 | CallSetup s(this, aRv, "TestJSImplInterface.doClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68655 | if (aRv.Failed()) { | ||||
| 68656 | return; | ||||
| 68657 | } | ||||
| 68658 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68658); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68658; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68659 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68660 | |||||
| 68661 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68662 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68663 | if (!argv.resize(1)) { | ||||
| 68664 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68665 | // the right thing with that. | ||||
| 68666 | return; | ||||
| 68667 | } | ||||
| 68668 | unsigned argc = 1; | ||||
| 68669 | |||||
| 68670 | do { | ||||
| 68671 | argv[0].setInt32(int32_t(arg)); | ||||
| 68672 | break; | ||||
| 68673 | } while (false); | ||||
| 68674 | |||||
| 68675 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68676 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68677 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68678 | !InitIds(cx, atomsCache)) || | ||||
| 68679 | !GetCallableProperty(cx, atomsCache->doClamp_id, &callable)) { | ||||
| 68680 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68681 | return; | ||||
| 68682 | } | ||||
| 68683 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68684 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68685 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68686 | aRv.NoteJSContextException(cx); | ||||
| 68687 | return; | ||||
| 68688 | } | ||||
| 68689 | } | ||||
| 68690 | |||||
| 68691 | void | ||||
| 68692 | TestJSImplInterfaceJSImpl::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68693 | { | ||||
| 68694 | CallSetup s(this, aRv, "TestJSImplInterface.doClampNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68695 | if (aRv.Failed()) { | ||||
| 68696 | return; | ||||
| 68697 | } | ||||
| 68698 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68698); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68698; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68699 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68700 | |||||
| 68701 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68702 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68703 | if (!argv.resize(1)) { | ||||
| 68704 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68705 | // the right thing with that. | ||||
| 68706 | return; | ||||
| 68707 | } | ||||
| 68708 | unsigned argc = 1; | ||||
| 68709 | |||||
| 68710 | do { | ||||
| 68711 | if (arg.IsNull()) { | ||||
| 68712 | argv[0].setNull(); | ||||
| 68713 | break; | ||||
| 68714 | } | ||||
| 68715 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 68716 | break; | ||||
| 68717 | } while (false); | ||||
| 68718 | |||||
| 68719 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68720 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68721 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68722 | !InitIds(cx, atomsCache)) || | ||||
| 68723 | !GetCallableProperty(cx, atomsCache->doClampNullable_id, &callable)) { | ||||
| 68724 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68725 | return; | ||||
| 68726 | } | ||||
| 68727 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68728 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68729 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68730 | aRv.NoteJSContextException(cx); | ||||
| 68731 | return; | ||||
| 68732 | } | ||||
| 68733 | } | ||||
| 68734 | |||||
| 68735 | void | ||||
| 68736 | TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68737 | { | ||||
| 68738 | CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68739 | if (aRv.Failed()) { | ||||
| 68740 | return; | ||||
| 68741 | } | ||||
| 68742 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68742); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68742; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68743 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68744 | |||||
| 68745 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68746 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68747 | if (!argv.resize(1)) { | ||||
| 68748 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68749 | // the right thing with that. | ||||
| 68750 | return; | ||||
| 68751 | } | ||||
| 68752 | unsigned argc = 1; | ||||
| 68753 | |||||
| 68754 | do { | ||||
| 68755 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 68756 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 68756); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 68756; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68757 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68758 | return; | ||||
| 68759 | } | ||||
| 68760 | break; | ||||
| 68761 | } while (false); | ||||
| 68762 | |||||
| 68763 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68764 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68765 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68766 | !InitIds(cx, atomsCache)) || | ||||
| 68767 | !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces1_id, &callable)) { | ||||
| 68768 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68769 | return; | ||||
| 68770 | } | ||||
| 68771 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68772 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68773 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68774 | aRv.NoteJSContextException(cx); | ||||
| 68775 | return; | ||||
| 68776 | } | ||||
| 68777 | } | ||||
| 68778 | |||||
| 68779 | already_AddRefed<TestJSImplInterface> | ||||
| 68780 | TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68781 | { | ||||
| 68782 | CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68783 | if (aRv.Failed()) { | ||||
| 68784 | return nullptr; | ||||
| 68785 | } | ||||
| 68786 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68786); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68786; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68787 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68788 | |||||
| 68789 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68790 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68791 | if (!argv.resize(1)) { | ||||
| 68792 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68793 | // the right thing with that. | ||||
| 68794 | return nullptr; | ||||
| 68795 | } | ||||
| 68796 | unsigned argc = 1; | ||||
| 68797 | |||||
| 68798 | do { | ||||
| 68799 | if (!arg) { | ||||
| 68800 | argv[0].setNull(); | ||||
| 68801 | break; | ||||
| 68802 | } | ||||
| 68803 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 68804 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 68804); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 68804; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68805 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68806 | return nullptr; | ||||
| 68807 | } | ||||
| 68808 | break; | ||||
| 68809 | } while (false); | ||||
| 68810 | |||||
| 68811 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68812 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68813 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68814 | !InitIds(cx, atomsCache)) || | ||||
| 68815 | !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces2_id, &callable)) { | ||||
| 68816 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68817 | return nullptr; | ||||
| 68818 | } | ||||
| 68819 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68820 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68821 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68822 | aRv.NoteJSContextException(cx); | ||||
| 68823 | return nullptr; | ||||
| 68824 | } | ||||
| 68825 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 68826 | if (rval.isObject()) { | ||||
| 68827 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 68828 | { | ||||
| 68829 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 68830 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 68831 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 68832 | // Be careful to not wrap random DOM objects here, even if | ||||
| 68833 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 68834 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 68835 | // that already has a content reflection... | ||||
| 68836 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 68837 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 68838 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 68839 | if (!callback || | ||||
| 68840 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 68841 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68842 | return nullptr; | ||||
| 68843 | } | ||||
| 68844 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 68845 | 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", 68846); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 68846; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 68846 | "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", 68846); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 68846; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 68847 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 68848 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 68849 | } else { | ||||
| 68850 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2", "TestJSImplInterface"); | ||||
| 68851 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68852 | return nullptr; | ||||
| 68853 | } | ||||
| 68854 | } | ||||
| 68855 | } | ||||
| 68856 | } else { | ||||
| 68857 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2"); | ||||
| 68858 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68859 | return nullptr; | ||||
| 68860 | } | ||||
| 68861 | return rvalDecl.forget(); | ||||
| 68862 | } | ||||
| 68863 | |||||
| 68864 | void | ||||
| 68865 | TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68866 | { | ||||
| 68867 | CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68868 | if (aRv.Failed()) { | ||||
| 68869 | return; | ||||
| 68870 | } | ||||
| 68871 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68871); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68871; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68872 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68873 | |||||
| 68874 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68875 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68876 | if (!argv.resize(1)) { | ||||
| 68877 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68878 | // the right thing with that. | ||||
| 68879 | return; | ||||
| 68880 | } | ||||
| 68881 | unsigned argc = 1; | ||||
| 68882 | |||||
| 68883 | do { | ||||
| 68884 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 68885 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 68885); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 68885; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68886 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68887 | return; | ||||
| 68888 | } | ||||
| 68889 | break; | ||||
| 68890 | } while (false); | ||||
| 68891 | |||||
| 68892 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68893 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68894 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68895 | !InitIds(cx, atomsCache)) || | ||||
| 68896 | !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces3_id, &callable)) { | ||||
| 68897 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68898 | return; | ||||
| 68899 | } | ||||
| 68900 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68901 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68902 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68903 | aRv.NoteJSContextException(cx); | ||||
| 68904 | return; | ||||
| 68905 | } | ||||
| 68906 | } | ||||
| 68907 | |||||
| 68908 | int8_t | ||||
| 68909 | TestJSImplInterfaceJSImpl::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68910 | { | ||||
| 68911 | CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68912 | if (aRv.Failed()) { | ||||
| 68913 | return int8_t(0); | ||||
| 68914 | } | ||||
| 68915 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68915); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68915; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68916 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68917 | |||||
| 68918 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68919 | |||||
| 68920 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68921 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68922 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68923 | !InitIds(cx, atomsCache)) || | ||||
| 68924 | !GetCallableProperty(cx, atomsCache->deprecatedMethod_id, &callable)) { | ||||
| 68925 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68926 | return int8_t(0); | ||||
| 68927 | } | ||||
| 68928 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68929 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68930 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 68931 | aRv.NoteJSContextException(cx); | ||||
| 68932 | return int8_t(0); | ||||
| 68933 | } | ||||
| 68934 | int8_t rvalDecl; | ||||
| 68935 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedMethod", &rvalDecl)) { | ||||
| 68936 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68937 | return int8_t(0); | ||||
| 68938 | } | ||||
| 68939 | return rvalDecl; | ||||
| 68940 | } | ||||
| 68941 | |||||
| 68942 | void | ||||
| 68943 | TestJSImplInterfaceJSImpl::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68944 | { | ||||
| 68945 | CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethodWithContext", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68946 | if (aRv.Failed()) { | ||||
| 68947 | return; | ||||
| 68948 | } | ||||
| 68949 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68949); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68949; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68950 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68951 | |||||
| 68952 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68953 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68954 | if (!argv.resize(1)) { | ||||
| 68955 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 68956 | // the right thing with that. | ||||
| 68957 | return; | ||||
| 68958 | } | ||||
| 68959 | unsigned argc = 1; | ||||
| 68960 | |||||
| 68961 | do { | ||||
| 68962 | JS::ExposeValueToActiveJS(arg); | ||||
| 68963 | argv[0].set(arg); | ||||
| 68964 | if (!MaybeWrapValue(cx, argv[0])) { | ||||
| 68965 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68966 | return; | ||||
| 68967 | } | ||||
| 68968 | break; | ||||
| 68969 | } while (false); | ||||
| 68970 | |||||
| 68971 | JS::Rooted<JS::Value> callable(cx); | ||||
| 68972 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 68973 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 68974 | !InitIds(cx, atomsCache)) || | ||||
| 68975 | !GetCallableProperty(cx, atomsCache->deprecatedMethodWithContext_id, &callable)) { | ||||
| 68976 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 68977 | return; | ||||
| 68978 | } | ||||
| 68979 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 68980 | if (!JS::Call(cx, thisValue, callable, | ||||
| 68981 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 68982 | aRv.NoteJSContextException(cx); | ||||
| 68983 | return; | ||||
| 68984 | } | ||||
| 68985 | } | ||||
| 68986 | |||||
| 68987 | bool | ||||
| 68988 | TestJSImplInterfaceJSImpl::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 68989 | { | ||||
| 68990 | CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 68991 | if (aRv.Failed()) { | ||||
| 68992 | return bool(0); | ||||
| 68993 | } | ||||
| 68994 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 68994); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 68994; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 68995 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 68996 | |||||
| 68997 | JS::Rooted<JS::Value> rval(cx); | ||||
| 68998 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 68999 | if (!argv.resize(1)) { | ||||
| 69000 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69001 | // the right thing with that. | ||||
| 69002 | return bool(0); | ||||
| 69003 | } | ||||
| 69004 | unsigned argc = 1; | ||||
| 69005 | |||||
| 69006 | do { | ||||
| 69007 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 69008 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69008); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69008; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69009 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69010 | return bool(0); | ||||
| 69011 | } | ||||
| 69012 | break; | ||||
| 69013 | } while (false); | ||||
| 69014 | |||||
| 69015 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69016 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69017 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69018 | !InitIds(cx, atomsCache)) || | ||||
| 69019 | !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) { | ||||
| 69020 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69021 | return bool(0); | ||||
| 69022 | } | ||||
| 69023 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69024 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69025 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69026 | aRv.NoteJSContextException(cx); | ||||
| 69027 | return bool(0); | ||||
| 69028 | } | ||||
| 69029 | bool rvalDecl; | ||||
| 69030 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.overload1", &rvalDecl)) { | ||||
| 69031 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69032 | return bool(0); | ||||
| 69033 | } | ||||
| 69034 | return rvalDecl; | ||||
| 69035 | } | ||||
| 69036 | |||||
| 69037 | already_AddRefed<TestJSImplInterface> | ||||
| 69038 | TestJSImplInterfaceJSImpl::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69039 | { | ||||
| 69040 | CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69041 | if (aRv.Failed()) { | ||||
| 69042 | return nullptr; | ||||
| 69043 | } | ||||
| 69044 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69044); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69044; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69045 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69046 | |||||
| 69047 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69048 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69049 | if (!argv.resize(2)) { | ||||
| 69050 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69051 | // the right thing with that. | ||||
| 69052 | return nullptr; | ||||
| 69053 | } | ||||
| 69054 | unsigned argc = 2; | ||||
| 69055 | |||||
| 69056 | do { | ||||
| 69057 | if (!GetOrCreateDOMReflector(cx, arg, argv[1])) { | ||||
| 69058 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69058); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69058; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69059 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69060 | return nullptr; | ||||
| 69061 | } | ||||
| 69062 | break; | ||||
| 69063 | } while (false); | ||||
| 69064 | |||||
| 69065 | do { | ||||
| 69066 | if (!xpc::NonVoidStringToJsval(cx, strs, argv[0])) { | ||||
| 69067 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69068 | return nullptr; | ||||
| 69069 | } | ||||
| 69070 | break; | ||||
| 69071 | } while (false); | ||||
| 69072 | |||||
| 69073 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69074 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69075 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69076 | !InitIds(cx, atomsCache)) || | ||||
| 69077 | !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) { | ||||
| 69078 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69079 | return nullptr; | ||||
| 69080 | } | ||||
| 69081 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69082 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69083 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69084 | aRv.NoteJSContextException(cx); | ||||
| 69085 | return nullptr; | ||||
| 69086 | } | ||||
| 69087 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 69088 | if (rval.isObject()) { | ||||
| 69089 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 69090 | { | ||||
| 69091 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 69092 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 69093 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 69094 | // Be careful to not wrap random DOM objects here, even if | ||||
| 69095 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 69096 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 69097 | // that already has a content reflection... | ||||
| 69098 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 69099 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 69100 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 69101 | if (!callback || | ||||
| 69102 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 69103 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69104 | return nullptr; | ||||
| 69105 | } | ||||
| 69106 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 69107 | 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", 69108); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 69108; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 69108 | "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", 69108); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 69108; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 69109 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 69110 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 69111 | } else { | ||||
| 69112 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.overload1", "TestJSImplInterface"); | ||||
| 69113 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69114 | return nullptr; | ||||
| 69115 | } | ||||
| 69116 | } | ||||
| 69117 | } | ||||
| 69118 | } else { | ||||
| 69119 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.overload1"); | ||||
| 69120 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69121 | return nullptr; | ||||
| 69122 | } | ||||
| 69123 | return rvalDecl.forget(); | ||||
| 69124 | } | ||||
| 69125 | |||||
| 69126 | void | ||||
| 69127 | TestJSImplInterfaceJSImpl::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69128 | { | ||||
| 69129 | CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69130 | if (aRv.Failed()) { | ||||
| 69131 | return; | ||||
| 69132 | } | ||||
| 69133 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69133); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69133; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69134 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69135 | |||||
| 69136 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69137 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69138 | if (!argv.resize(1)) { | ||||
| 69139 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69140 | // the right thing with that. | ||||
| 69141 | return; | ||||
| 69142 | } | ||||
| 69143 | unsigned argc = 1; | ||||
| 69144 | |||||
| 69145 | do { | ||||
| 69146 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 69147 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69147); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69147; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69148 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69149 | return; | ||||
| 69150 | } | ||||
| 69151 | break; | ||||
| 69152 | } while (false); | ||||
| 69153 | |||||
| 69154 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69155 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69156 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69157 | !InitIds(cx, atomsCache)) || | ||||
| 69158 | !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) { | ||||
| 69159 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69160 | return; | ||||
| 69161 | } | ||||
| 69162 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69163 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69164 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69165 | aRv.NoteJSContextException(cx); | ||||
| 69166 | return; | ||||
| 69167 | } | ||||
| 69168 | } | ||||
| 69169 | |||||
| 69170 | void | ||||
| 69171 | TestJSImplInterfaceJSImpl::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69172 | { | ||||
| 69173 | CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69174 | if (aRv.Failed()) { | ||||
| 69175 | return; | ||||
| 69176 | } | ||||
| 69177 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69177); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69177; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69178 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69179 | |||||
| 69180 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69181 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69182 | if (!argv.resize(1)) { | ||||
| 69183 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69184 | // the right thing with that. | ||||
| 69185 | return; | ||||
| 69186 | } | ||||
| 69187 | unsigned argc = 1; | ||||
| 69188 | |||||
| 69189 | do { | ||||
| 69190 | if (!arg.ToObjectInternal(cx, argv[0])) { | ||||
| 69191 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69192 | return; | ||||
| 69193 | } | ||||
| 69194 | break; | ||||
| 69195 | } while (false); | ||||
| 69196 | |||||
| 69197 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69198 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69199 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69200 | !InitIds(cx, atomsCache)) || | ||||
| 69201 | !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) { | ||||
| 69202 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69203 | return; | ||||
| 69204 | } | ||||
| 69205 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69206 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69207 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69208 | aRv.NoteJSContextException(cx); | ||||
| 69209 | return; | ||||
| 69210 | } | ||||
| 69211 | } | ||||
| 69212 | |||||
| 69213 | void | ||||
| 69214 | TestJSImplInterfaceJSImpl::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69215 | { | ||||
| 69216 | CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69217 | if (aRv.Failed()) { | ||||
| 69218 | return; | ||||
| 69219 | } | ||||
| 69220 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69220); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69220; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69221 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69222 | |||||
| 69223 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69224 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69225 | if (!argv.resize(1)) { | ||||
| 69226 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69227 | // the right thing with that. | ||||
| 69228 | return; | ||||
| 69229 | } | ||||
| 69230 | unsigned argc = 1; | ||||
| 69231 | |||||
| 69232 | do { | ||||
| 69233 | argv[0].setBoolean(arg); | ||||
| 69234 | break; | ||||
| 69235 | } while (false); | ||||
| 69236 | |||||
| 69237 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69238 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69239 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69240 | !InitIds(cx, atomsCache)) || | ||||
| 69241 | !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) { | ||||
| 69242 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69243 | return; | ||||
| 69244 | } | ||||
| 69245 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69246 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69247 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69248 | aRv.NoteJSContextException(cx); | ||||
| 69249 | return; | ||||
| 69250 | } | ||||
| 69251 | } | ||||
| 69252 | |||||
| 69253 | void | ||||
| 69254 | TestJSImplInterfaceJSImpl::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69255 | { | ||||
| 69256 | CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69257 | if (aRv.Failed()) { | ||||
| 69258 | return; | ||||
| 69259 | } | ||||
| 69260 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69260); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69260; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69261 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69262 | |||||
| 69263 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69264 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69265 | if (!argv.resize(1)) { | ||||
| 69266 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69267 | // the right thing with that. | ||||
| 69268 | return; | ||||
| 69269 | } | ||||
| 69270 | unsigned argc = 1; | ||||
| 69271 | |||||
| 69272 | do { | ||||
| 69273 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 69274 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69275 | return; | ||||
| 69276 | } | ||||
| 69277 | break; | ||||
| 69278 | } while (false); | ||||
| 69279 | |||||
| 69280 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69281 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69282 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69283 | !InitIds(cx, atomsCache)) || | ||||
| 69284 | !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) { | ||||
| 69285 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69286 | return; | ||||
| 69287 | } | ||||
| 69288 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69289 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69290 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69291 | aRv.NoteJSContextException(cx); | ||||
| 69292 | return; | ||||
| 69293 | } | ||||
| 69294 | } | ||||
| 69295 | |||||
| 69296 | void | ||||
| 69297 | TestJSImplInterfaceJSImpl::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69298 | { | ||||
| 69299 | CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69300 | if (aRv.Failed()) { | ||||
| 69301 | return; | ||||
| 69302 | } | ||||
| 69303 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69303); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69303; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69304 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69305 | |||||
| 69306 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69307 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69308 | if (!argv.resize(1)) { | ||||
| 69309 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69310 | // the right thing with that. | ||||
| 69311 | return; | ||||
| 69312 | } | ||||
| 69313 | unsigned argc = 1; | ||||
| 69314 | |||||
| 69315 | do { | ||||
| 69316 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 69317 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69317); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69317; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69318 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69319 | return; | ||||
| 69320 | } | ||||
| 69321 | break; | ||||
| 69322 | } while (false); | ||||
| 69323 | |||||
| 69324 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69325 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69326 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69327 | !InitIds(cx, atomsCache)) || | ||||
| 69328 | !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) { | ||||
| 69329 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69330 | return; | ||||
| 69331 | } | ||||
| 69332 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69333 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69334 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69335 | aRv.NoteJSContextException(cx); | ||||
| 69336 | return; | ||||
| 69337 | } | ||||
| 69338 | } | ||||
| 69339 | |||||
| 69340 | void | ||||
| 69341 | TestJSImplInterfaceJSImpl::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69342 | { | ||||
| 69343 | CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69344 | if (aRv.Failed()) { | ||||
| 69345 | return; | ||||
| 69346 | } | ||||
| 69347 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69347); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69347; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69348 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69349 | |||||
| 69350 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69351 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69352 | if (!argv.resize(1)) { | ||||
| 69353 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69354 | // the right thing with that. | ||||
| 69355 | return; | ||||
| 69356 | } | ||||
| 69357 | unsigned argc = 1; | ||||
| 69358 | |||||
| 69359 | do { | ||||
| 69360 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 69361 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 69362 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69363 | return; | ||||
| 69364 | } | ||||
| 69365 | break; | ||||
| 69366 | } while (false); | ||||
| 69367 | |||||
| 69368 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69369 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69370 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69371 | !InitIds(cx, atomsCache)) || | ||||
| 69372 | !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) { | ||||
| 69373 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69374 | return; | ||||
| 69375 | } | ||||
| 69376 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69377 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69378 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69379 | aRv.NoteJSContextException(cx); | ||||
| 69380 | return; | ||||
| 69381 | } | ||||
| 69382 | } | ||||
| 69383 | |||||
| 69384 | void | ||||
| 69385 | TestJSImplInterfaceJSImpl::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69386 | { | ||||
| 69387 | CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69388 | if (aRv.Failed()) { | ||||
| 69389 | return; | ||||
| 69390 | } | ||||
| 69391 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69391); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69391; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69392 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69393 | |||||
| 69394 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69395 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69396 | if (!argv.resize(1)) { | ||||
| 69397 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69398 | // the right thing with that. | ||||
| 69399 | return; | ||||
| 69400 | } | ||||
| 69401 | unsigned argc = 1; | ||||
| 69402 | |||||
| 69403 | do { | ||||
| 69404 | argv[0].setBoolean(arg); | ||||
| 69405 | break; | ||||
| 69406 | } while (false); | ||||
| 69407 | |||||
| 69408 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69409 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69410 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69411 | !InitIds(cx, atomsCache)) || | ||||
| 69412 | !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) { | ||||
| 69413 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69414 | return; | ||||
| 69415 | } | ||||
| 69416 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69417 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69418 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69419 | aRv.NoteJSContextException(cx); | ||||
| 69420 | return; | ||||
| 69421 | } | ||||
| 69422 | } | ||||
| 69423 | |||||
| 69424 | void | ||||
| 69425 | TestJSImplInterfaceJSImpl::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69426 | { | ||||
| 69427 | CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69428 | if (aRv.Failed()) { | ||||
| 69429 | return; | ||||
| 69430 | } | ||||
| 69431 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69431); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69431; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69432 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69433 | |||||
| 69434 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69435 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69436 | if (!argv.resize(1)) { | ||||
| 69437 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69438 | // the right thing with that. | ||||
| 69439 | return; | ||||
| 69440 | } | ||||
| 69441 | unsigned argc = 1; | ||||
| 69442 | |||||
| 69443 | do { | ||||
| 69444 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 69445 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69445); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69445; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69446 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69447 | return; | ||||
| 69448 | } | ||||
| 69449 | break; | ||||
| 69450 | } while (false); | ||||
| 69451 | |||||
| 69452 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69453 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69454 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69455 | !InitIds(cx, atomsCache)) || | ||||
| 69456 | !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) { | ||||
| 69457 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69458 | return; | ||||
| 69459 | } | ||||
| 69460 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69461 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69462 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69463 | aRv.NoteJSContextException(cx); | ||||
| 69464 | return; | ||||
| 69465 | } | ||||
| 69466 | } | ||||
| 69467 | |||||
| 69468 | void | ||||
| 69469 | TestJSImplInterfaceJSImpl::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69470 | { | ||||
| 69471 | CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69472 | if (aRv.Failed()) { | ||||
| 69473 | return; | ||||
| 69474 | } | ||||
| 69475 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69475); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69475; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69476 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69477 | |||||
| 69478 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69479 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69480 | if (!argv.resize(1)) { | ||||
| 69481 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69482 | // the right thing with that. | ||||
| 69483 | return; | ||||
| 69484 | } | ||||
| 69485 | unsigned argc = 1; | ||||
| 69486 | |||||
| 69487 | do { | ||||
| 69488 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 69489 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 69490 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69491 | return; | ||||
| 69492 | } | ||||
| 69493 | break; | ||||
| 69494 | } while (false); | ||||
| 69495 | |||||
| 69496 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69497 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69498 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69499 | !InitIds(cx, atomsCache)) || | ||||
| 69500 | !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) { | ||||
| 69501 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69502 | return; | ||||
| 69503 | } | ||||
| 69504 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69505 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69506 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69507 | aRv.NoteJSContextException(cx); | ||||
| 69508 | return; | ||||
| 69509 | } | ||||
| 69510 | } | ||||
| 69511 | |||||
| 69512 | void | ||||
| 69513 | TestJSImplInterfaceJSImpl::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69514 | { | ||||
| 69515 | CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69516 | if (aRv.Failed()) { | ||||
| 69517 | return; | ||||
| 69518 | } | ||||
| 69519 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69519); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69519; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69520 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69521 | |||||
| 69522 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69523 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69524 | if (!argv.resize(1)) { | ||||
| 69525 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69526 | // the right thing with that. | ||||
| 69527 | return; | ||||
| 69528 | } | ||||
| 69529 | unsigned argc = 1; | ||||
| 69530 | |||||
| 69531 | do { | ||||
| 69532 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 69533 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69534 | return; | ||||
| 69535 | } | ||||
| 69536 | break; | ||||
| 69537 | } while (false); | ||||
| 69538 | |||||
| 69539 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69540 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69541 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69542 | !InitIds(cx, atomsCache)) || | ||||
| 69543 | !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) { | ||||
| 69544 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69545 | return; | ||||
| 69546 | } | ||||
| 69547 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69548 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69549 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69550 | aRv.NoteJSContextException(cx); | ||||
| 69551 | return; | ||||
| 69552 | } | ||||
| 69553 | } | ||||
| 69554 | |||||
| 69555 | void | ||||
| 69556 | TestJSImplInterfaceJSImpl::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69557 | { | ||||
| 69558 | CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69559 | if (aRv.Failed()) { | ||||
| 69560 | return; | ||||
| 69561 | } | ||||
| 69562 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69562); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69562; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69563 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69564 | |||||
| 69565 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69566 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69567 | if (!argv.resize(1)) { | ||||
| 69568 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69569 | // the right thing with that. | ||||
| 69570 | return; | ||||
| 69571 | } | ||||
| 69572 | unsigned argc = 1; | ||||
| 69573 | |||||
| 69574 | do { | ||||
| 69575 | argv[0].setInt32(int32_t(arg)); | ||||
| 69576 | break; | ||||
| 69577 | } while (false); | ||||
| 69578 | |||||
| 69579 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69580 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69581 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69582 | !InitIds(cx, atomsCache)) || | ||||
| 69583 | !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) { | ||||
| 69584 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69585 | return; | ||||
| 69586 | } | ||||
| 69587 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69588 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69589 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69590 | aRv.NoteJSContextException(cx); | ||||
| 69591 | return; | ||||
| 69592 | } | ||||
| 69593 | } | ||||
| 69594 | |||||
| 69595 | void | ||||
| 69596 | TestJSImplInterfaceJSImpl::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69597 | { | ||||
| 69598 | CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69599 | if (aRv.Failed()) { | ||||
| 69600 | return; | ||||
| 69601 | } | ||||
| 69602 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69602; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69603 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69604 | |||||
| 69605 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69606 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69607 | if (!argv.resize(1)) { | ||||
| 69608 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69609 | // the right thing with that. | ||||
| 69610 | return; | ||||
| 69611 | } | ||||
| 69612 | unsigned argc = 1; | ||||
| 69613 | |||||
| 69614 | do { | ||||
| 69615 | if (!ToJSValue(cx, arg, argv[0])) { | ||||
| 69616 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69617 | return; | ||||
| 69618 | } | ||||
| 69619 | break; | ||||
| 69620 | } while (false); | ||||
| 69621 | |||||
| 69622 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69623 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69624 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69625 | !InitIds(cx, atomsCache)) || | ||||
| 69626 | !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) { | ||||
| 69627 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69628 | return; | ||||
| 69629 | } | ||||
| 69630 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69631 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69632 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69633 | aRv.NoteJSContextException(cx); | ||||
| 69634 | return; | ||||
| 69635 | } | ||||
| 69636 | } | ||||
| 69637 | |||||
| 69638 | void | ||||
| 69639 | TestJSImplInterfaceJSImpl::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69640 | { | ||||
| 69641 | CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69642 | if (aRv.Failed()) { | ||||
| 69643 | return; | ||||
| 69644 | } | ||||
| 69645 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69645); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69645; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69646 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69647 | |||||
| 69648 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69649 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69650 | if (!argv.resize(1)) { | ||||
| 69651 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69652 | // the right thing with that. | ||||
| 69653 | return; | ||||
| 69654 | } | ||||
| 69655 | unsigned argc = 1; | ||||
| 69656 | |||||
| 69657 | do { | ||||
| 69658 | argv[0].setInt32(int32_t(arg)); | ||||
| 69659 | break; | ||||
| 69660 | } while (false); | ||||
| 69661 | |||||
| 69662 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69663 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69664 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69665 | !InitIds(cx, atomsCache)) || | ||||
| 69666 | !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) { | ||||
| 69667 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69668 | return; | ||||
| 69669 | } | ||||
| 69670 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69671 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69672 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69673 | aRv.NoteJSContextException(cx); | ||||
| 69674 | return; | ||||
| 69675 | } | ||||
| 69676 | } | ||||
| 69677 | |||||
| 69678 | void | ||||
| 69679 | TestJSImplInterfaceJSImpl::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69680 | { | ||||
| 69681 | CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69682 | if (aRv.Failed()) { | ||||
| 69683 | return; | ||||
| 69684 | } | ||||
| 69685 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69685; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69686 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69687 | |||||
| 69688 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69689 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69690 | if (!argv.resize(1)) { | ||||
| 69691 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69692 | // the right thing with that. | ||||
| 69693 | return; | ||||
| 69694 | } | ||||
| 69695 | unsigned argc = 1; | ||||
| 69696 | |||||
| 69697 | do { | ||||
| 69698 | argv[0].setBoolean(arg); | ||||
| 69699 | break; | ||||
| 69700 | } while (false); | ||||
| 69701 | |||||
| 69702 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69703 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69704 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69705 | !InitIds(cx, atomsCache)) || | ||||
| 69706 | !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) { | ||||
| 69707 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69708 | return; | ||||
| 69709 | } | ||||
| 69710 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69711 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69712 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69713 | aRv.NoteJSContextException(cx); | ||||
| 69714 | return; | ||||
| 69715 | } | ||||
| 69716 | } | ||||
| 69717 | |||||
| 69718 | void | ||||
| 69719 | TestJSImplInterfaceJSImpl::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69720 | { | ||||
| 69721 | CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69722 | if (aRv.Failed()) { | ||||
| 69723 | return; | ||||
| 69724 | } | ||||
| 69725 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69725); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69725; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69726 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69727 | |||||
| 69728 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69729 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69730 | if (!argv.resize(1)) { | ||||
| 69731 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69732 | // the right thing with that. | ||||
| 69733 | return; | ||||
| 69734 | } | ||||
| 69735 | unsigned argc = 1; | ||||
| 69736 | |||||
| 69737 | do { | ||||
| 69738 | argv[0].setInt32(int32_t(arg)); | ||||
| 69739 | break; | ||||
| 69740 | } while (false); | ||||
| 69741 | |||||
| 69742 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69743 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69744 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69745 | !InitIds(cx, atomsCache)) || | ||||
| 69746 | !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) { | ||||
| 69747 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69748 | return; | ||||
| 69749 | } | ||||
| 69750 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69751 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69752 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69753 | aRv.NoteJSContextException(cx); | ||||
| 69754 | return; | ||||
| 69755 | } | ||||
| 69756 | } | ||||
| 69757 | |||||
| 69758 | void | ||||
| 69759 | TestJSImplInterfaceJSImpl::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69760 | { | ||||
| 69761 | CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69762 | if (aRv.Failed()) { | ||||
| 69763 | return; | ||||
| 69764 | } | ||||
| 69765 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69765); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69765; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69766 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69767 | |||||
| 69768 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69769 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69770 | if (!argv.resize(1)) { | ||||
| 69771 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69772 | // the right thing with that. | ||||
| 69773 | return; | ||||
| 69774 | } | ||||
| 69775 | unsigned argc = 1; | ||||
| 69776 | |||||
| 69777 | do { | ||||
| 69778 | argv[0].setBoolean(arg); | ||||
| 69779 | break; | ||||
| 69780 | } while (false); | ||||
| 69781 | |||||
| 69782 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69783 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69784 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69785 | !InitIds(cx, atomsCache)) || | ||||
| 69786 | !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) { | ||||
| 69787 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69788 | return; | ||||
| 69789 | } | ||||
| 69790 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69791 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69792 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69793 | aRv.NoteJSContextException(cx); | ||||
| 69794 | return; | ||||
| 69795 | } | ||||
| 69796 | } | ||||
| 69797 | |||||
| 69798 | void | ||||
| 69799 | TestJSImplInterfaceJSImpl::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69800 | { | ||||
| 69801 | CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69802 | if (aRv.Failed()) { | ||||
| 69803 | return; | ||||
| 69804 | } | ||||
| 69805 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69805); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69805; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69806 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69807 | |||||
| 69808 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69809 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69810 | if (!argv.resize(1)) { | ||||
| 69811 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69812 | // the right thing with that. | ||||
| 69813 | return; | ||||
| 69814 | } | ||||
| 69815 | unsigned argc = 1; | ||||
| 69816 | |||||
| 69817 | do { | ||||
| 69818 | if (!NonVoidByteStringToJsval(cx, arg, argv[0])) { | ||||
| 69819 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69820 | return; | ||||
| 69821 | } | ||||
| 69822 | break; | ||||
| 69823 | } while (false); | ||||
| 69824 | |||||
| 69825 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69826 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69827 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69828 | !InitIds(cx, atomsCache)) || | ||||
| 69829 | !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) { | ||||
| 69830 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69831 | return; | ||||
| 69832 | } | ||||
| 69833 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69834 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69835 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69836 | aRv.NoteJSContextException(cx); | ||||
| 69837 | return; | ||||
| 69838 | } | ||||
| 69839 | } | ||||
| 69840 | |||||
| 69841 | void | ||||
| 69842 | TestJSImplInterfaceJSImpl::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69843 | { | ||||
| 69844 | CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69845 | if (aRv.Failed()) { | ||||
| 69846 | return; | ||||
| 69847 | } | ||||
| 69848 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69848); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69848; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69849 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69850 | |||||
| 69851 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69852 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69853 | if (!argv.resize(1)) { | ||||
| 69854 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69855 | // the right thing with that. | ||||
| 69856 | return; | ||||
| 69857 | } | ||||
| 69858 | unsigned argc = 1; | ||||
| 69859 | |||||
| 69860 | do { | ||||
| 69861 | argv[0].setInt32(int32_t(arg)); | ||||
| 69862 | break; | ||||
| 69863 | } while (false); | ||||
| 69864 | |||||
| 69865 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69866 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69867 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69868 | !InitIds(cx, atomsCache)) || | ||||
| 69869 | !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) { | ||||
| 69870 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69871 | return; | ||||
| 69872 | } | ||||
| 69873 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69874 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69875 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69876 | aRv.NoteJSContextException(cx); | ||||
| 69877 | return; | ||||
| 69878 | } | ||||
| 69879 | } | ||||
| 69880 | |||||
| 69881 | void | ||||
| 69882 | TestJSImplInterfaceJSImpl::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69883 | { | ||||
| 69884 | CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69885 | if (aRv.Failed()) { | ||||
| 69886 | return; | ||||
| 69887 | } | ||||
| 69888 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69888); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69888; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69889 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69890 | |||||
| 69891 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69892 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69893 | if (!argv.resize(1)) { | ||||
| 69894 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69895 | // the right thing with that. | ||||
| 69896 | return; | ||||
| 69897 | } | ||||
| 69898 | unsigned argc = 1; | ||||
| 69899 | |||||
| 69900 | do { | ||||
| 69901 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 69902 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 69902); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 69902; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69903 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69904 | return; | ||||
| 69905 | } | ||||
| 69906 | break; | ||||
| 69907 | } while (false); | ||||
| 69908 | |||||
| 69909 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69910 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69911 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69912 | !InitIds(cx, atomsCache)) || | ||||
| 69913 | !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) { | ||||
| 69914 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69915 | return; | ||||
| 69916 | } | ||||
| 69917 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69918 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69919 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69920 | aRv.NoteJSContextException(cx); | ||||
| 69921 | return; | ||||
| 69922 | } | ||||
| 69923 | } | ||||
| 69924 | |||||
| 69925 | void | ||||
| 69926 | TestJSImplInterfaceJSImpl::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69927 | { | ||||
| 69928 | CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69929 | if (aRv.Failed()) { | ||||
| 69930 | return; | ||||
| 69931 | } | ||||
| 69932 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69932); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69932; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69933 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69934 | |||||
| 69935 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69936 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69937 | if (!argv.resize(1)) { | ||||
| 69938 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69939 | // the right thing with that. | ||||
| 69940 | return; | ||||
| 69941 | } | ||||
| 69942 | unsigned argc = 1; | ||||
| 69943 | |||||
| 69944 | do { | ||||
| 69945 | if (arg.IsNull()) { | ||||
| 69946 | argv[0].setNull(); | ||||
| 69947 | break; | ||||
| 69948 | } | ||||
| 69949 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 69950 | break; | ||||
| 69951 | } while (false); | ||||
| 69952 | |||||
| 69953 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69954 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69955 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69956 | !InitIds(cx, atomsCache)) || | ||||
| 69957 | !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) { | ||||
| 69958 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69959 | return; | ||||
| 69960 | } | ||||
| 69961 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 69962 | if (!JS::Call(cx, thisValue, callable, | ||||
| 69963 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 69964 | aRv.NoteJSContextException(cx); | ||||
| 69965 | return; | ||||
| 69966 | } | ||||
| 69967 | } | ||||
| 69968 | |||||
| 69969 | void | ||||
| 69970 | TestJSImplInterfaceJSImpl::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 69971 | { | ||||
| 69972 | CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 69973 | if (aRv.Failed()) { | ||||
| 69974 | return; | ||||
| 69975 | } | ||||
| 69976 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 69976); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 69976; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 69977 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 69978 | |||||
| 69979 | JS::Rooted<JS::Value> rval(cx); | ||||
| 69980 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 69981 | if (!argv.resize(1)) { | ||||
| 69982 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 69983 | // the right thing with that. | ||||
| 69984 | return; | ||||
| 69985 | } | ||||
| 69986 | unsigned argc = 1; | ||||
| 69987 | |||||
| 69988 | do { | ||||
| 69989 | if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) { | ||||
| 69990 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 69991 | return; | ||||
| 69992 | } | ||||
| 69993 | break; | ||||
| 69994 | } while (false); | ||||
| 69995 | |||||
| 69996 | JS::Rooted<JS::Value> callable(cx); | ||||
| 69997 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 69998 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 69999 | !InitIds(cx, atomsCache)) || | ||||
| 70000 | !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) { | ||||
| 70001 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70002 | return; | ||||
| 70003 | } | ||||
| 70004 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70005 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70006 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70007 | aRv.NoteJSContextException(cx); | ||||
| 70008 | return; | ||||
| 70009 | } | ||||
| 70010 | } | ||||
| 70011 | |||||
| 70012 | void | ||||
| 70013 | TestJSImplInterfaceJSImpl::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70014 | { | ||||
| 70015 | CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70016 | if (aRv.Failed()) { | ||||
| 70017 | return; | ||||
| 70018 | } | ||||
| 70019 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70019); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70019; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70020 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70021 | |||||
| 70022 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70023 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70024 | if (!argv.resize(1)) { | ||||
| 70025 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70026 | // the right thing with that. | ||||
| 70027 | return; | ||||
| 70028 | } | ||||
| 70029 | unsigned argc = 1; | ||||
| 70030 | |||||
| 70031 | do { | ||||
| 70032 | if (arg.IsNull()) { | ||||
| 70033 | argv[0].setNull(); | ||||
| 70034 | break; | ||||
| 70035 | } | ||||
| 70036 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 70037 | break; | ||||
| 70038 | } while (false); | ||||
| 70039 | |||||
| 70040 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70041 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70042 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70043 | !InitIds(cx, atomsCache)) || | ||||
| 70044 | !GetCallableProperty(cx, atomsCache->overload10_id, &callable)) { | ||||
| 70045 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70046 | return; | ||||
| 70047 | } | ||||
| 70048 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70049 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70050 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70051 | aRv.NoteJSContextException(cx); | ||||
| 70052 | return; | ||||
| 70053 | } | ||||
| 70054 | } | ||||
| 70055 | |||||
| 70056 | void | ||||
| 70057 | TestJSImplInterfaceJSImpl::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70058 | { | ||||
| 70059 | CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70060 | if (aRv.Failed()) { | ||||
| 70061 | return; | ||||
| 70062 | } | ||||
| 70063 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70063); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70063; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70064 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70065 | |||||
| 70066 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70067 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70068 | if (!argv.resize(1)) { | ||||
| 70069 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70070 | // the right thing with that. | ||||
| 70071 | return; | ||||
| 70072 | } | ||||
| 70073 | unsigned argc = 1; | ||||
| 70074 | |||||
| 70075 | do { | ||||
| 70076 | JS::ExposeObjectToActiveJS(arg); | ||||
| 70077 | argv[0].setObject(*arg); | ||||
| 70078 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 70079 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70080 | return; | ||||
| 70081 | } | ||||
| 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->overload10_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 | |||||
| 70101 | void | ||||
| 70102 | TestJSImplInterfaceJSImpl::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70103 | { | ||||
| 70104 | CallSetup s(this, aRv, "TestJSImplInterface.overload11", 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 { *((volatile int *)__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 | argv[0].setInt32(int32_t(arg)); | ||||
| 70122 | break; | ||||
| 70123 | } while (false); | ||||
| 70124 | |||||
| 70125 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70126 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70127 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70128 | !InitIds(cx, atomsCache)) || | ||||
| 70129 | !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) { | ||||
| 70130 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70131 | return; | ||||
| 70132 | } | ||||
| 70133 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70134 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70135 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70136 | aRv.NoteJSContextException(cx); | ||||
| 70137 | return; | ||||
| 70138 | } | ||||
| 70139 | } | ||||
| 70140 | |||||
| 70141 | void | ||||
| 70142 | TestJSImplInterfaceJSImpl::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70143 | { | ||||
| 70144 | CallSetup s(this, aRv, "TestJSImplInterface.overload11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70145 | if (aRv.Failed()) { | ||||
| 70146 | return; | ||||
| 70147 | } | ||||
| 70148 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70148); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70148; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70149 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70150 | |||||
| 70151 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70152 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70153 | if (!argv.resize(1)) { | ||||
| 70154 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70155 | // the right thing with that. | ||||
| 70156 | return; | ||||
| 70157 | } | ||||
| 70158 | unsigned argc = 1; | ||||
| 70159 | |||||
| 70160 | do { | ||||
| 70161 | if (!xpc::StringToJsval(cx, arg, argv[0])) { | ||||
| 70162 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70163 | return; | ||||
| 70164 | } | ||||
| 70165 | break; | ||||
| 70166 | } while (false); | ||||
| 70167 | |||||
| 70168 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70169 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70170 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70171 | !InitIds(cx, atomsCache)) || | ||||
| 70172 | !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) { | ||||
| 70173 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70174 | return; | ||||
| 70175 | } | ||||
| 70176 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70177 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70178 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70179 | aRv.NoteJSContextException(cx); | ||||
| 70180 | return; | ||||
| 70181 | } | ||||
| 70182 | } | ||||
| 70183 | |||||
| 70184 | void | ||||
| 70185 | TestJSImplInterfaceJSImpl::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70186 | { | ||||
| 70187 | CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70188 | if (aRv.Failed()) { | ||||
| 70189 | return; | ||||
| 70190 | } | ||||
| 70191 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70191); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70191; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70192 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70193 | |||||
| 70194 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70195 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70196 | if (!argv.resize(1)) { | ||||
| 70197 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70198 | // the right thing with that. | ||||
| 70199 | return; | ||||
| 70200 | } | ||||
| 70201 | unsigned argc = 1; | ||||
| 70202 | |||||
| 70203 | do { | ||||
| 70204 | argv[0].setInt32(int32_t(arg)); | ||||
| 70205 | break; | ||||
| 70206 | } while (false); | ||||
| 70207 | |||||
| 70208 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70209 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70210 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70211 | !InitIds(cx, atomsCache)) || | ||||
| 70212 | !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) { | ||||
| 70213 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70214 | return; | ||||
| 70215 | } | ||||
| 70216 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70217 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70218 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70219 | aRv.NoteJSContextException(cx); | ||||
| 70220 | return; | ||||
| 70221 | } | ||||
| 70222 | } | ||||
| 70223 | |||||
| 70224 | void | ||||
| 70225 | TestJSImplInterfaceJSImpl::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70226 | { | ||||
| 70227 | CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70228 | if (aRv.Failed()) { | ||||
| 70229 | return; | ||||
| 70230 | } | ||||
| 70231 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70231); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70231; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70232 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70233 | |||||
| 70234 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70235 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70236 | if (!argv.resize(1)) { | ||||
| 70237 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70238 | // the right thing with that. | ||||
| 70239 | return; | ||||
| 70240 | } | ||||
| 70241 | unsigned argc = 1; | ||||
| 70242 | |||||
| 70243 | do { | ||||
| 70244 | if (arg.IsNull()) { | ||||
| 70245 | argv[0].setNull(); | ||||
| 70246 | break; | ||||
| 70247 | } | ||||
| 70248 | argv[0].setBoolean(arg.Value()); | ||||
| 70249 | break; | ||||
| 70250 | } while (false); | ||||
| 70251 | |||||
| 70252 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70253 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70254 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70255 | !InitIds(cx, atomsCache)) || | ||||
| 70256 | !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) { | ||||
| 70257 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70258 | return; | ||||
| 70259 | } | ||||
| 70260 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70261 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70262 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70263 | aRv.NoteJSContextException(cx); | ||||
| 70264 | return; | ||||
| 70265 | } | ||||
| 70266 | } | ||||
| 70267 | |||||
| 70268 | void | ||||
| 70269 | TestJSImplInterfaceJSImpl::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70270 | { | ||||
| 70271 | CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70272 | if (aRv.Failed()) { | ||||
| 70273 | return; | ||||
| 70274 | } | ||||
| 70275 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70275); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70275; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70276 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70277 | |||||
| 70278 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70279 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70280 | if (!argv.resize(1)) { | ||||
| 70281 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70282 | // the right thing with that. | ||||
| 70283 | return; | ||||
| 70284 | } | ||||
| 70285 | unsigned argc = 1; | ||||
| 70286 | |||||
| 70287 | do { | ||||
| 70288 | if (arg.IsNull()) { | ||||
| 70289 | argv[0].setNull(); | ||||
| 70290 | break; | ||||
| 70291 | } | ||||
| 70292 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 70293 | break; | ||||
| 70294 | } while (false); | ||||
| 70295 | |||||
| 70296 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70297 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70298 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70299 | !InitIds(cx, atomsCache)) || | ||||
| 70300 | !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) { | ||||
| 70301 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70302 | return; | ||||
| 70303 | } | ||||
| 70304 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70305 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70306 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70307 | aRv.NoteJSContextException(cx); | ||||
| 70308 | return; | ||||
| 70309 | } | ||||
| 70310 | } | ||||
| 70311 | |||||
| 70312 | void | ||||
| 70313 | TestJSImplInterfaceJSImpl::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70314 | { | ||||
| 70315 | CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70316 | if (aRv.Failed()) { | ||||
| 70317 | return; | ||||
| 70318 | } | ||||
| 70319 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70319); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70319; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70320 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70321 | |||||
| 70322 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70323 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70324 | if (!argv.resize(1)) { | ||||
| 70325 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70326 | // the right thing with that. | ||||
| 70327 | return; | ||||
| 70328 | } | ||||
| 70329 | unsigned argc = 1; | ||||
| 70330 | |||||
| 70331 | do { | ||||
| 70332 | argv[0].setBoolean(arg); | ||||
| 70333 | break; | ||||
| 70334 | } while (false); | ||||
| 70335 | |||||
| 70336 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70337 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70338 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70339 | !InitIds(cx, atomsCache)) || | ||||
| 70340 | !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) { | ||||
| 70341 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70342 | return; | ||||
| 70343 | } | ||||
| 70344 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70345 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70346 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70347 | aRv.NoteJSContextException(cx); | ||||
| 70348 | return; | ||||
| 70349 | } | ||||
| 70350 | } | ||||
| 70351 | |||||
| 70352 | void | ||||
| 70353 | TestJSImplInterfaceJSImpl::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70354 | { | ||||
| 70355 | CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70356 | if (aRv.Failed()) { | ||||
| 70357 | return; | ||||
| 70358 | } | ||||
| 70359 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70359); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70359; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70360 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70361 | |||||
| 70362 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70363 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70364 | if (!argv.resize(1)) { | ||||
| 70365 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70366 | // the right thing with that. | ||||
| 70367 | return; | ||||
| 70368 | } | ||||
| 70369 | unsigned argc = 1; | ||||
| 70370 | |||||
| 70371 | do { | ||||
| 70372 | if (arg.WasPassed()) { | ||||
| 70373 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 70374 | break; | ||||
| 70375 | } else if (argc == 1) { | ||||
| 70376 | // This is our current trailing argument; reduce argc | ||||
| 70377 | --argc; | ||||
| 70378 | } else { | ||||
| 70379 | argv[0].setUndefined(); | ||||
| 70380 | } | ||||
| 70381 | } while (false); | ||||
| 70382 | |||||
| 70383 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70384 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70385 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70386 | !InitIds(cx, atomsCache)) || | ||||
| 70387 | !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) { | ||||
| 70388 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70389 | return; | ||||
| 70390 | } | ||||
| 70391 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70392 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70393 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70394 | aRv.NoteJSContextException(cx); | ||||
| 70395 | return; | ||||
| 70396 | } | ||||
| 70397 | } | ||||
| 70398 | |||||
| 70399 | void | ||||
| 70400 | TestJSImplInterfaceJSImpl::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70401 | { | ||||
| 70402 | CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70403 | if (aRv.Failed()) { | ||||
| 70404 | return; | ||||
| 70405 | } | ||||
| 70406 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70406; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70407 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70408 | |||||
| 70409 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70410 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70411 | if (!argv.resize(1)) { | ||||
| 70412 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70413 | // the right thing with that. | ||||
| 70414 | return; | ||||
| 70415 | } | ||||
| 70416 | unsigned argc = 1; | ||||
| 70417 | |||||
| 70418 | do { | ||||
| 70419 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 70420 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 70420); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 70420; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70421 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70422 | return; | ||||
| 70423 | } | ||||
| 70424 | break; | ||||
| 70425 | } while (false); | ||||
| 70426 | |||||
| 70427 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70428 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70429 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70430 | !InitIds(cx, atomsCache)) || | ||||
| 70431 | !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) { | ||||
| 70432 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70433 | return; | ||||
| 70434 | } | ||||
| 70435 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70436 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70437 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70438 | aRv.NoteJSContextException(cx); | ||||
| 70439 | return; | ||||
| 70440 | } | ||||
| 70441 | } | ||||
| 70442 | |||||
| 70443 | void | ||||
| 70444 | TestJSImplInterfaceJSImpl::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70445 | { | ||||
| 70446 | CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70447 | if (aRv.Failed()) { | ||||
| 70448 | return; | ||||
| 70449 | } | ||||
| 70450 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70450); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70450; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70451 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70452 | |||||
| 70453 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70454 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70455 | if (!argv.resize(1)) { | ||||
| 70456 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70457 | // the right thing with that. | ||||
| 70458 | return; | ||||
| 70459 | } | ||||
| 70460 | unsigned argc = 1; | ||||
| 70461 | |||||
| 70462 | do { | ||||
| 70463 | argv[0].setInt32(int32_t(arg)); | ||||
| 70464 | break; | ||||
| 70465 | } while (false); | ||||
| 70466 | |||||
| 70467 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70468 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70469 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70470 | !InitIds(cx, atomsCache)) || | ||||
| 70471 | !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) { | ||||
| 70472 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70473 | return; | ||||
| 70474 | } | ||||
| 70475 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70476 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70477 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70478 | aRv.NoteJSContextException(cx); | ||||
| 70479 | return; | ||||
| 70480 | } | ||||
| 70481 | } | ||||
| 70482 | |||||
| 70483 | void | ||||
| 70484 | TestJSImplInterfaceJSImpl::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70485 | { | ||||
| 70486 | CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70487 | if (aRv.Failed()) { | ||||
| 70488 | return; | ||||
| 70489 | } | ||||
| 70490 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70490); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70490; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70491 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70492 | |||||
| 70493 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70494 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70495 | if (!argv.resize(1)) { | ||||
| 70496 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70497 | // the right thing with that. | ||||
| 70498 | return; | ||||
| 70499 | } | ||||
| 70500 | unsigned argc = 1; | ||||
| 70501 | |||||
| 70502 | do { | ||||
| 70503 | if (arg.WasPassed()) { | ||||
| 70504 | if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) { | ||||
| 70505 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 70505); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 70505; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70506 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70507 | return; | ||||
| 70508 | } | ||||
| 70509 | break; | ||||
| 70510 | } else if (argc == 1) { | ||||
| 70511 | // This is our current trailing argument; reduce argc | ||||
| 70512 | --argc; | ||||
| 70513 | } else { | ||||
| 70514 | argv[0].setUndefined(); | ||||
| 70515 | } | ||||
| 70516 | } while (false); | ||||
| 70517 | |||||
| 70518 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70519 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70520 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70521 | !InitIds(cx, atomsCache)) || | ||||
| 70522 | !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) { | ||||
| 70523 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70524 | return; | ||||
| 70525 | } | ||||
| 70526 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70527 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70528 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70529 | aRv.NoteJSContextException(cx); | ||||
| 70530 | return; | ||||
| 70531 | } | ||||
| 70532 | } | ||||
| 70533 | |||||
| 70534 | void | ||||
| 70535 | TestJSImplInterfaceJSImpl::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70536 | { | ||||
| 70537 | CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70538 | if (aRv.Failed()) { | ||||
| 70539 | return; | ||||
| 70540 | } | ||||
| 70541 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70541); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70541; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70542 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70543 | |||||
| 70544 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70545 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70546 | if (!argv.resize(1)) { | ||||
| 70547 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70548 | // the right thing with that. | ||||
| 70549 | return; | ||||
| 70550 | } | ||||
| 70551 | unsigned argc = 1; | ||||
| 70552 | |||||
| 70553 | do { | ||||
| 70554 | argv[0].setInt32(int32_t(arg)); | ||||
| 70555 | break; | ||||
| 70556 | } while (false); | ||||
| 70557 | |||||
| 70558 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70559 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70560 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70561 | !InitIds(cx, atomsCache)) || | ||||
| 70562 | !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) { | ||||
| 70563 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70564 | return; | ||||
| 70565 | } | ||||
| 70566 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70567 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70568 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70569 | aRv.NoteJSContextException(cx); | ||||
| 70570 | return; | ||||
| 70571 | } | ||||
| 70572 | } | ||||
| 70573 | |||||
| 70574 | void | ||||
| 70575 | TestJSImplInterfaceJSImpl::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70576 | { | ||||
| 70577 | CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70578 | if (aRv.Failed()) { | ||||
| 70579 | return; | ||||
| 70580 | } | ||||
| 70581 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70581); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70581; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70582 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70583 | |||||
| 70584 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70585 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70586 | if (!argv.resize(1)) { | ||||
| 70587 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70588 | // the right thing with that. | ||||
| 70589 | return; | ||||
| 70590 | } | ||||
| 70591 | unsigned argc = 1; | ||||
| 70592 | |||||
| 70593 | do { | ||||
| 70594 | if (arg.WasPassed()) { | ||||
| 70595 | if (!arg.Value()) { | ||||
| 70596 | argv[0].setNull(); | ||||
| 70597 | break; | ||||
| 70598 | } | ||||
| 70599 | if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) { | ||||
| 70600 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 70600); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 70600; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70601 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70602 | return; | ||||
| 70603 | } | ||||
| 70604 | break; | ||||
| 70605 | } else if (argc == 1) { | ||||
| 70606 | // This is our current trailing argument; reduce argc | ||||
| 70607 | --argc; | ||||
| 70608 | } else { | ||||
| 70609 | argv[0].setUndefined(); | ||||
| 70610 | } | ||||
| 70611 | } while (false); | ||||
| 70612 | |||||
| 70613 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70614 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70615 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70616 | !InitIds(cx, atomsCache)) || | ||||
| 70617 | !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) { | ||||
| 70618 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70619 | return; | ||||
| 70620 | } | ||||
| 70621 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70622 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70623 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70624 | aRv.NoteJSContextException(cx); | ||||
| 70625 | return; | ||||
| 70626 | } | ||||
| 70627 | } | ||||
| 70628 | |||||
| 70629 | void | ||||
| 70630 | TestJSImplInterfaceJSImpl::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70631 | { | ||||
| 70632 | CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70633 | if (aRv.Failed()) { | ||||
| 70634 | return; | ||||
| 70635 | } | ||||
| 70636 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70636); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70636; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70637 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70638 | |||||
| 70639 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70640 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70641 | if (!argv.resize(1)) { | ||||
| 70642 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70643 | // the right thing with that. | ||||
| 70644 | return; | ||||
| 70645 | } | ||||
| 70646 | unsigned argc = 1; | ||||
| 70647 | |||||
| 70648 | do { | ||||
| 70649 | |||||
| 70650 | uint32_t length = arg.Length(); | ||||
| 70651 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 70652 | if (!returnArray) { | ||||
| 70653 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70654 | return; | ||||
| 70655 | } | ||||
| 70656 | // Scope for 'tmp' | ||||
| 70657 | { | ||||
| 70658 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 70659 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 70660 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 70661 | // are different ways to succeed at wrapping the object. | ||||
| 70662 | do { | ||||
| 70663 | tmp.setInt32(int32_t(arg[sequenceIdx0])); | ||||
| 70664 | break; | ||||
| 70665 | } while (false); | ||||
| 70666 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 70667 | JSPROP_ENUMERATE)) { | ||||
| 70668 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70669 | return; | ||||
| 70670 | } | ||||
| 70671 | } | ||||
| 70672 | } | ||||
| 70673 | argv[0].setObject(*returnArray); | ||||
| 70674 | break; | ||||
| 70675 | } while (false); | ||||
| 70676 | |||||
| 70677 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70678 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70679 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70680 | !InitIds(cx, atomsCache)) || | ||||
| 70681 | !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) { | ||||
| 70682 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70683 | return; | ||||
| 70684 | } | ||||
| 70685 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70686 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70687 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70688 | aRv.NoteJSContextException(cx); | ||||
| 70689 | return; | ||||
| 70690 | } | ||||
| 70691 | } | ||||
| 70692 | |||||
| 70693 | void | ||||
| 70694 | TestJSImplInterfaceJSImpl::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70695 | { | ||||
| 70696 | CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70697 | if (aRv.Failed()) { | ||||
| 70698 | return; | ||||
| 70699 | } | ||||
| 70700 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70700); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70700; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70701 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70702 | |||||
| 70703 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70704 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70705 | if (!argv.resize(1)) { | ||||
| 70706 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70707 | // the right thing with that. | ||||
| 70708 | return; | ||||
| 70709 | } | ||||
| 70710 | unsigned argc = 1; | ||||
| 70711 | |||||
| 70712 | do { | ||||
| 70713 | |||||
| 70714 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 70715 | if (!returnObj) { | ||||
| 70716 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70717 | return; | ||||
| 70718 | } | ||||
| 70719 | // Scope for 'tmp' | ||||
| 70720 | { | ||||
| 70721 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 70722 | for (auto& entry : arg.Entries()) { | ||||
| 70723 | auto& recordValue0 = entry.mValue; | ||||
| 70724 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 70725 | // are different ways to succeed at wrapping the value. | ||||
| 70726 | do { | ||||
| 70727 | tmp.setInt32(int32_t(recordValue0)); | ||||
| 70728 | break; | ||||
| 70729 | } while (false); | ||||
| 70730 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 70731 | entry.mKey.BeginReading(), | ||||
| 70732 | entry.mKey.Length(), tmp, | ||||
| 70733 | JSPROP_ENUMERATE)) { | ||||
| 70734 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70735 | return; | ||||
| 70736 | } | ||||
| 70737 | } | ||||
| 70738 | } | ||||
| 70739 | argv[0].setObject(*returnObj); | ||||
| 70740 | break; | ||||
| 70741 | } while (false); | ||||
| 70742 | |||||
| 70743 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70744 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70745 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70746 | !InitIds(cx, atomsCache)) || | ||||
| 70747 | !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) { | ||||
| 70748 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70749 | return; | ||||
| 70750 | } | ||||
| 70751 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70752 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70753 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70754 | aRv.NoteJSContextException(cx); | ||||
| 70755 | return; | ||||
| 70756 | } | ||||
| 70757 | } | ||||
| 70758 | |||||
| 70759 | void | ||||
| 70760 | TestJSImplInterfaceJSImpl::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70761 | { | ||||
| 70762 | CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70763 | if (aRv.Failed()) { | ||||
| 70764 | return; | ||||
| 70765 | } | ||||
| 70766 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70766); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70766; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70767 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70768 | |||||
| 70769 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70770 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70771 | if (!argv.resize(1)) { | ||||
| 70772 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70773 | // the right thing with that. | ||||
| 70774 | return; | ||||
| 70775 | } | ||||
| 70776 | unsigned argc = 1; | ||||
| 70777 | |||||
| 70778 | do { | ||||
| 70779 | |||||
| 70780 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | ||||
| 70781 | if (!returnObj) { | ||||
| 70782 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70783 | return; | ||||
| 70784 | } | ||||
| 70785 | // Scope for 'tmp' | ||||
| 70786 | { | ||||
| 70787 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 70788 | for (auto& entry : arg.Entries()) { | ||||
| 70789 | auto& recordValue0 = entry.mValue; | ||||
| 70790 | // Control block to let us common up the JS_DefineUCProperty calls when there | ||||
| 70791 | // are different ways to succeed at wrapping the value. | ||||
| 70792 | do { | ||||
| 70793 | if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) { | ||||
| 70794 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70795 | return; | ||||
| 70796 | } | ||||
| 70797 | break; | ||||
| 70798 | } while (false); | ||||
| 70799 | if (!JS_DefineUCProperty(cx, returnObj, | ||||
| 70800 | entry.mKey.BeginReading(), | ||||
| 70801 | entry.mKey.Length(), tmp, | ||||
| 70802 | JSPROP_ENUMERATE)) { | ||||
| 70803 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70804 | return; | ||||
| 70805 | } | ||||
| 70806 | } | ||||
| 70807 | } | ||||
| 70808 | argv[0].setObject(*returnObj); | ||||
| 70809 | break; | ||||
| 70810 | } while (false); | ||||
| 70811 | |||||
| 70812 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70813 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70814 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70815 | !InitIds(cx, atomsCache)) || | ||||
| 70816 | !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) { | ||||
| 70817 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70818 | return; | ||||
| 70819 | } | ||||
| 70820 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70821 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70822 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70823 | aRv.NoteJSContextException(cx); | ||||
| 70824 | return; | ||||
| 70825 | } | ||||
| 70826 | } | ||||
| 70827 | |||||
| 70828 | void | ||||
| 70829 | TestJSImplInterfaceJSImpl::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70830 | { | ||||
| 70831 | CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70832 | if (aRv.Failed()) { | ||||
| 70833 | return; | ||||
| 70834 | } | ||||
| 70835 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70835); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70835; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70836 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70837 | |||||
| 70838 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70839 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70840 | if (!argv.resize(1)) { | ||||
| 70841 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70842 | // the right thing with that. | ||||
| 70843 | return; | ||||
| 70844 | } | ||||
| 70845 | unsigned argc = 1; | ||||
| 70846 | |||||
| 70847 | do { | ||||
| 70848 | |||||
| 70849 | uint32_t length = arg.Length(); | ||||
| 70850 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 70851 | if (!returnArray) { | ||||
| 70852 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70853 | return; | ||||
| 70854 | } | ||||
| 70855 | // Scope for 'tmp' | ||||
| 70856 | { | ||||
| 70857 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 70858 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 70859 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 70860 | // are different ways to succeed at wrapping the object. | ||||
| 70861 | do { | ||||
| 70862 | if (!xpc::NonVoidStringToJsval(cx, arg[sequenceIdx0], &tmp)) { | ||||
| 70863 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70864 | return; | ||||
| 70865 | } | ||||
| 70866 | break; | ||||
| 70867 | } while (false); | ||||
| 70868 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 70869 | JSPROP_ENUMERATE)) { | ||||
| 70870 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70871 | return; | ||||
| 70872 | } | ||||
| 70873 | } | ||||
| 70874 | } | ||||
| 70875 | argv[0].setObject(*returnArray); | ||||
| 70876 | break; | ||||
| 70877 | } while (false); | ||||
| 70878 | |||||
| 70879 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70880 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70881 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70882 | !InitIds(cx, atomsCache)) || | ||||
| 70883 | !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) { | ||||
| 70884 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70885 | return; | ||||
| 70886 | } | ||||
| 70887 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70888 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70889 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70890 | aRv.NoteJSContextException(cx); | ||||
| 70891 | return; | ||||
| 70892 | } | ||||
| 70893 | } | ||||
| 70894 | |||||
| 70895 | void | ||||
| 70896 | TestJSImplInterfaceJSImpl::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70897 | { | ||||
| 70898 | CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70899 | if (aRv.Failed()) { | ||||
| 70900 | return; | ||||
| 70901 | } | ||||
| 70902 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70902); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70902; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70903 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70904 | |||||
| 70905 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70906 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70907 | if (!argv.resize(1)) { | ||||
| 70908 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70909 | // the right thing with that. | ||||
| 70910 | return; | ||||
| 70911 | } | ||||
| 70912 | unsigned argc = 1; | ||||
| 70913 | |||||
| 70914 | do { | ||||
| 70915 | |||||
| 70916 | uint32_t length = arg.Length(); | ||||
| 70917 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 70918 | if (!returnArray) { | ||||
| 70919 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70920 | return; | ||||
| 70921 | } | ||||
| 70922 | // Scope for 'tmp' | ||||
| 70923 | { | ||||
| 70924 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 70925 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 70926 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 70927 | // are different ways to succeed at wrapping the object. | ||||
| 70928 | do { | ||||
| 70929 | tmp.setInt32(int32_t(arg[sequenceIdx0])); | ||||
| 70930 | break; | ||||
| 70931 | } while (false); | ||||
| 70932 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 70933 | JSPROP_ENUMERATE)) { | ||||
| 70934 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70935 | return; | ||||
| 70936 | } | ||||
| 70937 | } | ||||
| 70938 | } | ||||
| 70939 | argv[0].setObject(*returnArray); | ||||
| 70940 | break; | ||||
| 70941 | } while (false); | ||||
| 70942 | |||||
| 70943 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70944 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70945 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70946 | !InitIds(cx, atomsCache)) || | ||||
| 70947 | !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) { | ||||
| 70948 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70949 | return; | ||||
| 70950 | } | ||||
| 70951 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70952 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70953 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70954 | aRv.NoteJSContextException(cx); | ||||
| 70955 | return; | ||||
| 70956 | } | ||||
| 70957 | } | ||||
| 70958 | |||||
| 70959 | void | ||||
| 70960 | TestJSImplInterfaceJSImpl::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 70961 | { | ||||
| 70962 | CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 70963 | if (aRv.Failed()) { | ||||
| 70964 | return; | ||||
| 70965 | } | ||||
| 70966 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 70966); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 70966; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 70967 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 70968 | |||||
| 70969 | JS::Rooted<JS::Value> rval(cx); | ||||
| 70970 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 70971 | if (!argv.resize(1)) { | ||||
| 70972 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 70973 | // the right thing with that. | ||||
| 70974 | return; | ||||
| 70975 | } | ||||
| 70976 | unsigned argc = 1; | ||||
| 70977 | |||||
| 70978 | do { | ||||
| 70979 | if (!arg.ToObjectInternal(cx, argv[0])) { | ||||
| 70980 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70981 | return; | ||||
| 70982 | } | ||||
| 70983 | break; | ||||
| 70984 | } while (false); | ||||
| 70985 | |||||
| 70986 | JS::Rooted<JS::Value> callable(cx); | ||||
| 70987 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 70988 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 70989 | !InitIds(cx, atomsCache)) || | ||||
| 70990 | !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) { | ||||
| 70991 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 70992 | return; | ||||
| 70993 | } | ||||
| 70994 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 70995 | if (!JS::Call(cx, thisValue, callable, | ||||
| 70996 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 70997 | aRv.NoteJSContextException(cx); | ||||
| 70998 | return; | ||||
| 70999 | } | ||||
| 71000 | } | ||||
| 71001 | |||||
| 71002 | void | ||||
| 71003 | TestJSImplInterfaceJSImpl::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71004 | { | ||||
| 71005 | CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71006 | if (aRv.Failed()) { | ||||
| 71007 | return; | ||||
| 71008 | } | ||||
| 71009 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71009); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71009; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71010 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71011 | |||||
| 71012 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71013 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71014 | if (!argv.resize(1)) { | ||||
| 71015 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71016 | // the right thing with that. | ||||
| 71017 | return; | ||||
| 71018 | } | ||||
| 71019 | unsigned argc = 1; | ||||
| 71020 | |||||
| 71021 | do { | ||||
| 71022 | if (!arg.ToObjectInternal(cx, argv[0])) { | ||||
| 71023 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71024 | return; | ||||
| 71025 | } | ||||
| 71026 | break; | ||||
| 71027 | } while (false); | ||||
| 71028 | |||||
| 71029 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71030 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71031 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71032 | !InitIds(cx, atomsCache)) || | ||||
| 71033 | !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) { | ||||
| 71034 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71035 | return; | ||||
| 71036 | } | ||||
| 71037 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71038 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71039 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71040 | aRv.NoteJSContextException(cx); | ||||
| 71041 | return; | ||||
| 71042 | } | ||||
| 71043 | } | ||||
| 71044 | |||||
| 71045 | void | ||||
| 71046 | TestJSImplInterfaceJSImpl::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71047 | { | ||||
| 71048 | CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71049 | if (aRv.Failed()) { | ||||
| 71050 | return; | ||||
| 71051 | } | ||||
| 71052 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71052); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71052; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71053 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71054 | |||||
| 71055 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71056 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71057 | if (!argv.resize(1)) { | ||||
| 71058 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71059 | // the right thing with that. | ||||
| 71060 | return; | ||||
| 71061 | } | ||||
| 71062 | unsigned argc = 1; | ||||
| 71063 | |||||
| 71064 | do { | ||||
| 71065 | |||||
| 71066 | uint32_t length = arg.Length(); | ||||
| 71067 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 71068 | if (!returnArray) { | ||||
| 71069 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71070 | return; | ||||
| 71071 | } | ||||
| 71072 | // Scope for 'tmp' | ||||
| 71073 | { | ||||
| 71074 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 71075 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 71076 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 71077 | // are different ways to succeed at wrapping the object. | ||||
| 71078 | do { | ||||
| 71079 | tmp.setInt32(int32_t(arg[sequenceIdx0])); | ||||
| 71080 | break; | ||||
| 71081 | } while (false); | ||||
| 71082 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 71083 | JSPROP_ENUMERATE)) { | ||||
| 71084 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71085 | return; | ||||
| 71086 | } | ||||
| 71087 | } | ||||
| 71088 | } | ||||
| 71089 | argv[0].setObject(*returnArray); | ||||
| 71090 | break; | ||||
| 71091 | } while (false); | ||||
| 71092 | |||||
| 71093 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71094 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71095 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71096 | !InitIds(cx, atomsCache)) || | ||||
| 71097 | !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) { | ||||
| 71098 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71099 | return; | ||||
| 71100 | } | ||||
| 71101 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71102 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71103 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71104 | aRv.NoteJSContextException(cx); | ||||
| 71105 | return; | ||||
| 71106 | } | ||||
| 71107 | } | ||||
| 71108 | |||||
| 71109 | void | ||||
| 71110 | TestJSImplInterfaceJSImpl::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const nsTArray<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71111 | { | ||||
| 71112 | CallSetup s(this, aRv, "TestJSImplInterface.passVariadicThirdArg", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71113 | if (aRv.Failed()) { | ||||
| 71114 | return; | ||||
| 71115 | } | ||||
| 71116 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71116; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71117 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71118 | |||||
| 71119 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71120 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71121 | if (!argv.resize((3 - 1) + arg3.Length())) { | ||||
| 71122 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71123 | // the right thing with that. | ||||
| 71124 | return; | ||||
| 71125 | } | ||||
| 71126 | unsigned argc = (3 - 1) + arg3.Length(); | ||||
| 71127 | |||||
| 71128 | do { | ||||
| 71129 | for (uint32_t idx = 0; idx < arg3.Length(); ++idx) { | ||||
| 71130 | if (!GetOrCreateDOMReflector(cx, arg3[idx], argv[2 + idx])) { | ||||
| 71131 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 71131); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 71131; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71132 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71133 | return; | ||||
| 71134 | } | ||||
| 71135 | continue; | ||||
| 71136 | } | ||||
| 71137 | break; | ||||
| 71138 | } while (false); | ||||
| 71139 | |||||
| 71140 | do { | ||||
| 71141 | argv[1].setInt32(int32_t(arg2)); | ||||
| 71142 | break; | ||||
| 71143 | } while (false); | ||||
| 71144 | |||||
| 71145 | do { | ||||
| 71146 | if (!xpc::NonVoidStringToJsval(cx, arg1, argv[0])) { | ||||
| 71147 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71148 | return; | ||||
| 71149 | } | ||||
| 71150 | break; | ||||
| 71151 | } while (false); | ||||
| 71152 | |||||
| 71153 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71154 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71155 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71156 | !InitIds(cx, atomsCache)) || | ||||
| 71157 | !GetCallableProperty(cx, atomsCache->passVariadicThirdArg_id, &callable)) { | ||||
| 71158 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71159 | return; | ||||
| 71160 | } | ||||
| 71161 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71162 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71163 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71164 | aRv.NoteJSContextException(cx); | ||||
| 71165 | return; | ||||
| 71166 | } | ||||
| 71167 | } | ||||
| 71168 | |||||
| 71169 | void | ||||
| 71170 | TestJSImplInterfaceJSImpl::Prefable10(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71171 | { | ||||
| 71172 | CallSetup s(this, aRv, "TestJSImplInterface.prefable10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71173 | if (aRv.Failed()) { | ||||
| 71174 | return; | ||||
| 71175 | } | ||||
| 71176 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71176); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71176; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71177 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71178 | |||||
| 71179 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71180 | |||||
| 71181 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71182 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71183 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71184 | !InitIds(cx, atomsCache)) || | ||||
| 71185 | !GetCallableProperty(cx, atomsCache->prefable10_id, &callable)) { | ||||
| 71186 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71187 | return; | ||||
| 71188 | } | ||||
| 71189 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71190 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71191 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71192 | aRv.NoteJSContextException(cx); | ||||
| 71193 | return; | ||||
| 71194 | } | ||||
| 71195 | } | ||||
| 71196 | |||||
| 71197 | void | ||||
| 71198 | TestJSImplInterfaceJSImpl::Prefable11(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71199 | { | ||||
| 71200 | CallSetup s(this, aRv, "TestJSImplInterface.prefable11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71201 | if (aRv.Failed()) { | ||||
| 71202 | return; | ||||
| 71203 | } | ||||
| 71204 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71204); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71204; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71205 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71206 | |||||
| 71207 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71208 | |||||
| 71209 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71210 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71211 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71212 | !InitIds(cx, atomsCache)) || | ||||
| 71213 | !GetCallableProperty(cx, atomsCache->prefable11_id, &callable)) { | ||||
| 71214 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71215 | return; | ||||
| 71216 | } | ||||
| 71217 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71218 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71219 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71220 | aRv.NoteJSContextException(cx); | ||||
| 71221 | return; | ||||
| 71222 | } | ||||
| 71223 | } | ||||
| 71224 | |||||
| 71225 | void | ||||
| 71226 | TestJSImplInterfaceJSImpl::Prefable13(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71227 | { | ||||
| 71228 | CallSetup s(this, aRv, "TestJSImplInterface.prefable13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71229 | if (aRv.Failed()) { | ||||
| 71230 | return; | ||||
| 71231 | } | ||||
| 71232 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71232); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71232; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71233 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71234 | |||||
| 71235 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71236 | |||||
| 71237 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71238 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71239 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71240 | !InitIds(cx, atomsCache)) || | ||||
| 71241 | !GetCallableProperty(cx, atomsCache->prefable13_id, &callable)) { | ||||
| 71242 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71243 | return; | ||||
| 71244 | } | ||||
| 71245 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71246 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71247 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71248 | aRv.NoteJSContextException(cx); | ||||
| 71249 | return; | ||||
| 71250 | } | ||||
| 71251 | } | ||||
| 71252 | |||||
| 71253 | void | ||||
| 71254 | TestJSImplInterfaceJSImpl::Prefable17(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71255 | { | ||||
| 71256 | CallSetup s(this, aRv, "TestJSImplInterface.prefable17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71257 | if (aRv.Failed()) { | ||||
| 71258 | return; | ||||
| 71259 | } | ||||
| 71260 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71260); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71260; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71261 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71262 | |||||
| 71263 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71264 | |||||
| 71265 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71266 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71267 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71268 | !InitIds(cx, atomsCache)) || | ||||
| 71269 | !GetCallableProperty(cx, atomsCache->prefable17_id, &callable)) { | ||||
| 71270 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71271 | return; | ||||
| 71272 | } | ||||
| 71273 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71274 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71275 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71276 | aRv.NoteJSContextException(cx); | ||||
| 71277 | return; | ||||
| 71278 | } | ||||
| 71279 | } | ||||
| 71280 | |||||
| 71281 | void | ||||
| 71282 | TestJSImplInterfaceJSImpl::Prefable18(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71283 | { | ||||
| 71284 | CallSetup s(this, aRv, "TestJSImplInterface.prefable18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71285 | if (aRv.Failed()) { | ||||
| 71286 | return; | ||||
| 71287 | } | ||||
| 71288 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71288); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71288; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71289 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71290 | |||||
| 71291 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71292 | |||||
| 71293 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71294 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71295 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71296 | !InitIds(cx, atomsCache)) || | ||||
| 71297 | !GetCallableProperty(cx, atomsCache->prefable18_id, &callable)) { | ||||
| 71298 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71299 | return; | ||||
| 71300 | } | ||||
| 71301 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71302 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71303 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71304 | aRv.NoteJSContextException(cx); | ||||
| 71305 | return; | ||||
| 71306 | } | ||||
| 71307 | } | ||||
| 71308 | |||||
| 71309 | void | ||||
| 71310 | TestJSImplInterfaceJSImpl::Prefable19(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71311 | { | ||||
| 71312 | CallSetup s(this, aRv, "TestJSImplInterface.prefable19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71313 | if (aRv.Failed()) { | ||||
| 71314 | return; | ||||
| 71315 | } | ||||
| 71316 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71316); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71316; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71317 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71318 | |||||
| 71319 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71320 | |||||
| 71321 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71322 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71323 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71324 | !InitIds(cx, atomsCache)) || | ||||
| 71325 | !GetCallableProperty(cx, atomsCache->prefable19_id, &callable)) { | ||||
| 71326 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71327 | return; | ||||
| 71328 | } | ||||
| 71329 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71330 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71331 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71332 | aRv.NoteJSContextException(cx); | ||||
| 71333 | return; | ||||
| 71334 | } | ||||
| 71335 | } | ||||
| 71336 | |||||
| 71337 | void | ||||
| 71338 | TestJSImplInterfaceJSImpl::Prefable20(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71339 | { | ||||
| 71340 | CallSetup s(this, aRv, "TestJSImplInterface.prefable20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71341 | if (aRv.Failed()) { | ||||
| 71342 | return; | ||||
| 71343 | } | ||||
| 71344 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71344); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71344; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71345 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71346 | |||||
| 71347 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71348 | |||||
| 71349 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71350 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71351 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71352 | !InitIds(cx, atomsCache)) || | ||||
| 71353 | !GetCallableProperty(cx, atomsCache->prefable20_id, &callable)) { | ||||
| 71354 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71355 | return; | ||||
| 71356 | } | ||||
| 71357 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71358 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71359 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71360 | aRv.NoteJSContextException(cx); | ||||
| 71361 | return; | ||||
| 71362 | } | ||||
| 71363 | } | ||||
| 71364 | |||||
| 71365 | void | ||||
| 71366 | TestJSImplInterfaceJSImpl::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71367 | { | ||||
| 71368 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71369 | if (aRv.Failed()) { | ||||
| 71370 | return; | ||||
| 71371 | } | ||||
| 71372 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71372); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71372; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71373 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71374 | |||||
| 71375 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71376 | |||||
| 71377 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71378 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71379 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71380 | !InitIds(cx, atomsCache)) || | ||||
| 71381 | !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext5_id, &callable)) { | ||||
| 71382 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71383 | return; | ||||
| 71384 | } | ||||
| 71385 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71386 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71387 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71388 | aRv.NoteJSContextException(cx); | ||||
| 71389 | return; | ||||
| 71390 | } | ||||
| 71391 | } | ||||
| 71392 | |||||
| 71393 | void | ||||
| 71394 | TestJSImplInterfaceJSImpl::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71395 | { | ||||
| 71396 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71397 | if (aRv.Failed()) { | ||||
| 71398 | return; | ||||
| 71399 | } | ||||
| 71400 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71400); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71400; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71401 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71402 | |||||
| 71403 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71404 | |||||
| 71405 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71406 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71407 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71408 | !InitIds(cx, atomsCache)) || | ||||
| 71409 | !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext6_id, &callable)) { | ||||
| 71410 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71411 | return; | ||||
| 71412 | } | ||||
| 71413 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71414 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71415 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71416 | aRv.NoteJSContextException(cx); | ||||
| 71417 | return; | ||||
| 71418 | } | ||||
| 71419 | } | ||||
| 71420 | |||||
| 71421 | void | ||||
| 71422 | TestJSImplInterfaceJSImpl::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71423 | { | ||||
| 71424 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71425 | if (aRv.Failed()) { | ||||
| 71426 | return; | ||||
| 71427 | } | ||||
| 71428 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71428); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71428; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71429 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71430 | |||||
| 71431 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71432 | |||||
| 71433 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71434 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71435 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71436 | !InitIds(cx, atomsCache)) || | ||||
| 71437 | !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext7_id, &callable)) { | ||||
| 71438 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71439 | return; | ||||
| 71440 | } | ||||
| 71441 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71442 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71443 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71444 | aRv.NoteJSContextException(cx); | ||||
| 71445 | return; | ||||
| 71446 | } | ||||
| 71447 | } | ||||
| 71448 | |||||
| 71449 | void | ||||
| 71450 | TestJSImplInterfaceJSImpl::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71451 | { | ||||
| 71452 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71453 | if (aRv.Failed()) { | ||||
| 71454 | return; | ||||
| 71455 | } | ||||
| 71456 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71456); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71456; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71457 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71458 | |||||
| 71459 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71460 | |||||
| 71461 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71462 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71463 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71464 | !InitIds(cx, atomsCache)) || | ||||
| 71465 | !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext8_id, &callable)) { | ||||
| 71466 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71467 | return; | ||||
| 71468 | } | ||||
| 71469 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71470 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71471 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71472 | aRv.NoteJSContextException(cx); | ||||
| 71473 | return; | ||||
| 71474 | } | ||||
| 71475 | } | ||||
| 71476 | |||||
| 71477 | void | ||||
| 71478 | TestJSImplInterfaceJSImpl::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71479 | { | ||||
| 71480 | CallSetup s(this, aRv, "TestJSImplInterface.passRenamedInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71481 | if (aRv.Failed()) { | ||||
| 71482 | return; | ||||
| 71483 | } | ||||
| 71484 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71484); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71484; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71485 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71486 | |||||
| 71487 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71488 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71489 | if (!argv.resize(1)) { | ||||
| 71490 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71491 | // the right thing with that. | ||||
| 71492 | return; | ||||
| 71493 | } | ||||
| 71494 | unsigned argc = 1; | ||||
| 71495 | |||||
| 71496 | do { | ||||
| 71497 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 71498 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 71498); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 71498; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71499 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71500 | return; | ||||
| 71501 | } | ||||
| 71502 | break; | ||||
| 71503 | } while (false); | ||||
| 71504 | |||||
| 71505 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71506 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71507 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71508 | !InitIds(cx, atomsCache)) || | ||||
| 71509 | !GetCallableProperty(cx, atomsCache->passRenamedInterface_id, &callable)) { | ||||
| 71510 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71511 | return; | ||||
| 71512 | } | ||||
| 71513 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71514 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71515 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71516 | aRv.NoteJSContextException(cx); | ||||
| 71517 | return; | ||||
| 71518 | } | ||||
| 71519 | } | ||||
| 71520 | |||||
| 71521 | void | ||||
| 71522 | TestJSImplInterfaceJSImpl::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71523 | { | ||||
| 71524 | CallSetup s(this, aRv, "TestJSImplInterface.throwingMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71525 | if (aRv.Failed()) { | ||||
| 71526 | return; | ||||
| 71527 | } | ||||
| 71528 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71528); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71528; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71529 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71530 | |||||
| 71531 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71532 | |||||
| 71533 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71534 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71535 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71536 | !InitIds(cx, atomsCache)) || | ||||
| 71537 | !GetCallableProperty(cx, atomsCache->throwingMethod_id, &callable)) { | ||||
| 71538 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71539 | return; | ||||
| 71540 | } | ||||
| 71541 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71542 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71543 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71544 | aRv.NoteJSContextException(cx); | ||||
| 71545 | return; | ||||
| 71546 | } | ||||
| 71547 | } | ||||
| 71548 | |||||
| 71549 | void | ||||
| 71550 | TestJSImplInterfaceJSImpl::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71551 | { | ||||
| 71552 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71553 | if (aRv.Failed()) { | ||||
| 71554 | return; | ||||
| 71555 | } | ||||
| 71556 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71556); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71556; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71557 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71558 | |||||
| 71559 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71560 | |||||
| 71561 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71562 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71563 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71564 | !InitIds(cx, atomsCache)) || | ||||
| 71565 | !GetCallableProperty(cx, atomsCache->canOOMMethod_id, &callable)) { | ||||
| 71566 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71567 | return; | ||||
| 71568 | } | ||||
| 71569 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71570 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71571 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71572 | aRv.NoteJSContextException(cx); | ||||
| 71573 | return; | ||||
| 71574 | } | ||||
| 71575 | } | ||||
| 71576 | |||||
| 71577 | void | ||||
| 71578 | TestJSImplInterfaceJSImpl::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71579 | { | ||||
| 71580 | CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71581 | if (aRv.Failed()) { | ||||
| 71582 | return; | ||||
| 71583 | } | ||||
| 71584 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71584); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71584; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71585 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71586 | |||||
| 71587 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71588 | |||||
| 71589 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71590 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71591 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71592 | !InitIds(cx, atomsCache)) || | ||||
| 71593 | !GetCallableProperty(cx, atomsCache->ceReactionsMethod_id, &callable)) { | ||||
| 71594 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71595 | return; | ||||
| 71596 | } | ||||
| 71597 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71598 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71599 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71600 | aRv.NoteJSContextException(cx); | ||||
| 71601 | return; | ||||
| 71602 | } | ||||
| 71603 | } | ||||
| 71604 | |||||
| 71605 | void | ||||
| 71606 | TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71607 | { | ||||
| 71608 | CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71609 | if (aRv.Failed()) { | ||||
| 71610 | return; | ||||
| 71611 | } | ||||
| 71612 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71612); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71612; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71613 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71614 | |||||
| 71615 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71616 | |||||
| 71617 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71618 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71619 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71620 | !InitIds(cx, atomsCache)) || | ||||
| 71621 | !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) { | ||||
| 71622 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71623 | return; | ||||
| 71624 | } | ||||
| 71625 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71626 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71627 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71628 | aRv.NoteJSContextException(cx); | ||||
| 71629 | return; | ||||
| 71630 | } | ||||
| 71631 | } | ||||
| 71632 | |||||
| 71633 | void | ||||
| 71634 | TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71635 | { | ||||
| 71636 | CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71637 | if (aRv.Failed()) { | ||||
| 71638 | return; | ||||
| 71639 | } | ||||
| 71640 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71640); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71640; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71641 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71642 | |||||
| 71643 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71644 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71645 | if (!argv.resize(1)) { | ||||
| 71646 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71647 | // the right thing with that. | ||||
| 71648 | return; | ||||
| 71649 | } | ||||
| 71650 | unsigned argc = 1; | ||||
| 71651 | |||||
| 71652 | do { | ||||
| 71653 | if (!xpc::NonVoidStringToJsval(cx, bar, argv[0])) { | ||||
| 71654 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71655 | return; | ||||
| 71656 | } | ||||
| 71657 | break; | ||||
| 71658 | } while (false); | ||||
| 71659 | |||||
| 71660 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71661 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71662 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71663 | !InitIds(cx, atomsCache)) || | ||||
| 71664 | !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) { | ||||
| 71665 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71666 | return; | ||||
| 71667 | } | ||||
| 71668 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71669 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71670 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71671 | aRv.NoteJSContextException(cx); | ||||
| 71672 | return; | ||||
| 71673 | } | ||||
| 71674 | } | ||||
| 71675 | |||||
| 71676 | void | ||||
| 71677 | TestJSImplInterfaceJSImpl::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71678 | { | ||||
| 71679 | CallSetup s(this, aRv, "TestJSImplInterface.passArgsWithDefaults", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71680 | if (aRv.Failed()) { | ||||
| 71681 | return; | ||||
| 71682 | } | ||||
| 71683 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71683); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71683; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71684 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71685 | |||||
| 71686 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71687 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71688 | if (!argv.resize(5)) { | ||||
| 71689 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71690 | // the right thing with that. | ||||
| 71691 | return; | ||||
| 71692 | } | ||||
| 71693 | unsigned argc = 5; | ||||
| 71694 | |||||
| 71695 | do { | ||||
| 71696 | if (arg5.WasPassed()) { | ||||
| 71697 | argv[4].set(JS_NumberValue(double(arg5.Value()))); | ||||
| 71698 | break; | ||||
| 71699 | } else if (argc == 5) { | ||||
| 71700 | // This is our current trailing argument; reduce argc | ||||
| 71701 | --argc; | ||||
| 71702 | } else { | ||||
| 71703 | argv[4].setUndefined(); | ||||
| 71704 | } | ||||
| 71705 | } while (false); | ||||
| 71706 | |||||
| 71707 | do { | ||||
| 71708 | argv[3].set(JS_NumberValue(double(arg4))); | ||||
| 71709 | break; | ||||
| 71710 | } while (false); | ||||
| 71711 | |||||
| 71712 | do { | ||||
| 71713 | if (!arg3.ToObjectInternal(cx, argv[2])) { | ||||
| 71714 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71715 | return; | ||||
| 71716 | } | ||||
| 71717 | break; | ||||
| 71718 | } while (false); | ||||
| 71719 | |||||
| 71720 | do { | ||||
| 71721 | if (!arg2) { | ||||
| 71722 | argv[1].setNull(); | ||||
| 71723 | break; | ||||
| 71724 | } | ||||
| 71725 | if (!GetOrCreateDOMReflector(cx, arg2, argv[1])) { | ||||
| 71726 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 71726); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 71726; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71728 | return; | ||||
| 71729 | } | ||||
| 71730 | break; | ||||
| 71731 | } while (false); | ||||
| 71732 | |||||
| 71733 | do { | ||||
| 71734 | if (arg1.WasPassed()) { | ||||
| 71735 | argv[0].setInt32(int32_t(arg1.Value())); | ||||
| 71736 | break; | ||||
| 71737 | } else if (argc == 1) { | ||||
| 71738 | // This is our current trailing argument; reduce argc | ||||
| 71739 | --argc; | ||||
| 71740 | } else { | ||||
| 71741 | argv[0].setUndefined(); | ||||
| 71742 | } | ||||
| 71743 | } while (false); | ||||
| 71744 | |||||
| 71745 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71746 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71747 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71748 | !InitIds(cx, atomsCache)) || | ||||
| 71749 | !GetCallableProperty(cx, atomsCache->passArgsWithDefaults_id, &callable)) { | ||||
| 71750 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71751 | return; | ||||
| 71752 | } | ||||
| 71753 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71754 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71755 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71756 | aRv.NoteJSContextException(cx); | ||||
| 71757 | return; | ||||
| 71758 | } | ||||
| 71759 | } | ||||
| 71760 | |||||
| 71761 | void | ||||
| 71762 | TestJSImplInterfaceJSImpl::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71763 | { | ||||
| 71764 | CallSetup s(this, aRv, "TestJSImplInterface.toJSON", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71765 | if (aRv.Failed()) { | ||||
| 71766 | return; | ||||
| 71767 | } | ||||
| 71768 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71768); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71768; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71769 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71770 | |||||
| 71771 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71772 | |||||
| 71773 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71774 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71775 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71776 | !InitIds(cx, atomsCache)) || | ||||
| 71777 | !GetCallableProperty(cx, atomsCache->toJSON_id, &callable)) { | ||||
| 71778 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71779 | return; | ||||
| 71780 | } | ||||
| 71781 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71782 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71783 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71784 | aRv.NoteJSContextException(cx); | ||||
| 71785 | return; | ||||
| 71786 | } | ||||
| 71787 | JS::Rooted<JSObject*> rvalDecl(cx); | ||||
| 71788 | if (rval.isObject()) { | ||||
| 71789 | #ifdef __clang__1 | ||||
| 71790 | #pragma clang diagnostic push | ||||
| 71791 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 71792 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 71793 | #endif // __clang__ | ||||
| 71794 | if ((false) && !CallerSubsumes(rval)) { | ||||
| 71795 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSON"); | ||||
| 71796 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71797 | return; | ||||
| 71798 | } | ||||
| 71799 | #ifdef __clang__1 | ||||
| 71800 | #pragma clang diagnostic pop | ||||
| 71801 | #endif // __clang__ | ||||
| 71802 | rvalDecl = &rval.toObject(); | ||||
| 71803 | } else { | ||||
| 71804 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSON"); | ||||
| 71805 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71806 | return; | ||||
| 71807 | } | ||||
| 71808 | aRetVal.set(rvalDecl); | ||||
| 71809 | } | ||||
| 71810 | |||||
| 71811 | void | ||||
| 71812 | TestJSImplInterfaceJSImpl::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71813 | { | ||||
| 71814 | CallSetup s(this, aRv, "TestJSImplInterface.dashed-method", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71815 | if (aRv.Failed()) { | ||||
| 71816 | return; | ||||
| 71817 | } | ||||
| 71818 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71818); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71818; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71819 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71820 | |||||
| 71821 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71822 | |||||
| 71823 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71824 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71825 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71826 | !InitIds(cx, atomsCache)) || | ||||
| 71827 | !GetCallableProperty(cx, atomsCache->dashed_method_id, &callable)) { | ||||
| 71828 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71829 | return; | ||||
| 71830 | } | ||||
| 71831 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71832 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71833 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71834 | aRv.NoteJSContextException(cx); | ||||
| 71835 | return; | ||||
| 71836 | } | ||||
| 71837 | } | ||||
| 71838 | |||||
| 71839 | void | ||||
| 71840 | TestJSImplInterfaceJSImpl::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71841 | { | ||||
| 71842 | CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71843 | if (aRv.Failed()) { | ||||
| 71844 | return; | ||||
| 71845 | } | ||||
| 71846 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71846); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71846; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71847 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71848 | |||||
| 71849 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71850 | |||||
| 71851 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71852 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71853 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71854 | !InitIds(cx, atomsCache)) || | ||||
| 71855 | !GetCallableProperty(cx, atomsCache->nonEnumerableMethod_id, &callable)) { | ||||
| 71856 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71857 | return; | ||||
| 71858 | } | ||||
| 71859 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71860 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71861 | JS::HandleValueArray::empty(), &rval)) { | ||||
| 71862 | aRv.NoteJSContextException(cx); | ||||
| 71863 | return; | ||||
| 71864 | } | ||||
| 71865 | } | ||||
| 71866 | |||||
| 71867 | void | ||||
| 71868 | TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71869 | { | ||||
| 71870 | CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71871 | if (aRv.Failed()) { | ||||
| 71872 | return; | ||||
| 71873 | } | ||||
| 71874 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71874); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71874; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71875 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71876 | |||||
| 71877 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71878 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71879 | if (!argv.resize(1)) { | ||||
| 71880 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71881 | // the right thing with that. | ||||
| 71882 | return; | ||||
| 71883 | } | ||||
| 71884 | unsigned argc = 1; | ||||
| 71885 | |||||
| 71886 | do { | ||||
| 71887 | argv[0].setObject(*foo.Obj()); | ||||
| 71888 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 71889 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71890 | return; | ||||
| 71891 | } | ||||
| 71892 | break; | ||||
| 71893 | } while (false); | ||||
| 71894 | |||||
| 71895 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71896 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71897 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71898 | !InitIds(cx, atomsCache)) || | ||||
| 71899 | !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferViewTypedef_id, &callable)) { | ||||
| 71900 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71901 | return; | ||||
| 71902 | } | ||||
| 71903 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71904 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71905 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71906 | aRv.NoteJSContextException(cx); | ||||
| 71907 | return; | ||||
| 71908 | } | ||||
| 71909 | } | ||||
| 71910 | |||||
| 71911 | void | ||||
| 71912 | TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71913 | { | ||||
| 71914 | CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71915 | if (aRv.Failed()) { | ||||
| 71916 | return; | ||||
| 71917 | } | ||||
| 71918 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71918); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71918; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71919 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71920 | |||||
| 71921 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71922 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71923 | if (!argv.resize(1)) { | ||||
| 71924 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71925 | // the right thing with that. | ||||
| 71926 | return; | ||||
| 71927 | } | ||||
| 71928 | unsigned argc = 1; | ||||
| 71929 | |||||
| 71930 | do { | ||||
| 71931 | argv[0].setObject(*foo.Obj()); | ||||
| 71932 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 71933 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71934 | return; | ||||
| 71935 | } | ||||
| 71936 | break; | ||||
| 71937 | } while (false); | ||||
| 71938 | |||||
| 71939 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71940 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71941 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71942 | !InitIds(cx, atomsCache)) || | ||||
| 71943 | !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferView_id, &callable)) { | ||||
| 71944 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71945 | return; | ||||
| 71946 | } | ||||
| 71947 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71948 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71949 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71950 | aRv.NoteJSContextException(cx); | ||||
| 71951 | return; | ||||
| 71952 | } | ||||
| 71953 | } | ||||
| 71954 | |||||
| 71955 | void | ||||
| 71956 | TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 71957 | { | ||||
| 71958 | CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 71959 | if (aRv.Failed()) { | ||||
| 71960 | return; | ||||
| 71961 | } | ||||
| 71962 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 71962); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 71962; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 71963 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 71964 | |||||
| 71965 | JS::Rooted<JS::Value> rval(cx); | ||||
| 71966 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 71967 | if (!argv.resize(1)) { | ||||
| 71968 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 71969 | // the right thing with that. | ||||
| 71970 | return; | ||||
| 71971 | } | ||||
| 71972 | unsigned argc = 1; | ||||
| 71973 | |||||
| 71974 | do { | ||||
| 71975 | if (foo.IsNull()) { | ||||
| 71976 | argv[0].setNull(); | ||||
| 71977 | break; | ||||
| 71978 | } | ||||
| 71979 | argv[0].setObject(*foo.Value().Obj()); | ||||
| 71980 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 71981 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71982 | return; | ||||
| 71983 | } | ||||
| 71984 | break; | ||||
| 71985 | } while (false); | ||||
| 71986 | |||||
| 71987 | JS::Rooted<JS::Value> callable(cx); | ||||
| 71988 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 71989 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 71990 | !InitIds(cx, atomsCache)) || | ||||
| 71991 | !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBufferView_id, &callable)) { | ||||
| 71992 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 71993 | return; | ||||
| 71994 | } | ||||
| 71995 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 71996 | if (!JS::Call(cx, thisValue, callable, | ||||
| 71997 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 71998 | aRv.NoteJSContextException(cx); | ||||
| 71999 | return; | ||||
| 72000 | } | ||||
| 72001 | } | ||||
| 72002 | |||||
| 72003 | void | ||||
| 72004 | TestJSImplInterfaceJSImpl::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72005 | { | ||||
| 72006 | CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72007 | if (aRv.Failed()) { | ||||
| 72008 | return; | ||||
| 72009 | } | ||||
| 72010 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72010); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72010; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72011 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72012 | |||||
| 72013 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72014 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 72015 | if (!argv.resize(1)) { | ||||
| 72016 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 72017 | // the right thing with that. | ||||
| 72018 | return; | ||||
| 72019 | } | ||||
| 72020 | unsigned argc = 1; | ||||
| 72021 | |||||
| 72022 | do { | ||||
| 72023 | argv[0].setObject(*foo.Obj()); | ||||
| 72024 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 72025 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72026 | return; | ||||
| 72027 | } | ||||
| 72028 | break; | ||||
| 72029 | } while (false); | ||||
| 72030 | |||||
| 72031 | JS::Rooted<JS::Value> callable(cx); | ||||
| 72032 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72033 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 72034 | !InitIds(cx, atomsCache)) || | ||||
| 72035 | !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBuffer_id, &callable)) { | ||||
| 72036 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72037 | return; | ||||
| 72038 | } | ||||
| 72039 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 72040 | if (!JS::Call(cx, thisValue, callable, | ||||
| 72041 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 72042 | aRv.NoteJSContextException(cx); | ||||
| 72043 | return; | ||||
| 72044 | } | ||||
| 72045 | } | ||||
| 72046 | |||||
| 72047 | void | ||||
| 72048 | TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72049 | { | ||||
| 72050 | CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72051 | if (aRv.Failed()) { | ||||
| 72052 | return; | ||||
| 72053 | } | ||||
| 72054 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72054); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72054; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72055 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72056 | |||||
| 72057 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72058 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 72059 | if (!argv.resize(1)) { | ||||
| 72060 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 72061 | // the right thing with that. | ||||
| 72062 | return; | ||||
| 72063 | } | ||||
| 72064 | unsigned argc = 1; | ||||
| 72065 | |||||
| 72066 | do { | ||||
| 72067 | if (foo.IsNull()) { | ||||
| 72068 | argv[0].setNull(); | ||||
| 72069 | break; | ||||
| 72070 | } | ||||
| 72071 | argv[0].setObject(*foo.Value().Obj()); | ||||
| 72072 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 72073 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72074 | return; | ||||
| 72075 | } | ||||
| 72076 | break; | ||||
| 72077 | } while (false); | ||||
| 72078 | |||||
| 72079 | JS::Rooted<JS::Value> callable(cx); | ||||
| 72080 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72081 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 72082 | !InitIds(cx, atomsCache)) || | ||||
| 72083 | !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBuffer_id, &callable)) { | ||||
| 72084 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72085 | return; | ||||
| 72086 | } | ||||
| 72087 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 72088 | if (!JS::Call(cx, thisValue, callable, | ||||
| 72089 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 72090 | aRv.NoteJSContextException(cx); | ||||
| 72091 | return; | ||||
| 72092 | } | ||||
| 72093 | } | ||||
| 72094 | |||||
| 72095 | void | ||||
| 72096 | TestJSImplInterfaceJSImpl::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72097 | { | ||||
| 72098 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72099 | if (aRv.Failed()) { | ||||
| 72100 | return; | ||||
| 72101 | } | ||||
| 72102 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72102); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72102; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72103 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72104 | |||||
| 72105 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72106 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 72107 | if (!argv.resize(1)) { | ||||
| 72108 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 72109 | // the right thing with that. | ||||
| 72110 | return; | ||||
| 72111 | } | ||||
| 72112 | unsigned argc = 1; | ||||
| 72113 | |||||
| 72114 | do { | ||||
| 72115 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 72116 | if (!foo.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 72117 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72118 | return; | ||||
| 72119 | } | ||||
| 72120 | break; | ||||
| 72121 | } while (false); | ||||
| 72122 | |||||
| 72123 | JS::Rooted<JS::Value> callable(cx); | ||||
| 72124 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72125 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 72126 | !InitIds(cx, atomsCache)) || | ||||
| 72127 | !GetCallableProperty(cx, atomsCache->passUnionArrayBuffer_id, &callable)) { | ||||
| 72128 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72129 | return; | ||||
| 72130 | } | ||||
| 72131 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 72132 | if (!JS::Call(cx, thisValue, callable, | ||||
| 72133 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 72134 | aRv.NoteJSContextException(cx); | ||||
| 72135 | return; | ||||
| 72136 | } | ||||
| 72137 | } | ||||
| 72138 | |||||
| 72139 | void | ||||
| 72140 | TestJSImplInterfaceJSImpl::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72141 | { | ||||
| 72142 | CallSetup s(this, aRv, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72143 | if (aRv.Failed()) { | ||||
| 72144 | return; | ||||
| 72145 | } | ||||
| 72146 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72146); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72146; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72147 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72148 | |||||
| 72149 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72150 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 72151 | if (!argv.resize(1)) { | ||||
| 72152 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 72153 | // the right thing with that. | ||||
| 72154 | return; | ||||
| 72155 | } | ||||
| 72156 | unsigned argc = 1; | ||||
| 72157 | |||||
| 72158 | do { | ||||
| 72159 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 72160 | if (!foo.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 72161 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72162 | return; | ||||
| 72163 | } | ||||
| 72164 | break; | ||||
| 72165 | } while (false); | ||||
| 72166 | |||||
| 72167 | JS::Rooted<JS::Value> callable(cx); | ||||
| 72168 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72169 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 72170 | !InitIds(cx, atomsCache)) || | ||||
| 72171 | !GetCallableProperty(cx, atomsCache->passUnionAllowSharedArrayBuffer_id, &callable)) { | ||||
| 72172 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72173 | return; | ||||
| 72174 | } | ||||
| 72175 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 72176 | if (!JS::Call(cx, thisValue, callable, | ||||
| 72177 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 72178 | aRv.NoteJSContextException(cx); | ||||
| 72179 | return; | ||||
| 72180 | } | ||||
| 72181 | } | ||||
| 72182 | |||||
| 72183 | void | ||||
| 72184 | TestJSImplInterfaceJSImpl::__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) | ||||
| 72185 | { | ||||
| 72186 | CallSetup s(this, aRv, "__init", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72187 | if (aRv.Failed()) { | ||||
| 72188 | return; | ||||
| 72189 | } | ||||
| 72190 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72190); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72190; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72191 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72192 | |||||
| 72193 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72194 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 72195 | if (!argv.resize(15)) { | ||||
| 72196 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 72197 | // the right thing with that. | ||||
| 72198 | return; | ||||
| 72199 | } | ||||
| 72200 | unsigned argc = 15; | ||||
| 72201 | |||||
| 72202 | do { | ||||
| 72203 | argv[14].setObject(*arrayBuf.Obj()); | ||||
| 72204 | if (!MaybeWrapNonDOMObjectValue(cx, argv[14])) { | ||||
| 72205 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72206 | return; | ||||
| 72207 | } | ||||
| 72208 | break; | ||||
| 72209 | } while (false); | ||||
| 72210 | |||||
| 72211 | do { | ||||
| 72212 | argv[13].setObject(*typedArr.Obj()); | ||||
| 72213 | if (!MaybeWrapNonDOMObjectValue(cx, argv[13])) { | ||||
| 72214 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72215 | return; | ||||
| 72216 | } | ||||
| 72217 | break; | ||||
| 72218 | } while (false); | ||||
| 72219 | |||||
| 72220 | do { | ||||
| 72221 | if (obj4.WasPassed()) { | ||||
| 72222 | if (obj4.Value()) { | ||||
| 72223 | JS::ExposeObjectToActiveJS(obj4.Value()); | ||||
| 72224 | } | ||||
| 72225 | argv[12].setObjectOrNull(obj4.Value()); | ||||
| 72226 | if (!MaybeWrapObjectOrNullValue(cx, argv[12])) { | ||||
| 72227 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72228 | return; | ||||
| 72229 | } | ||||
| 72230 | break; | ||||
| 72231 | } else if (argc == 13) { | ||||
| 72232 | // This is our current trailing argument; reduce argc | ||||
| 72233 | --argc; | ||||
| 72234 | } else { | ||||
| 72235 | argv[12].setUndefined(); | ||||
| 72236 | } | ||||
| 72237 | } while (false); | ||||
| 72238 | |||||
| 72239 | do { | ||||
| 72240 | if (obj3.WasPassed()) { | ||||
| 72241 | JS::ExposeObjectToActiveJS(obj3.Value()); | ||||
| 72242 | argv[11].setObject(*obj3.Value()); | ||||
| 72243 | if (!MaybeWrapObjectValue(cx, argv[11])) { | ||||
| 72244 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72245 | return; | ||||
| 72246 | } | ||||
| 72247 | break; | ||||
| 72248 | } else if (argc == 12) { | ||||
| 72249 | // This is our current trailing argument; reduce argc | ||||
| 72250 | --argc; | ||||
| 72251 | } else { | ||||
| 72252 | argv[11].setUndefined(); | ||||
| 72253 | } | ||||
| 72254 | } while (false); | ||||
| 72255 | |||||
| 72256 | do { | ||||
| 72257 | JS::ExposeValueToActiveJS(any2); | ||||
| 72258 | argv[10].set(any2); | ||||
| 72259 | if (!MaybeWrapValue(cx, argv[10])) { | ||||
| 72260 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72261 | return; | ||||
| 72262 | } | ||||
| 72263 | break; | ||||
| 72264 | } while (false); | ||||
| 72265 | |||||
| 72266 | do { | ||||
| 72267 | |||||
| 72268 | uint32_t length = seq.Length(); | ||||
| 72269 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | ||||
| 72270 | if (!returnArray) { | ||||
| 72271 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72272 | return; | ||||
| 72273 | } | ||||
| 72274 | // Scope for 'tmp' | ||||
| 72275 | { | ||||
| 72276 | JS::Rooted<JS::Value> tmp(cx); | ||||
| 72277 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | ||||
| 72278 | // Control block to let us common up the JS_DefineElement calls when there | ||||
| 72279 | // are different ways to succeed at wrapping the object. | ||||
| 72280 | do { | ||||
| 72281 | if (!seq[sequenceIdx0].ToObjectInternal(cx, &tmp)) { | ||||
| 72282 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72283 | return; | ||||
| 72284 | } | ||||
| 72285 | break; | ||||
| 72286 | } while (false); | ||||
| 72287 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | ||||
| 72288 | JSPROP_ENUMERATE)) { | ||||
| 72289 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72290 | return; | ||||
| 72291 | } | ||||
| 72292 | } | ||||
| 72293 | } | ||||
| 72294 | argv[9].setObject(*returnArray); | ||||
| 72295 | break; | ||||
| 72296 | } while (false); | ||||
| 72297 | |||||
| 72298 | do { | ||||
| 72299 | if (obj2) { | ||||
| 72300 | JS::ExposeObjectToActiveJS(obj2); | ||||
| 72301 | } | ||||
| 72302 | argv[8].setObjectOrNull(obj2); | ||||
| 72303 | if (!MaybeWrapObjectOrNullValue(cx, argv[8])) { | ||||
| 72304 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72305 | return; | ||||
| 72306 | } | ||||
| 72307 | break; | ||||
| 72308 | } while (false); | ||||
| 72309 | |||||
| 72310 | do { | ||||
| 72311 | JS::ExposeObjectToActiveJS(obj1); | ||||
| 72312 | argv[7].setObject(*obj1); | ||||
| 72313 | if (!MaybeWrapObjectValue(cx, argv[7])) { | ||||
| 72314 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72315 | return; | ||||
| 72316 | } | ||||
| 72317 | break; | ||||
| 72318 | } while (false); | ||||
| 72319 | |||||
| 72320 | do { | ||||
| 72321 | JS::ExposeValueToActiveJS(any1); | ||||
| 72322 | argv[6].set(any1); | ||||
| 72323 | if (!MaybeWrapValue(cx, argv[6])) { | ||||
| 72324 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72325 | return; | ||||
| 72326 | } | ||||
| 72327 | break; | ||||
| 72328 | } while (false); | ||||
| 72329 | |||||
| 72330 | do { | ||||
| 72331 | if (!dict.ToObjectInternal(cx, argv[5])) { | ||||
| 72332 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72333 | return; | ||||
| 72334 | } | ||||
| 72335 | break; | ||||
| 72336 | } while (false); | ||||
| 72337 | |||||
| 72338 | do { | ||||
| 72339 | argv[4].setInt32(int32_t(arg1)); | ||||
| 72340 | break; | ||||
| 72341 | } while (false); | ||||
| 72342 | |||||
| 72343 | do { | ||||
| 72344 | if (!iface) { | ||||
| 72345 | argv[3].setNull(); | ||||
| 72346 | break; | ||||
| 72347 | } | ||||
| 72348 | if (!GetOrCreateDOMReflector(cx, iface, argv[3])) { | ||||
| 72349 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 72349); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 72349; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72350 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72351 | return; | ||||
| 72352 | } | ||||
| 72353 | break; | ||||
| 72354 | } while (false); | ||||
| 72355 | |||||
| 72356 | do { | ||||
| 72357 | if (boolArg.IsNull()) { | ||||
| 72358 | argv[2].setNull(); | ||||
| 72359 | break; | ||||
| 72360 | } | ||||
| 72361 | argv[2].setBoolean(boolArg.Value()); | ||||
| 72362 | break; | ||||
| 72363 | } while (false); | ||||
| 72364 | |||||
| 72365 | do { | ||||
| 72366 | argv[1].setNumber(num); | ||||
| 72367 | break; | ||||
| 72368 | } while (false); | ||||
| 72369 | |||||
| 72370 | do { | ||||
| 72371 | if (!xpc::NonVoidStringToJsval(cx, str, argv[0])) { | ||||
| 72372 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72373 | return; | ||||
| 72374 | } | ||||
| 72375 | break; | ||||
| 72376 | } while (false); | ||||
| 72377 | |||||
| 72378 | JS::Rooted<JS::Value> callable(cx); | ||||
| 72379 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72380 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 72381 | !InitIds(cx, atomsCache)) || | ||||
| 72382 | !GetCallableProperty(cx, atomsCache->__init_id, &callable)) { | ||||
| 72383 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72384 | return; | ||||
| 72385 | } | ||||
| 72386 | JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback)); | ||||
| 72387 | if (!JS::Call(cx, thisValue, callable, | ||||
| 72388 | JS::HandleValueArray::subarray(argv, 0, argc), &rval)) { | ||||
| 72389 | aRv.NoteJSContextException(cx); | ||||
| 72390 | return; | ||||
| 72391 | } | ||||
| 72392 | } | ||||
| 72393 | |||||
| 72394 | bool | ||||
| 72395 | TestJSImplInterfaceJSImpl::InitIds(JSContext* cx, TestJSImplInterfaceAtoms* atomsCache) | ||||
| 72396 | { | ||||
| 72397 | 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" , 72397); AnnotateMozCrashReason("MOZ_ASSERT" "(" "reinterpret_cast<jsid*>(atomsCache)->isVoid()" ")"); do { *((volatile int*)__null) = 72397; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72398 | |||||
| 72399 | // Initialize these in reverse order so that any failure leaves the first one | ||||
| 72400 | // uninitialized. | ||||
| 72401 | if (!atomsCache->__init_id.init(cx, "__init") || | ||||
| 72402 | !atomsCache->passUnionAllowSharedArrayBuffer_id.init(cx, "passUnionAllowSharedArrayBuffer") || | ||||
| 72403 | !atomsCache->passUnionArrayBuffer_id.init(cx, "passUnionArrayBuffer") || | ||||
| 72404 | !atomsCache->passAllowSharedNullableArrayBuffer_id.init(cx, "passAllowSharedNullableArrayBuffer") || | ||||
| 72405 | !atomsCache->passAllowSharedArrayBuffer_id.init(cx, "passAllowSharedArrayBuffer") || | ||||
| 72406 | !atomsCache->passAllowSharedNullableArrayBufferView_id.init(cx, "passAllowSharedNullableArrayBufferView") || | ||||
| 72407 | !atomsCache->passAllowSharedArrayBufferView_id.init(cx, "passAllowSharedArrayBufferView") || | ||||
| 72408 | !atomsCache->passAllowSharedArrayBufferViewTypedef_id.init(cx, "passAllowSharedArrayBufferViewTypedef") || | ||||
| 72409 | !atomsCache->allowSharedNullableArrayBuffer_id.init(cx, "allowSharedNullableArrayBuffer") || | ||||
| 72410 | !atomsCache->allowSharedArrayBuffer_id.init(cx, "allowSharedArrayBuffer") || | ||||
| 72411 | !atomsCache->allowSharedNullableArrayBufferView_id.init(cx, "allowSharedNullableArrayBufferView") || | ||||
| 72412 | !atomsCache->allowSharedArrayBufferView_id.init(cx, "allowSharedArrayBufferView") || | ||||
| 72413 | !atomsCache->allowSharedArrayBufferViewTypedef_id.init(cx, "allowSharedArrayBufferViewTypedef") || | ||||
| 72414 | !atomsCache->nonEnumerableMethod_id.init(cx, "nonEnumerableMethod") || | ||||
| 72415 | !atomsCache->nonEnumerableAttr_id.init(cx, "nonEnumerableAttr") || | ||||
| 72416 | !atomsCache->dashed_method_id.init(cx, "dashed-method") || | ||||
| 72417 | !atomsCache->dashed_attribute_id.init(cx, "dashed-attribute") || | ||||
| 72418 | !atomsCache->toJSON_id.init(cx, "toJSON") || | ||||
| 72419 | !atomsCache->toJSONShouldSkipThis3_id.init(cx, "toJSONShouldSkipThis3") || | ||||
| 72420 | !atomsCache->toJSONShouldSkipThis2_id.init(cx, "toJSONShouldSkipThis2") || | ||||
| 72421 | !atomsCache->toJSONShouldSkipThis_id.init(cx, "toJSONShouldSkipThis") || | ||||
| 72422 | !atomsCache->passArgsWithDefaults_id.init(cx, "passArgsWithDefaults") || | ||||
| 72423 | !atomsCache->ceReactionsAttr_id.init(cx, "ceReactionsAttr") || | ||||
| 72424 | !atomsCache->ceReactionsMethodOverload_id.init(cx, "ceReactionsMethodOverload") || | ||||
| 72425 | !atomsCache->ceReactionsMethod_id.init(cx, "ceReactionsMethod") || | ||||
| 72426 | !atomsCache->canOOMSetterAttr_id.init(cx, "canOOMSetterAttr") || | ||||
| 72427 | !atomsCache->canOOMGetterAttr_id.init(cx, "canOOMGetterAttr") || | ||||
| 72428 | !atomsCache->canOOMAttr_id.init(cx, "canOOMAttr") || | ||||
| 72429 | !atomsCache->canOOMMethod_id.init(cx, "canOOMMethod") || | ||||
| 72430 | !atomsCache->throwingSetterAttr_id.init(cx, "throwingSetterAttr") || | ||||
| 72431 | !atomsCache->throwingGetterAttr_id.init(cx, "throwingGetterAttr") || | ||||
| 72432 | !atomsCache->throwingAttr_id.init(cx, "throwingAttr") || | ||||
| 72433 | !atomsCache->throwingMethod_id.init(cx, "throwingMethod") || | ||||
| 72434 | !atomsCache->putForwardsAttr3_id.init(cx, "putForwardsAttr3") || | ||||
| 72435 | !atomsCache->putForwardsAttr2_id.init(cx, "putForwardsAttr2") || | ||||
| 72436 | !atomsCache->putForwardsAttr_id.init(cx, "putForwardsAttr") || | ||||
| 72437 | !atomsCache->passRenamedInterface_id.init(cx, "passRenamedInterface") || | ||||
| 72438 | !atomsCache->attrWithLenientThis_id.init(cx, "attrWithLenientThis") || | ||||
| 72439 | !atomsCache->conditionalOnSecureContext8_id.init(cx, "conditionalOnSecureContext8") || | ||||
| 72440 | !atomsCache->conditionalOnSecureContext7_id.init(cx, "conditionalOnSecureContext7") || | ||||
| 72441 | !atomsCache->conditionalOnSecureContext6_id.init(cx, "conditionalOnSecureContext6") || | ||||
| 72442 | !atomsCache->conditionalOnSecureContext5_id.init(cx, "conditionalOnSecureContext5") || | ||||
| 72443 | !atomsCache->conditionalOnSecureContext4_id.init(cx, "conditionalOnSecureContext4") || | ||||
| 72444 | !atomsCache->conditionalOnSecureContext3_id.init(cx, "conditionalOnSecureContext3") || | ||||
| 72445 | !atomsCache->conditionalOnSecureContext2_id.init(cx, "conditionalOnSecureContext2") || | ||||
| 72446 | !atomsCache->conditionalOnSecureContext1_id.init(cx, "conditionalOnSecureContext1") || | ||||
| 72447 | !atomsCache->prefable20_id.init(cx, "prefable20") || | ||||
| 72448 | !atomsCache->prefable19_id.init(cx, "prefable19") || | ||||
| 72449 | !atomsCache->prefable18_id.init(cx, "prefable18") || | ||||
| 72450 | !atomsCache->prefable17_id.init(cx, "prefable17") || | ||||
| 72451 | !atomsCache->prefable16_id.init(cx, "prefable16") || | ||||
| 72452 | !atomsCache->prefable15_id.init(cx, "prefable15") || | ||||
| 72453 | !atomsCache->prefable14_id.init(cx, "prefable14") || | ||||
| 72454 | !atomsCache->prefable13_id.init(cx, "prefable13") || | ||||
| 72455 | !atomsCache->prefable12_id.init(cx, "prefable12") || | ||||
| 72456 | !atomsCache->prefable11_id.init(cx, "prefable11") || | ||||
| 72457 | !atomsCache->prefable10_id.init(cx, "prefable10") || | ||||
| 72458 | !atomsCache->prefable9_id.init(cx, "prefable9") || | ||||
| 72459 | !atomsCache->prefable8_id.init(cx, "prefable8") || | ||||
| 72460 | !atomsCache->prefable7_id.init(cx, "prefable7") || | ||||
| 72461 | !atomsCache->prefable6_id.init(cx, "prefable6") || | ||||
| 72462 | !atomsCache->prefable5_id.init(cx, "prefable5") || | ||||
| 72463 | !atomsCache->prefable4_id.init(cx, "prefable4") || | ||||
| 72464 | !atomsCache->prefable3_id.init(cx, "prefable3") || | ||||
| 72465 | !atomsCache->prefable2_id.init(cx, "prefable2") || | ||||
| 72466 | !atomsCache->prefable1_id.init(cx, "prefable1") || | ||||
| 72467 | !atomsCache->passVariadicThirdArg_id.init(cx, "passVariadicThirdArg") || | ||||
| 72468 | !atomsCache->overload20_id.init(cx, "overload20") || | ||||
| 72469 | !atomsCache->overload19_id.init(cx, "overload19") || | ||||
| 72470 | !atomsCache->overload18_id.init(cx, "overload18") || | ||||
| 72471 | !atomsCache->overload17_id.init(cx, "overload17") || | ||||
| 72472 | !atomsCache->overload16_id.init(cx, "overload16") || | ||||
| 72473 | !atomsCache->overload15_id.init(cx, "overload15") || | ||||
| 72474 | !atomsCache->overload14_id.init(cx, "overload14") || | ||||
| 72475 | !atomsCache->overload13_id.init(cx, "overload13") || | ||||
| 72476 | !atomsCache->overload12_id.init(cx, "overload12") || | ||||
| 72477 | !atomsCache->overload11_id.init(cx, "overload11") || | ||||
| 72478 | !atomsCache->overload10_id.init(cx, "overload10") || | ||||
| 72479 | !atomsCache->overload9_id.init(cx, "overload9") || | ||||
| 72480 | !atomsCache->overload8_id.init(cx, "overload8") || | ||||
| 72481 | !atomsCache->overload7_id.init(cx, "overload7") || | ||||
| 72482 | !atomsCache->overload6_id.init(cx, "overload6") || | ||||
| 72483 | !atomsCache->overload5_id.init(cx, "overload5") || | ||||
| 72484 | !atomsCache->overload4_id.init(cx, "overload4") || | ||||
| 72485 | !atomsCache->overload3_id.init(cx, "overload3") || | ||||
| 72486 | !atomsCache->overload2_id.init(cx, "overload2") || | ||||
| 72487 | !atomsCache->overload1_id.init(cx, "overload1") || | ||||
| 72488 | !atomsCache->deprecatedMethodWithContext_id.init(cx, "deprecatedMethodWithContext") || | ||||
| 72489 | !atomsCache->deprecatedMethod_id.init(cx, "deprecatedMethod") || | ||||
| 72490 | !atomsCache->deprecatedAttribute_id.init(cx, "deprecatedAttribute") || | ||||
| 72491 | !atomsCache->exerciseTypedefInterfaces3_id.init(cx, "exerciseTypedefInterfaces3") || | ||||
| 72492 | !atomsCache->exerciseTypedefInterfaces2_id.init(cx, "exerciseTypedefInterfaces2") || | ||||
| 72493 | !atomsCache->exerciseTypedefInterfaces1_id.init(cx, "exerciseTypedefInterfaces1") || | ||||
| 72494 | !atomsCache->clampedByteNullable_id.init(cx, "clampedByteNullable") || | ||||
| 72495 | !atomsCache->clampedByte_id.init(cx, "clampedByte") || | ||||
| 72496 | !atomsCache->enforcedByteNullable_id.init(cx, "enforcedByteNullable") || | ||||
| 72497 | !atomsCache->enforcedByte_id.init(cx, "enforcedByte") || | ||||
| 72498 | !atomsCache->doClampNullable_id.init(cx, "doClampNullable") || | ||||
| 72499 | !atomsCache->doClamp_id.init(cx, "doClamp") || | ||||
| 72500 | !atomsCache->doEnforceRangeNullable_id.init(cx, "doEnforceRangeNullable") || | ||||
| 72501 | !atomsCache->doEnforceRange_id.init(cx, "doEnforceRange") || | ||||
| 72502 | !atomsCache->dontEnforceRangeOrClamp_id.init(cx, "dontEnforceRangeOrClamp") || | ||||
| 72503 | !atomsCache->passVariadicDictionary_id.init(cx, "passVariadicDictionary") || | ||||
| 72504 | !atomsCache->receiveDictContainingSequence_id.init(cx, "receiveDictContainingSequence") || | ||||
| 72505 | !atomsCache->passDictContainingSequence_id.init(cx, "passDictContainingSequence") || | ||||
| 72506 | !atomsCache->passDictContainingDict_id.init(cx, "passDictContainingDict") || | ||||
| 72507 | !atomsCache->passDictionaryOrLong_id.init(cx, "passDictionaryOrLong") || | ||||
| 72508 | !atomsCache->passRecordOfDictionaries_id.init(cx, "passRecordOfDictionaries") || | ||||
| 72509 | !atomsCache->passSequenceOfDictionaries_id.init(cx, "passSequenceOfDictionaries") || | ||||
| 72510 | !atomsCache->passOtherDictionary_id.init(cx, "passOtherDictionary") || | ||||
| 72511 | !atomsCache->receiveNullableDictionary_id.init(cx, "receiveNullableDictionary") || | ||||
| 72512 | !atomsCache->receiveDictionary_id.init(cx, "receiveDictionary") || | ||||
| 72513 | !atomsCache->passDictionary2_id.init(cx, "passDictionary2") || | ||||
| 72514 | !atomsCache->passDictionary_id.init(cx, "passDictionary") || | ||||
| 72515 | !atomsCache->attributeRenamedTo_id.init(cx, "attributeRenamedTo") || | ||||
| 72516 | !atomsCache->attributeGetterRenamedTo_id.init(cx, "attributeGetterRenamedTo") || | ||||
| 72517 | !atomsCache->methodRenamedTo_id.init(cx, "methodRenamedTo") || | ||||
| 72518 | !atomsCache->receiveAddrefedPromise_id.init(cx, "receiveAddrefedPromise") || | ||||
| 72519 | !atomsCache->receivePromise_id.init(cx, "receivePromise") || | ||||
| 72520 | !atomsCache->passPromiseSequence_id.init(cx, "passPromiseSequence") || | ||||
| 72521 | !atomsCache->passOptionalPromise_id.init(cx, "passOptionalPromise") || | ||||
| 72522 | !atomsCache->passPromise_id.init(cx, "passPromise") || | ||||
| 72523 | !atomsCache->writableNullableUnion_id.init(cx, "writableNullableUnion") || | ||||
| 72524 | !atomsCache->writableUnionContainingNull_id.init(cx, "writableUnionContainingNull") || | ||||
| 72525 | !atomsCache->writableUnion_id.init(cx, "writableUnion") || | ||||
| 72526 | !atomsCache->receiveNullableUnion2_id.init(cx, "receiveNullableUnion2") || | ||||
| 72527 | !atomsCache->receiveNullableUnion_id.init(cx, "receiveNullableUnion") || | ||||
| 72528 | !atomsCache->receiveUnionContainingNull_id.init(cx, "receiveUnionContainingNull") || | ||||
| 72529 | !atomsCache->receiveUnion2_id.init(cx, "receiveUnion2") || | ||||
| 72530 | !atomsCache->receiveUnion_id.init(cx, "receiveUnion") || | ||||
| 72531 | !atomsCache->passRecordOfUnions_id.init(cx, "passRecordOfUnions") || | ||||
| 72532 | !atomsCache->passVariadicNullableUnion_id.init(cx, "passVariadicNullableUnion") || | ||||
| 72533 | !atomsCache->passSequenceOfNullableUnions_id.init(cx, "passSequenceOfNullableUnions") || | ||||
| 72534 | !atomsCache->passVariadicUnion_id.init(cx, "passVariadicUnion") || | ||||
| 72535 | !atomsCache->passSequenceOfUnions2_id.init(cx, "passSequenceOfUnions2") || | ||||
| 72536 | !atomsCache->passSequenceOfUnions_id.init(cx, "passSequenceOfUnions") || | ||||
| 72537 | !atomsCache->passNullableUnionWithDefaultValue28_id.init(cx, "passNullableUnionWithDefaultValue28") || | ||||
| 72538 | !atomsCache->passNullableUnionWithDefaultValue27_id.init(cx, "passNullableUnionWithDefaultValue27") || | ||||
| 72539 | !atomsCache->passNullableUnionWithDefaultValue26_id.init(cx, "passNullableUnionWithDefaultValue26") || | ||||
| 72540 | !atomsCache->passNullableUnionWithDefaultValue25_id.init(cx, "passNullableUnionWithDefaultValue25") || | ||||
| 72541 | !atomsCache->passNullableUnionWithDefaultValue24_id.init(cx, "passNullableUnionWithDefaultValue24") || | ||||
| 72542 | !atomsCache->passNullableUnionWithDefaultValue23_id.init(cx, "passNullableUnionWithDefaultValue23") || | ||||
| 72543 | !atomsCache->passNullableUnionWithDefaultValue22_id.init(cx, "passNullableUnionWithDefaultValue22") || | ||||
| 72544 | !atomsCache->passNullableUnionWithDefaultValue21_id.init(cx, "passNullableUnionWithDefaultValue21") || | ||||
| 72545 | !atomsCache->passNullableUnionWithDefaultValue20_id.init(cx, "passNullableUnionWithDefaultValue20") || | ||||
| 72546 | !atomsCache->passNullableUnionWithDefaultValue19_id.init(cx, "passNullableUnionWithDefaultValue19") || | ||||
| 72547 | !atomsCache->passNullableUnionWithDefaultValue18_id.init(cx, "passNullableUnionWithDefaultValue18") || | ||||
| 72548 | !atomsCache->passNullableUnionWithDefaultValue17_id.init(cx, "passNullableUnionWithDefaultValue17") || | ||||
| 72549 | !atomsCache->passNullableUnionWithDefaultValue16_id.init(cx, "passNullableUnionWithDefaultValue16") || | ||||
| 72550 | !atomsCache->passNullableUnionWithDefaultValue15_id.init(cx, "passNullableUnionWithDefaultValue15") || | ||||
| 72551 | !atomsCache->passNullableUnionWithDefaultValue14_id.init(cx, "passNullableUnionWithDefaultValue14") || | ||||
| 72552 | !atomsCache->passNullableUnionWithDefaultValue13_id.init(cx, "passNullableUnionWithDefaultValue13") || | ||||
| 72553 | !atomsCache->passNullableUnionWithDefaultValue12_id.init(cx, "passNullableUnionWithDefaultValue12") || | ||||
| 72554 | !atomsCache->passNullableUnionWithDefaultValue11_id.init(cx, "passNullableUnionWithDefaultValue11") || | ||||
| 72555 | !atomsCache->passNullableUnionWithDefaultValue10_id.init(cx, "passNullableUnionWithDefaultValue10") || | ||||
| 72556 | !atomsCache->passNullableUnionWithDefaultValue9_id.init(cx, "passNullableUnionWithDefaultValue9") || | ||||
| 72557 | !atomsCache->passNullableUnionWithDefaultValue8_id.init(cx, "passNullableUnionWithDefaultValue8") || | ||||
| 72558 | !atomsCache->passNullableUnionWithDefaultValue7_id.init(cx, "passNullableUnionWithDefaultValue7") || | ||||
| 72559 | !atomsCache->passNullableUnionWithDefaultValue6_id.init(cx, "passNullableUnionWithDefaultValue6") || | ||||
| 72560 | !atomsCache->passNullableUnionWithDefaultValue5_id.init(cx, "passNullableUnionWithDefaultValue5") || | ||||
| 72561 | !atomsCache->passNullableUnionWithDefaultValue4_id.init(cx, "passNullableUnionWithDefaultValue4") || | ||||
| 72562 | !atomsCache->passNullableUnionWithDefaultValue3_id.init(cx, "passNullableUnionWithDefaultValue3") || | ||||
| 72563 | !atomsCache->passNullableUnionWithDefaultValue2_id.init(cx, "passNullableUnionWithDefaultValue2") || | ||||
| 72564 | !atomsCache->passNullableUnionWithDefaultValue1_id.init(cx, "passNullableUnionWithDefaultValue1") || | ||||
| 72565 | !atomsCache->passUnionWithDefaultValue25_id.init(cx, "passUnionWithDefaultValue25") || | ||||
| 72566 | !atomsCache->passUnionWithDefaultValue24_id.init(cx, "passUnionWithDefaultValue24") || | ||||
| 72567 | !atomsCache->passUnionWithDefaultValue23_id.init(cx, "passUnionWithDefaultValue23") || | ||||
| 72568 | !atomsCache->passUnionWithDefaultValue22_id.init(cx, "passUnionWithDefaultValue22") || | ||||
| 72569 | !atomsCache->passUnionWithDefaultValue21_id.init(cx, "passUnionWithDefaultValue21") || | ||||
| 72570 | !atomsCache->passUnionWithDefaultValue20_id.init(cx, "passUnionWithDefaultValue20") || | ||||
| 72571 | !atomsCache->passUnionWithDefaultValue19_id.init(cx, "passUnionWithDefaultValue19") || | ||||
| 72572 | !atomsCache->passUnionWithDefaultValue18_id.init(cx, "passUnionWithDefaultValue18") || | ||||
| 72573 | !atomsCache->passUnionWithDefaultValue17_id.init(cx, "passUnionWithDefaultValue17") || | ||||
| 72574 | !atomsCache->passUnionWithDefaultValue16_id.init(cx, "passUnionWithDefaultValue16") || | ||||
| 72575 | !atomsCache->passUnionWithDefaultValue15_id.init(cx, "passUnionWithDefaultValue15") || | ||||
| 72576 | !atomsCache->passUnionWithDefaultValue14_id.init(cx, "passUnionWithDefaultValue14") || | ||||
| 72577 | !atomsCache->passUnionWithDefaultValue13_id.init(cx, "passUnionWithDefaultValue13") || | ||||
| 72578 | !atomsCache->passUnionWithDefaultValue12_id.init(cx, "passUnionWithDefaultValue12") || | ||||
| 72579 | !atomsCache->passUnionWithDefaultValue11_id.init(cx, "passUnionWithDefaultValue11") || | ||||
| 72580 | !atomsCache->passUnionWithDefaultValue10_id.init(cx, "passUnionWithDefaultValue10") || | ||||
| 72581 | !atomsCache->passUnionWithDefaultValue9_id.init(cx, "passUnionWithDefaultValue9") || | ||||
| 72582 | !atomsCache->passUnionWithDefaultValue8_id.init(cx, "passUnionWithDefaultValue8") || | ||||
| 72583 | !atomsCache->passUnionWithDefaultValue7_id.init(cx, "passUnionWithDefaultValue7") || | ||||
| 72584 | !atomsCache->passUnionWithDefaultValue6_id.init(cx, "passUnionWithDefaultValue6") || | ||||
| 72585 | !atomsCache->passUnionWithDefaultValue5_id.init(cx, "passUnionWithDefaultValue5") || | ||||
| 72586 | !atomsCache->passUnionWithDefaultValue4_id.init(cx, "passUnionWithDefaultValue4") || | ||||
| 72587 | !atomsCache->passUnionWithDefaultValue3_id.init(cx, "passUnionWithDefaultValue3") || | ||||
| 72588 | !atomsCache->passUnionWithDefaultValue2_id.init(cx, "passUnionWithDefaultValue2") || | ||||
| 72589 | !atomsCache->passUnionWithDefaultValue1_id.init(cx, "passUnionWithDefaultValue1") || | ||||
| 72590 | !atomsCache->passUnionWithObject_id.init(cx, "passUnionWithObject") || | ||||
| 72591 | !atomsCache->passUnionWithEnum_id.init(cx, "passUnionWithEnum") || | ||||
| 72592 | !atomsCache->passUnionWithString_id.init(cx, "passUnionWithString") || | ||||
| 72593 | !atomsCache->passUnionWithTypedArraysOrNull_id.init(cx, "passUnionWithTypedArraysOrNull") || | ||||
| 72594 | !atomsCache->passUnionWithTypedArrays_id.init(cx, "passUnionWithTypedArrays") || | ||||
| 72595 | !atomsCache->passUnionWithArrayBufferOrNull_id.init(cx, "passUnionWithArrayBufferOrNull") || | ||||
| 72596 | !atomsCache->passUnionWithArrayBuffer_id.init(cx, "passUnionWithArrayBuffer") || | ||||
| 72597 | !atomsCache->passOptionalNullableUnionWithDefaultValue_id.init(cx, "passOptionalNullableUnionWithDefaultValue") || | ||||
| 72598 | !atomsCache->passOptionalNullableUnion_id.init(cx, "passOptionalNullableUnion") || | ||||
| 72599 | !atomsCache->passOptionalUnion_id.init(cx, "passOptionalUnion") || | ||||
| 72600 | !atomsCache->passNullableUnion_id.init(cx, "passNullableUnion") || | ||||
| 72601 | !atomsCache->passUnionWithNullable_id.init(cx, "passUnionWithNullable") || | ||||
| 72602 | !atomsCache->passUnionWithSVS_id.init(cx, "passUnionWithSVS") || | ||||
| 72603 | !atomsCache->passUnionWithSequenceAndRecord_id.init(cx, "passUnionWithSequenceAndRecord") || | ||||
| 72604 | !atomsCache->passUnionWithRecordAndSequence_id.init(cx, "passUnionWithRecordAndSequence") || | ||||
| 72605 | !atomsCache->passUnionWithRecord_id.init(cx, "passUnionWithRecord") || | ||||
| 72606 | !atomsCache->passUnionWithUTF8String_id.init(cx, "passUnionWithUTF8String") || | ||||
| 72607 | !atomsCache->passUnionWithByteString_id.init(cx, "passUnionWithByteString") || | ||||
| 72608 | !atomsCache->passUnionWithCallback_id.init(cx, "passUnionWithCallback") || | ||||
| 72609 | !atomsCache->passUnion28_id.init(cx, "passUnion28") || | ||||
| 72610 | !atomsCache->passUnion27_id.init(cx, "passUnion27") || | ||||
| 72611 | !atomsCache->passUnion26_id.init(cx, "passUnion26") || | ||||
| 72612 | !atomsCache->passUnion25_id.init(cx, "passUnion25") || | ||||
| 72613 | !atomsCache->passUnion24_id.init(cx, "passUnion24") || | ||||
| 72614 | !atomsCache->passUnion23_id.init(cx, "passUnion23") || | ||||
| 72615 | !atomsCache->passUnion22_id.init(cx, "passUnion22") || | ||||
| 72616 | !atomsCache->passUnion21_id.init(cx, "passUnion21") || | ||||
| 72617 | !atomsCache->passUnion20_id.init(cx, "passUnion20") || | ||||
| 72618 | !atomsCache->passUnion19_id.init(cx, "passUnion19") || | ||||
| 72619 | !atomsCache->passUnion18_id.init(cx, "passUnion18") || | ||||
| 72620 | !atomsCache->passUnion17_id.init(cx, "passUnion17") || | ||||
| 72621 | !atomsCache->passUnion16_id.init(cx, "passUnion16") || | ||||
| 72622 | !atomsCache->passUnion15_id.init(cx, "passUnion15") || | ||||
| 72623 | !atomsCache->passUnion14_id.init(cx, "passUnion14") || | ||||
| 72624 | !atomsCache->passUnion13_id.init(cx, "passUnion13") || | ||||
| 72625 | !atomsCache->passUnion12_id.init(cx, "passUnion12") || | ||||
| 72626 | !atomsCache->passUnion11_id.init(cx, "passUnion11") || | ||||
| 72627 | !atomsCache->passUnion10_id.init(cx, "passUnion10") || | ||||
| 72628 | !atomsCache->passUnion9_id.init(cx, "passUnion9") || | ||||
| 72629 | !atomsCache->passUnion8_id.init(cx, "passUnion8") || | ||||
| 72630 | !atomsCache->passUnion7_id.init(cx, "passUnion7") || | ||||
| 72631 | !atomsCache->passUnion6_id.init(cx, "passUnion6") || | ||||
| 72632 | !atomsCache->passUnion5_id.init(cx, "passUnion5") || | ||||
| 72633 | !atomsCache->passUnion4_id.init(cx, "passUnion4") || | ||||
| 72634 | !atomsCache->passUnion3_id.init(cx, "passUnion3") || | ||||
| 72635 | !atomsCache->passUnion2_id.init(cx, "passUnion2") || | ||||
| 72636 | !atomsCache->passUnion_id.init(cx, "passUnion") || | ||||
| 72637 | !atomsCache->receiveNullableObject_id.init(cx, "receiveNullableObject") || | ||||
| 72638 | !atomsCache->receiveObject_id.init(cx, "receiveObject") || | ||||
| 72639 | !atomsCache->passRecordOfObject_id.init(cx, "passRecordOfObject") || | ||||
| 72640 | !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject") || | ||||
| 72641 | !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfObject") || | ||||
| 72642 | !atomsCache->passNullableSequenceOfObject_id.init(cx, "passNullableSequenceOfObject") || | ||||
| 72643 | !atomsCache->passSequenceOfNullableObject_id.init(cx, "passSequenceOfNullableObject") || | ||||
| 72644 | !atomsCache->passSequenceOfObject_id.init(cx, "passSequenceOfObject") || | ||||
| 72645 | !atomsCache->passOptionalNullableObjectWithDefaultValue_id.init(cx, "passOptionalNullableObjectWithDefaultValue") || | ||||
| 72646 | !atomsCache->passOptionalNullableObject_id.init(cx, "passOptionalNullableObject") || | ||||
| 72647 | !atomsCache->passOptionalObject_id.init(cx, "passOptionalObject") || | ||||
| 72648 | !atomsCache->passVariadicNullableObject_id.init(cx, "passVariadicNullableObject") || | ||||
| 72649 | !atomsCache->passNullableObject_id.init(cx, "passNullableObject") || | ||||
| 72650 | !atomsCache->passVariadicObject_id.init(cx, "passVariadicObject") || | ||||
| 72651 | !atomsCache->passObject_id.init(cx, "passObject") || | ||||
| 72652 | !atomsCache->receiveAny_id.init(cx, "receiveAny") || | ||||
| 72653 | !atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableRecordOfAny") || | ||||
| 72654 | !atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableRecordOfNullableSequenceOfAny") || | ||||
| 72655 | !atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfNullableRecordOfAny") || | ||||
| 72656 | !atomsCache->passNullableRecordOfNullableRecordOfAny_id.init(cx, "passNullableRecordOfNullableRecordOfAny") || | ||||
| 72657 | !atomsCache->passRecordOfNullableRecordOfAny_id.init(cx, "passRecordOfNullableRecordOfAny") || | ||||
| 72658 | !atomsCache->passRecordOfRecordOfAny_id.init(cx, "passRecordOfRecordOfAny") || | ||||
| 72659 | !atomsCache->passOptionalRecordOfAnyWithDefaultValue_id.init(cx, "passOptionalRecordOfAnyWithDefaultValue") || | ||||
| 72660 | !atomsCache->passOptionalNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfAny") || | ||||
| 72661 | !atomsCache->passOptionalRecordOfAny_id.init(cx, "passOptionalRecordOfAny") || | ||||
| 72662 | !atomsCache->passNullableRecordOfAny_id.init(cx, "passNullableRecordOfAny") || | ||||
| 72663 | !atomsCache->passRecordOfAny_id.init(cx, "passRecordOfAny") || | ||||
| 72664 | !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfAny") || | ||||
| 72665 | !atomsCache->passNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfNullableSequenceOfAny") || | ||||
| 72666 | !atomsCache->passSequenceOfNullableSequenceOfAny_id.init(cx, "passSequenceOfNullableSequenceOfAny") || | ||||
| 72667 | !atomsCache->passSequenceOfSequenceOfAny_id.init(cx, "passSequenceOfSequenceOfAny") || | ||||
| 72668 | !atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id.init(cx, "passOptionalSequenceOfAnyWithDefaultValue") || | ||||
| 72669 | !atomsCache->passOptionalNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfAny") || | ||||
| 72670 | !atomsCache->passOptionalSequenceOfAny_id.init(cx, "passOptionalSequenceOfAny") || | ||||
| 72671 | !atomsCache->passNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfAny") || | ||||
| 72672 | !atomsCache->passSequenceOfAny_id.init(cx, "passSequenceOfAny") || | ||||
| 72673 | !atomsCache->passAnyDefaultNull_id.init(cx, "passAnyDefaultNull") || | ||||
| 72674 | !atomsCache->passOptionalAny_id.init(cx, "passOptionalAny") || | ||||
| 72675 | !atomsCache->passVariadicAny_id.init(cx, "passVariadicAny") || | ||||
| 72676 | !atomsCache->passAny_id.init(cx, "passAny") || | ||||
| 72677 | !atomsCache->passOptionalNullableTreatAsNullCallbackWithDefaultValue_id.init(cx, "passOptionalNullableTreatAsNullCallbackWithDefaultValue") || | ||||
| 72678 | !atomsCache->receiveNullableCallback_id.init(cx, "receiveNullableCallback") || | ||||
| 72679 | !atomsCache->receiveCallback_id.init(cx, "receiveCallback") || | ||||
| 72680 | !atomsCache->passOptionalNullableCallbackWithDefaultValue_id.init(cx, "passOptionalNullableCallbackWithDefaultValue") || | ||||
| 72681 | !atomsCache->passOptionalNullableCallback_id.init(cx, "passOptionalNullableCallback") || | ||||
| 72682 | !atomsCache->passOptionalCallback_id.init(cx, "passOptionalCallback") || | ||||
| 72683 | !atomsCache->passNullableCallback_id.init(cx, "passNullableCallback") || | ||||
| 72684 | !atomsCache->passCallback_id.init(cx, "passCallback") || | ||||
| 72685 | !atomsCache->readonlyEnumAttribute_id.init(cx, "readonlyEnumAttribute") || | ||||
| 72686 | !atomsCache->enumAttribute_id.init(cx, "enumAttribute") || | ||||
| 72687 | !atomsCache->receiveNullableEnum_id.init(cx, "receiveNullableEnum") || | ||||
| 72688 | !atomsCache->receiveEnum_id.init(cx, "receiveEnum") || | ||||
| 72689 | !atomsCache->passOptionalNullableEnumWithDefaultValue2_id.init(cx, "passOptionalNullableEnumWithDefaultValue2") || | ||||
| 72690 | !atomsCache->passOptionalNullableEnumWithDefaultValue_id.init(cx, "passOptionalNullableEnumWithDefaultValue") || | ||||
| 72691 | !atomsCache->passOptionalNullableEnum_id.init(cx, "passOptionalNullableEnum") || | ||||
| 72692 | !atomsCache->passEnumWithDefault_id.init(cx, "passEnumWithDefault") || | ||||
| 72693 | !atomsCache->passOptionalEnum_id.init(cx, "passOptionalEnum") || | ||||
| 72694 | !atomsCache->passNullableEnum_id.init(cx, "passNullableEnum") || | ||||
| 72695 | !atomsCache->passEnum_id.init(cx, "passEnum") || | ||||
| 72696 | !atomsCache->jsStringAttr_id.init(cx, "jsStringAttr") || | ||||
| 72697 | !atomsCache->readonlyJSStringAttr_id.init(cx, "readonlyJSStringAttr") || | ||||
| 72698 | !atomsCache->receiveJSString_id.init(cx, "receiveJSString") || | ||||
| 72699 | !atomsCache->passOptionalJSStringWithDefaultValue_id.init(cx, "passOptionalJSStringWithDefaultValue") || | ||||
| 72700 | !atomsCache->passJSString_id.init(cx, "passJSString") || | ||||
| 72701 | !atomsCache->receiveSVS_id.init(cx, "receiveSVS") || | ||||
| 72702 | !atomsCache->passVariadicSVS_id.init(cx, "passVariadicSVS") || | ||||
| 72703 | !atomsCache->passOptionalNullableSVSWithDefaultValue_id.init(cx, "passOptionalNullableSVSWithDefaultValue") || | ||||
| 72704 | !atomsCache->passOptionalNullableSVS_id.init(cx, "passOptionalNullableSVS") || | ||||
| 72705 | !atomsCache->passOptionalSVSWithDefaultValue_id.init(cx, "passOptionalSVSWithDefaultValue") || | ||||
| 72706 | !atomsCache->passOptionalSVS_id.init(cx, "passOptionalSVS") || | ||||
| 72707 | !atomsCache->passNullableSVS_id.init(cx, "passNullableSVS") || | ||||
| 72708 | !atomsCache->passSVS_id.init(cx, "passSVS") || | ||||
| 72709 | !atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id.init(cx, "passOptionalUnionUTF8StringWithDefaultValue") || | ||||
| 72710 | !atomsCache->passOptionalUnionUTF8String_id.init(cx, "passOptionalUnionUTF8String") || | ||||
| 72711 | !atomsCache->passUnionUTF8String_id.init(cx, "passUnionUTF8String") || | ||||
| 72712 | !atomsCache->passVariadicUTF8String_id.init(cx, "passVariadicUTF8String") || | ||||
| 72713 | !atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id.init(cx, "passOptionalNullableUTF8StringWithDefaultValue") || | ||||
| 72714 | !atomsCache->passOptionalNullableUTF8String_id.init(cx, "passOptionalNullableUTF8String") || | ||||
| 72715 | !atomsCache->passOptionalUTF8StringWithDefaultValue_id.init(cx, "passOptionalUTF8StringWithDefaultValue") || | ||||
| 72716 | !atomsCache->passOptionalUTF8String_id.init(cx, "passOptionalUTF8String") || | ||||
| 72717 | !atomsCache->passNullableUTF8String_id.init(cx, "passNullableUTF8String") || | ||||
| 72718 | !atomsCache->passUTF8String_id.init(cx, "passUTF8String") || | ||||
| 72719 | !atomsCache->passOptionalUnionByteStringWithDefaultValue_id.init(cx, "passOptionalUnionByteStringWithDefaultValue") || | ||||
| 72720 | !atomsCache->passOptionalUnionByteString_id.init(cx, "passOptionalUnionByteString") || | ||||
| 72721 | !atomsCache->passUnionByteString_id.init(cx, "passUnionByteString") || | ||||
| 72722 | !atomsCache->passVariadicByteString_id.init(cx, "passVariadicByteString") || | ||||
| 72723 | !atomsCache->passOptionalNullableByteStringWithDefaultValue_id.init(cx, "passOptionalNullableByteStringWithDefaultValue") || | ||||
| 72724 | !atomsCache->passOptionalNullableByteString_id.init(cx, "passOptionalNullableByteString") || | ||||
| 72725 | !atomsCache->passOptionalByteStringWithDefaultValue_id.init(cx, "passOptionalByteStringWithDefaultValue") || | ||||
| 72726 | !atomsCache->passOptionalByteString_id.init(cx, "passOptionalByteString") || | ||||
| 72727 | !atomsCache->passNullableByteString_id.init(cx, "passNullableByteString") || | ||||
| 72728 | !atomsCache->passByteString_id.init(cx, "passByteString") || | ||||
| 72729 | !atomsCache->passVariadicString_id.init(cx, "passVariadicString") || | ||||
| 72730 | !atomsCache->passOptionalNullableStringWithDefaultValue_id.init(cx, "passOptionalNullableStringWithDefaultValue") || | ||||
| 72731 | !atomsCache->passOptionalNullableString_id.init(cx, "passOptionalNullableString") || | ||||
| 72732 | !atomsCache->passOptionalStringWithDefaultValue_id.init(cx, "passOptionalStringWithDefaultValue") || | ||||
| 72733 | !atomsCache->passOptionalString_id.init(cx, "passOptionalString") || | ||||
| 72734 | !atomsCache->passNullableString_id.init(cx, "passNullableString") || | ||||
| 72735 | !atomsCache->passString_id.init(cx, "passString") || | ||||
| 72736 | !atomsCache->uint8ArrayAttr_id.init(cx, "uint8ArrayAttr") || | ||||
| 72737 | !atomsCache->receiveUint8Array_id.init(cx, "receiveUint8Array") || | ||||
| 72738 | !atomsCache->passVariadicNullableTypedArray_id.init(cx, "passVariadicNullableTypedArray") || | ||||
| 72739 | !atomsCache->passVariadicTypedArray_id.init(cx, "passVariadicTypedArray") || | ||||
| 72740 | !atomsCache->passRecordOfNullableArrayBuffers_id.init(cx, "passRecordOfNullableArrayBuffers") || | ||||
| 72741 | !atomsCache->passRecordOfArrayBuffers_id.init(cx, "passRecordOfArrayBuffers") || | ||||
| 72742 | !atomsCache->passSequenceOfNullableArrayBuffers_id.init(cx, "passSequenceOfNullableArrayBuffers") || | ||||
| 72743 | !atomsCache->passSequenceOfArrayBuffers_id.init(cx, "passSequenceOfArrayBuffers") || | ||||
| 72744 | !atomsCache->passFloat64Array_id.init(cx, "passFloat64Array") || | ||||
| 72745 | !atomsCache->passFloat32Array_id.init(cx, "passFloat32Array") || | ||||
| 72746 | !atomsCache->passUint8ClampedArray_id.init(cx, "passUint8ClampedArray") || | ||||
| 72747 | !atomsCache->passUint32Array_id.init(cx, "passUint32Array") || | ||||
| 72748 | !atomsCache->passUint16Array_id.init(cx, "passUint16Array") || | ||||
| 72749 | !atomsCache->passUint8Array_id.init(cx, "passUint8Array") || | ||||
| 72750 | !atomsCache->passInt32Array_id.init(cx, "passInt32Array") || | ||||
| 72751 | !atomsCache->passInt16Array_id.init(cx, "passInt16Array") || | ||||
| 72752 | !atomsCache->passInt8Array_id.init(cx, "passInt8Array") || | ||||
| 72753 | !atomsCache->passArrayBufferView_id.init(cx, "passArrayBufferView") || | ||||
| 72754 | !atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id.init(cx, "passOptionalNullableArrayBufferWithDefaultValue") || | ||||
| 72755 | !atomsCache->passOptionalNullableArrayBuffer_id.init(cx, "passOptionalNullableArrayBuffer") || | ||||
| 72756 | !atomsCache->passOptionalArrayBuffer_id.init(cx, "passOptionalArrayBuffer") || | ||||
| 72757 | !atomsCache->passNullableArrayBuffer_id.init(cx, "passNullableArrayBuffer") || | ||||
| 72758 | !atomsCache->passArrayBuffer_id.init(cx, "passArrayBuffer") || | ||||
| 72759 | !atomsCache->receiveAnyRecord_id.init(cx, "receiveAnyRecord") || | ||||
| 72760 | !atomsCache->receiveNullableRecordOfNullableInts_id.init(cx, "receiveNullableRecordOfNullableInts") || | ||||
| 72761 | !atomsCache->receiveRecordOfNullableInts_id.init(cx, "receiveRecordOfNullableInts") || | ||||
| 72762 | !atomsCache->receiveNullableRecord_id.init(cx, "receiveNullableRecord") || | ||||
| 72763 | !atomsCache->receiveRecord_id.init(cx, "receiveRecord") || | ||||
| 72764 | !atomsCache->passRecordOfRecords_id.init(cx, "passRecordOfRecords") || | ||||
| 72765 | !atomsCache->passUTF8StringRecord_id.init(cx, "passUTF8StringRecord") || | ||||
| 72766 | !atomsCache->passByteStringRecord_id.init(cx, "passByteStringRecord") || | ||||
| 72767 | !atomsCache->passStringRecord_id.init(cx, "passStringRecord") || | ||||
| 72768 | !atomsCache->passNullableExternalInterfaceRecord_id.init(cx, "passNullableExternalInterfaceRecord") || | ||||
| 72769 | !atomsCache->passExternalInterfaceRecord_id.init(cx, "passExternalInterfaceRecord") || | ||||
| 72770 | !atomsCache->passOptionalObjectRecord_id.init(cx, "passOptionalObjectRecord") || | ||||
| 72771 | !atomsCache->passOptionalNullableRecordWithDefaultValue_id.init(cx, "passOptionalNullableRecordWithDefaultValue") || | ||||
| 72772 | !atomsCache->passOptionalNullableRecord_id.init(cx, "passOptionalNullableRecord") || | ||||
| 72773 | !atomsCache->passOptionalRecord_id.init(cx, "passOptionalRecord") || | ||||
| 72774 | !atomsCache->passNullableCastableObjectNullableRecord_id.init(cx, "passNullableCastableObjectNullableRecord") || | ||||
| 72775 | !atomsCache->passCastableObjectNullableRecord_id.init(cx, "passCastableObjectNullableRecord") || | ||||
| 72776 | !atomsCache->passNullableCastableObjectRecord_id.init(cx, "passNullableCastableObjectRecord") || | ||||
| 72777 | !atomsCache->passCastableObjectRecord_id.init(cx, "passCastableObjectRecord") || | ||||
| 72778 | !atomsCache->passOptionalNullableRecordOfNullableInts_id.init(cx, "passOptionalNullableRecordOfNullableInts") || | ||||
| 72779 | !atomsCache->passOptionalRecordOfNullableInts_id.init(cx, "passOptionalRecordOfNullableInts") || | ||||
| 72780 | !atomsCache->passRecordOfNullableInts_id.init(cx, "passRecordOfNullableInts") || | ||||
| 72781 | !atomsCache->passNullableRecord_id.init(cx, "passNullableRecord") || | ||||
| 72782 | !atomsCache->passRecord_id.init(cx, "passRecord") || | ||||
| 72783 | !atomsCache->passSequenceOfSequencesOfSequences_id.init(cx, "passSequenceOfSequencesOfSequences") || | ||||
| 72784 | !atomsCache->passSequenceOfSequences_id.init(cx, "passSequenceOfSequences") || | ||||
| 72785 | !atomsCache->receiveNullableObjectSequence_id.init(cx, "receiveNullableObjectSequence") || | ||||
| 72786 | !atomsCache->receiveObjectSequence_id.init(cx, "receiveObjectSequence") || | ||||
| 72787 | !atomsCache->receiveNullableAnySequence_id.init(cx, "receiveNullableAnySequence") || | ||||
| 72788 | !atomsCache->receiveAnySequence_id.init(cx, "receiveAnySequence") || | ||||
| 72789 | !atomsCache->receiveUTF8StringSequence_id.init(cx, "receiveUTF8StringSequence") || | ||||
| 72790 | !atomsCache->receiveByteStringSequence_id.init(cx, "receiveByteStringSequence") || | ||||
| 72791 | !atomsCache->receiveStringSequence_id.init(cx, "receiveStringSequence") || | ||||
| 72792 | !atomsCache->passNullableExternalInterfaceSequence_id.init(cx, "passNullableExternalInterfaceSequence") || | ||||
| 72793 | !atomsCache->passExternalInterfaceSequence_id.init(cx, "passExternalInterfaceSequence") || | ||||
| 72794 | !atomsCache->passOptionalObjectSequence_id.init(cx, "passOptionalObjectSequence") || | ||||
| 72795 | !atomsCache->passOptionalNullableSequenceWithDefaultValue2_id.init(cx, "passOptionalNullableSequenceWithDefaultValue2") || | ||||
| 72796 | !atomsCache->passOptionalNullableSequenceWithDefaultValue_id.init(cx, "passOptionalNullableSequenceWithDefaultValue") || | ||||
| 72797 | !atomsCache->passOptionalNullableSequence_id.init(cx, "passOptionalNullableSequence") || | ||||
| 72798 | !atomsCache->passOptionalSequenceWithDefaultValue_id.init(cx, "passOptionalSequenceWithDefaultValue") || | ||||
| 72799 | !atomsCache->passOptionalSequence_id.init(cx, "passOptionalSequence") || | ||||
| 72800 | !atomsCache->passNullableCastableObjectNullableSequence_id.init(cx, "passNullableCastableObjectNullableSequence") || | ||||
| 72801 | !atomsCache->passCastableObjectNullableSequence_id.init(cx, "passCastableObjectNullableSequence") || | ||||
| 72802 | !atomsCache->passNullableCastableObjectSequence_id.init(cx, "passNullableCastableObjectSequence") || | ||||
| 72803 | !atomsCache->passCastableObjectSequence_id.init(cx, "passCastableObjectSequence") || | ||||
| 72804 | !atomsCache->receiveWeakNullableCastableObjectNullableSequence_id.init(cx, "receiveWeakNullableCastableObjectNullableSequence") || | ||||
| 72805 | !atomsCache->receiveWeakCastableObjectNullableSequence_id.init(cx, "receiveWeakCastableObjectNullableSequence") || | ||||
| 72806 | !atomsCache->receiveWeakNullableCastableObjectSequence_id.init(cx, "receiveWeakNullableCastableObjectSequence") || | ||||
| 72807 | !atomsCache->receiveWeakCastableObjectSequence_id.init(cx, "receiveWeakCastableObjectSequence") || | ||||
| 72808 | !atomsCache->receiveNullableCastableObjectNullableSequence_id.init(cx, "receiveNullableCastableObjectNullableSequence") || | ||||
| 72809 | !atomsCache->receiveCastableObjectNullableSequence_id.init(cx, "receiveCastableObjectNullableSequence") || | ||||
| 72810 | !atomsCache->receiveNullableCallbackObjectSequence_id.init(cx, "receiveNullableCallbackObjectSequence") || | ||||
| 72811 | !atomsCache->receiveNullableCastableObjectSequence_id.init(cx, "receiveNullableCastableObjectSequence") || | ||||
| 72812 | !atomsCache->receiveCallbackObjectSequence_id.init(cx, "receiveCallbackObjectSequence") || | ||||
| 72813 | !atomsCache->receiveCastableObjectSequence_id.init(cx, "receiveCastableObjectSequence") || | ||||
| 72814 | !atomsCache->passOptionalNullableSequenceOfNullableInts_id.init(cx, "passOptionalNullableSequenceOfNullableInts") || | ||||
| 72815 | !atomsCache->passOptionalSequenceOfNullableInts_id.init(cx, "passOptionalSequenceOfNullableInts") || | ||||
| 72816 | !atomsCache->passSequenceOfNullableInts_id.init(cx, "passSequenceOfNullableInts") || | ||||
| 72817 | !atomsCache->passNullableSequence_id.init(cx, "passNullableSequence") || | ||||
| 72818 | !atomsCache->passSequence_id.init(cx, "passSequence") || | ||||
| 72819 | !atomsCache->receiveNullableSequenceOfNullableInts_id.init(cx, "receiveNullableSequenceOfNullableInts") || | ||||
| 72820 | !atomsCache->receiveSequenceOfNullableInts_id.init(cx, "receiveSequenceOfNullableInts") || | ||||
| 72821 | !atomsCache->receiveNullableSequence_id.init(cx, "receiveNullableSequence") || | ||||
| 72822 | !atomsCache->receiveSequence_id.init(cx, "receiveSequence") || | ||||
| 72823 | !atomsCache->passOptionalCallbackInterfaceWithDefault_id.init(cx, "passOptionalCallbackInterfaceWithDefault") || | ||||
| 72824 | !atomsCache->passOptionalNonNullCallbackInterface_id.init(cx, "passOptionalNonNullCallbackInterface") || | ||||
| 72825 | !atomsCache->passOptionalCallbackInterface_id.init(cx, "passOptionalCallbackInterface") || | ||||
| 72826 | !atomsCache->nullableCallbackInterface_id.init(cx, "nullableCallbackInterface") || | ||||
| 72827 | !atomsCache->nonNullCallbackInterface_id.init(cx, "nonNullCallbackInterface") || | ||||
| 72828 | !atomsCache->passNullableCallbackInterface_id.init(cx, "passNullableCallbackInterface") || | ||||
| 72829 | !atomsCache->passCallbackInterface_id.init(cx, "passCallbackInterface") || | ||||
| 72830 | !atomsCache->receiveWeakNullableCallbackInterface_id.init(cx, "receiveWeakNullableCallbackInterface") || | ||||
| 72831 | !atomsCache->receiveWeakCallbackInterface_id.init(cx, "receiveWeakCallbackInterface") || | ||||
| 72832 | !atomsCache->receiveNullableCallbackInterface_id.init(cx, "receiveNullableCallbackInterface") || | ||||
| 72833 | !atomsCache->receiveCallbackInterface_id.init(cx, "receiveCallbackInterface") || | ||||
| 72834 | !atomsCache->passOptionalExternalWithDefault_id.init(cx, "passOptionalExternalWithDefault") || | ||||
| 72835 | !atomsCache->passOptionalNonNullExternal_id.init(cx, "passOptionalNonNullExternal") || | ||||
| 72836 | !atomsCache->passOptionalExternal_id.init(cx, "passOptionalExternal") || | ||||
| 72837 | !atomsCache->nullableExternal_id.init(cx, "nullableExternal") || | ||||
| 72838 | !atomsCache->nonNullExternal_id.init(cx, "nonNullExternal") || | ||||
| 72839 | !atomsCache->passNullableExternal_id.init(cx, "passNullableExternal") || | ||||
| 72840 | !atomsCache->passExternal_id.init(cx, "passExternal") || | ||||
| 72841 | !atomsCache->receiveWeakNullableExternal_id.init(cx, "receiveWeakNullableExternal") || | ||||
| 72842 | !atomsCache->receiveWeakExternal_id.init(cx, "receiveWeakExternal") || | ||||
| 72843 | !atomsCache->receiveNullableExternal_id.init(cx, "receiveNullableExternal") || | ||||
| 72844 | !atomsCache->receiveExternal_id.init(cx, "receiveExternal") || | ||||
| 72845 | !atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceNullableSequence") || | ||||
| 72846 | !atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNonWrapperCacheInterfaceNullableSequence") || | ||||
| 72847 | !atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceSequence") || | ||||
| 72848 | !atomsCache->receiveNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNonWrapperCacheInterfaceSequence") || | ||||
| 72849 | !atomsCache->receiveNullableNonWrapperCacheInterface_id.init(cx, "receiveNullableNonWrapperCacheInterface") || | ||||
| 72850 | !atomsCache->receiveNonWrapperCacheInterface_id.init(cx, "receiveNonWrapperCacheInterface") || | ||||
| 72851 | !atomsCache->passOptionalSelfWithDefault_id.init(cx, "passOptionalSelfWithDefault") || | ||||
| 72852 | !atomsCache->passOptionalNonNullSelf_id.init(cx, "passOptionalNonNullSelf") || | ||||
| 72853 | !atomsCache->passOptionalSelf_id.init(cx, "passOptionalSelf") || | ||||
| 72854 | !atomsCache->nullableSelf_id.init(cx, "nullableSelf") || | ||||
| 72855 | !atomsCache->nonNullSelf_id.init(cx, "nonNullSelf") || | ||||
| 72856 | !atomsCache->passNullableSelf_id.init(cx, "passNullableSelf") || | ||||
| 72857 | !atomsCache->passSelf_id.init(cx, "passSelf") || | ||||
| 72858 | !atomsCache->receiveWeakNullableSelf_id.init(cx, "receiveWeakNullableSelf") || | ||||
| 72859 | !atomsCache->receiveWeakSelf_id.init(cx, "receiveWeakSelf") || | ||||
| 72860 | !atomsCache->receiveNullableSelf_id.init(cx, "receiveNullableSelf") || | ||||
| 72861 | !atomsCache->receiveSelf_id.init(cx, "receiveSelf") || | ||||
| 72862 | !atomsCache->lenientDoubleAttr_id.init(cx, "lenientDoubleAttr") || | ||||
| 72863 | !atomsCache->lenientFloatAttr_id.init(cx, "lenientFloatAttr") || | ||||
| 72864 | !atomsCache->passLenientFloat_id.init(cx, "passLenientFloat") || | ||||
| 72865 | !atomsCache->passFloat_id.init(cx, "passFloat") || | ||||
| 72866 | !atomsCache->writableNullableUnrestrictedDouble_id.init(cx, "writableNullableUnrestrictedDouble") || | ||||
| 72867 | !atomsCache->writableNullableDouble_id.init(cx, "writableNullableDouble") || | ||||
| 72868 | !atomsCache->writableUnrestrictedDouble_id.init(cx, "writableUnrestrictedDouble") || | ||||
| 72869 | !atomsCache->writableDouble_id.init(cx, "writableDouble") || | ||||
| 72870 | !atomsCache->writableNullableUnrestrictedFloat_id.init(cx, "writableNullableUnrestrictedFloat") || | ||||
| 72871 | !atomsCache->writableNullableFloat_id.init(cx, "writableNullableFloat") || | ||||
| 72872 | !atomsCache->writableUnrestrictedFloat_id.init(cx, "writableUnrestrictedFloat") || | ||||
| 72873 | !atomsCache->writableFloat_id.init(cx, "writableFloat") || | ||||
| 72874 | !atomsCache->passOptionalUnsignedLongLongWithDefault_id.init(cx, "passOptionalUnsignedLongLongWithDefault") || | ||||
| 72875 | !atomsCache->passOptionalUnsignedLongLong_id.init(cx, "passOptionalUnsignedLongLong") || | ||||
| 72876 | !atomsCache->receiveUnsignedLongLong_id.init(cx, "receiveUnsignedLongLong") || | ||||
| 72877 | !atomsCache->passUnsignedLongLong_id.init(cx, "passUnsignedLongLong") || | ||||
| 72878 | !atomsCache->writableUnsignedLongLong_id.init(cx, "writableUnsignedLongLong") || | ||||
| 72879 | !atomsCache->readonlyUnsignedLongLong_id.init(cx, "readonlyUnsignedLongLong") || | ||||
| 72880 | !atomsCache->passOptionalUnsignedLongWithDefault_id.init(cx, "passOptionalUnsignedLongWithDefault") || | ||||
| 72881 | !atomsCache->passOptionalUnsignedLong_id.init(cx, "passOptionalUnsignedLong") || | ||||
| 72882 | !atomsCache->receiveUnsignedLong_id.init(cx, "receiveUnsignedLong") || | ||||
| 72883 | !atomsCache->passUnsignedLong_id.init(cx, "passUnsignedLong") || | ||||
| 72884 | !atomsCache->writableUnsignedLong_id.init(cx, "writableUnsignedLong") || | ||||
| 72885 | !atomsCache->readonlyUnsignedLong_id.init(cx, "readonlyUnsignedLong") || | ||||
| 72886 | !atomsCache->passOptionalUnsignedShortWithDefault_id.init(cx, "passOptionalUnsignedShortWithDefault") || | ||||
| 72887 | !atomsCache->passOptionalUnsignedShort_id.init(cx, "passOptionalUnsignedShort") || | ||||
| 72888 | !atomsCache->receiveUnsignedShort_id.init(cx, "receiveUnsignedShort") || | ||||
| 72889 | !atomsCache->passUnsignedShort_id.init(cx, "passUnsignedShort") || | ||||
| 72890 | !atomsCache->writableUnsignedShort_id.init(cx, "writableUnsignedShort") || | ||||
| 72891 | !atomsCache->readonlyUnsignedShort_id.init(cx, "readonlyUnsignedShort") || | ||||
| 72892 | !atomsCache->passOptionalOctetWithDefault_id.init(cx, "passOptionalOctetWithDefault") || | ||||
| 72893 | !atomsCache->passOptionalOctet_id.init(cx, "passOptionalOctet") || | ||||
| 72894 | !atomsCache->receiveOctet_id.init(cx, "receiveOctet") || | ||||
| 72895 | !atomsCache->passOctet_id.init(cx, "passOctet") || | ||||
| 72896 | !atomsCache->writableOctet_id.init(cx, "writableOctet") || | ||||
| 72897 | !atomsCache->readonlyOctet_id.init(cx, "readonlyOctet") || | ||||
| 72898 | !atomsCache->passOptionalLongLongWithDefault_id.init(cx, "passOptionalLongLongWithDefault") || | ||||
| 72899 | !atomsCache->passOptionalLongLong_id.init(cx, "passOptionalLongLong") || | ||||
| 72900 | !atomsCache->receiveLongLong_id.init(cx, "receiveLongLong") || | ||||
| 72901 | !atomsCache->passLongLong_id.init(cx, "passLongLong") || | ||||
| 72902 | !atomsCache->writableLongLong_id.init(cx, "writableLongLong") || | ||||
| 72903 | !atomsCache->readonlyLongLong_id.init(cx, "readonlyLongLong") || | ||||
| 72904 | !atomsCache->passOptionalLongWithDefault_id.init(cx, "passOptionalLongWithDefault") || | ||||
| 72905 | !atomsCache->passOptionalLong_id.init(cx, "passOptionalLong") || | ||||
| 72906 | !atomsCache->receiveLong_id.init(cx, "receiveLong") || | ||||
| 72907 | !atomsCache->passLong_id.init(cx, "passLong") || | ||||
| 72908 | !atomsCache->writableLong_id.init(cx, "writableLong") || | ||||
| 72909 | !atomsCache->readonlyLong_id.init(cx, "readonlyLong") || | ||||
| 72910 | !atomsCache->passOptionalShortWithDefault_id.init(cx, "passOptionalShortWithDefault") || | ||||
| 72911 | !atomsCache->passOptionalShort_id.init(cx, "passOptionalShort") || | ||||
| 72912 | !atomsCache->receiveShort_id.init(cx, "receiveShort") || | ||||
| 72913 | !atomsCache->passShort_id.init(cx, "passShort") || | ||||
| 72914 | !atomsCache->writableShort_id.init(cx, "writableShort") || | ||||
| 72915 | !atomsCache->readonlyShort_id.init(cx, "readonlyShort") || | ||||
| 72916 | !atomsCache->returnDeviceStateDependentByte_id.init(cx, "returnDeviceStateDependentByte") || | ||||
| 72917 | !atomsCache->returnConstantByte_id.init(cx, "returnConstantByte") || | ||||
| 72918 | !atomsCache->returnDOMDependentByte_id.init(cx, "returnDOMDependentByte") || | ||||
| 72919 | !atomsCache->returnByteSideEffectFree_id.init(cx, "returnByteSideEffectFree") || | ||||
| 72920 | !atomsCache->deviceStateDependentByte_id.init(cx, "deviceStateDependentByte") || | ||||
| 72921 | !atomsCache->constantByte_id.init(cx, "constantByte") || | ||||
| 72922 | !atomsCache->domDependentByte_id.init(cx, "domDependentByte") || | ||||
| 72923 | !atomsCache->sideEffectFreeByte_id.init(cx, "sideEffectFreeByte") || | ||||
| 72924 | !atomsCache->passVariadicByte_id.init(cx, "passVariadicByte") || | ||||
| 72925 | !atomsCache->passOptionalNullableByte_id.init(cx, "passOptionalNullableByte") || | ||||
| 72926 | !atomsCache->passNullableByte_id.init(cx, "passNullableByte") || | ||||
| 72927 | !atomsCache->passOptionalByteWithDefaultBeforeRequired_id.init(cx, "passOptionalByteWithDefaultBeforeRequired") || | ||||
| 72928 | !atomsCache->passOptionalByteWithDefault_id.init(cx, "passOptionalByteWithDefault") || | ||||
| 72929 | !atomsCache->passOptionalByteBeforeRequired_id.init(cx, "passOptionalByteBeforeRequired") || | ||||
| 72930 | !atomsCache->passOptionalByte_id.init(cx, "passOptionalByte") || | ||||
| 72931 | !atomsCache->receiveByte_id.init(cx, "receiveByte") || | ||||
| 72932 | !atomsCache->passByte_id.init(cx, "passByte") || | ||||
| 72933 | !atomsCache->writableByte_id.init(cx, "writableByte") || | ||||
| 72934 | !atomsCache->readonlyByte_id.init(cx, "readonlyByte")) { | ||||
| 72935 | return false; | ||||
| 72936 | } | ||||
| 72937 | return true; | ||||
| 72938 | } | ||||
| 72939 | |||||
| 72940 | |||||
| 72941 | int8_t | ||||
| 72942 | TestJSImplInterfaceJSImpl::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72943 | { | ||||
| 72944 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72945 | if (aRv.Failed()) { | ||||
| 72946 | return int8_t(0); | ||||
| 72947 | } | ||||
| 72948 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72948); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72948; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72949 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72950 | |||||
| 72951 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72952 | |||||
| 72953 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 72954 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72955 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 72956 | && !InitIds(cx, atomsCache)) || | ||||
| 72957 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyByte_id, &rval)) { | ||||
| 72958 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72959 | return int8_t(0); | ||||
| 72960 | } | ||||
| 72961 | int8_t rvalDecl; | ||||
| 72962 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyByte", &rvalDecl)) { | ||||
| 72963 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72964 | return int8_t(0); | ||||
| 72965 | } | ||||
| 72966 | return rvalDecl; | ||||
| 72967 | } | ||||
| 72968 | |||||
| 72969 | int8_t | ||||
| 72970 | TestJSImplInterfaceJSImpl::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72971 | { | ||||
| 72972 | CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 72973 | if (aRv.Failed()) { | ||||
| 72974 | return int8_t(0); | ||||
| 72975 | } | ||||
| 72976 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 72976); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 72976; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 72977 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 72978 | |||||
| 72979 | JS::Rooted<JS::Value> rval(cx); | ||||
| 72980 | |||||
| 72981 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 72982 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 72983 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 72984 | && !InitIds(cx, atomsCache)) || | ||||
| 72985 | !JS_GetPropertyById(cx, callback, atomsCache->writableByte_id, &rval)) { | ||||
| 72986 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72987 | return int8_t(0); | ||||
| 72988 | } | ||||
| 72989 | int8_t rvalDecl; | ||||
| 72990 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableByte", &rvalDecl)) { | ||||
| 72991 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 72992 | return int8_t(0); | ||||
| 72993 | } | ||||
| 72994 | return rvalDecl; | ||||
| 72995 | } | ||||
| 72996 | |||||
| 72997 | int8_t | ||||
| 72998 | TestJSImplInterfaceJSImpl::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 72999 | { | ||||
| 73000 | CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73001 | if (aRv.Failed()) { | ||||
| 73002 | return int8_t(0); | ||||
| 73003 | } | ||||
| 73004 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73004); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73004; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73005 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73006 | |||||
| 73007 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73008 | |||||
| 73009 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73010 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73011 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73012 | && !InitIds(cx, atomsCache)) || | ||||
| 73013 | !JS_GetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, &rval)) { | ||||
| 73014 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73015 | return int8_t(0); | ||||
| 73016 | } | ||||
| 73017 | int8_t rvalDecl; | ||||
| 73018 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.sideEffectFreeByte", &rvalDecl)) { | ||||
| 73019 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73020 | return int8_t(0); | ||||
| 73021 | } | ||||
| 73022 | return rvalDecl; | ||||
| 73023 | } | ||||
| 73024 | |||||
| 73025 | int8_t | ||||
| 73026 | TestJSImplInterfaceJSImpl::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73027 | { | ||||
| 73028 | CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73029 | if (aRv.Failed()) { | ||||
| 73030 | return int8_t(0); | ||||
| 73031 | } | ||||
| 73032 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73032); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73032; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73033 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73034 | |||||
| 73035 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73036 | |||||
| 73037 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73038 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73039 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73040 | && !InitIds(cx, atomsCache)) || | ||||
| 73041 | !JS_GetPropertyById(cx, callback, atomsCache->domDependentByte_id, &rval)) { | ||||
| 73042 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73043 | return int8_t(0); | ||||
| 73044 | } | ||||
| 73045 | int8_t rvalDecl; | ||||
| 73046 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.domDependentByte", &rvalDecl)) { | ||||
| 73047 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73048 | return int8_t(0); | ||||
| 73049 | } | ||||
| 73050 | return rvalDecl; | ||||
| 73051 | } | ||||
| 73052 | |||||
| 73053 | int8_t | ||||
| 73054 | TestJSImplInterfaceJSImpl::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73055 | { | ||||
| 73056 | CallSetup s(this, aRv, "TestJSImplInterface.constantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73057 | if (aRv.Failed()) { | ||||
| 73058 | return int8_t(0); | ||||
| 73059 | } | ||||
| 73060 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73060); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73060; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73061 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73062 | |||||
| 73063 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73064 | |||||
| 73065 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73066 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73067 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73068 | && !InitIds(cx, atomsCache)) || | ||||
| 73069 | !JS_GetPropertyById(cx, callback, atomsCache->constantByte_id, &rval)) { | ||||
| 73070 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73071 | return int8_t(0); | ||||
| 73072 | } | ||||
| 73073 | int8_t rvalDecl; | ||||
| 73074 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.constantByte", &rvalDecl)) { | ||||
| 73075 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73076 | return int8_t(0); | ||||
| 73077 | } | ||||
| 73078 | return rvalDecl; | ||||
| 73079 | } | ||||
| 73080 | |||||
| 73081 | int8_t | ||||
| 73082 | TestJSImplInterfaceJSImpl::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73083 | { | ||||
| 73084 | CallSetup s(this, aRv, "TestJSImplInterface.deviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73085 | if (aRv.Failed()) { | ||||
| 73086 | return int8_t(0); | ||||
| 73087 | } | ||||
| 73088 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73088); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73088; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73089 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73090 | |||||
| 73091 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73092 | |||||
| 73093 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73094 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73095 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73096 | && !InitIds(cx, atomsCache)) || | ||||
| 73097 | !JS_GetPropertyById(cx, callback, atomsCache->deviceStateDependentByte_id, &rval)) { | ||||
| 73098 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73099 | return int8_t(0); | ||||
| 73100 | } | ||||
| 73101 | int8_t rvalDecl; | ||||
| 73102 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deviceStateDependentByte", &rvalDecl)) { | ||||
| 73103 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73104 | return int8_t(0); | ||||
| 73105 | } | ||||
| 73106 | return rvalDecl; | ||||
| 73107 | } | ||||
| 73108 | |||||
| 73109 | int16_t | ||||
| 73110 | TestJSImplInterfaceJSImpl::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73111 | { | ||||
| 73112 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73113 | if (aRv.Failed()) { | ||||
| 73114 | return int16_t(0); | ||||
| 73115 | } | ||||
| 73116 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73116; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73117 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73118 | |||||
| 73119 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73120 | |||||
| 73121 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73122 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73123 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73124 | && !InitIds(cx, atomsCache)) || | ||||
| 73125 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyShort_id, &rval)) { | ||||
| 73126 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73127 | return int16_t(0); | ||||
| 73128 | } | ||||
| 73129 | int16_t rvalDecl; | ||||
| 73130 | if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyShort", &rvalDecl)) { | ||||
| 73131 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73132 | return int16_t(0); | ||||
| 73133 | } | ||||
| 73134 | return rvalDecl; | ||||
| 73135 | } | ||||
| 73136 | |||||
| 73137 | int16_t | ||||
| 73138 | TestJSImplInterfaceJSImpl::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73139 | { | ||||
| 73140 | CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73141 | if (aRv.Failed()) { | ||||
| 73142 | return int16_t(0); | ||||
| 73143 | } | ||||
| 73144 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73144); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73144; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73145 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73146 | |||||
| 73147 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73148 | |||||
| 73149 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73150 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73151 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73152 | && !InitIds(cx, atomsCache)) || | ||||
| 73153 | !JS_GetPropertyById(cx, callback, atomsCache->writableShort_id, &rval)) { | ||||
| 73154 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73155 | return int16_t(0); | ||||
| 73156 | } | ||||
| 73157 | int16_t rvalDecl; | ||||
| 73158 | if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableShort", &rvalDecl)) { | ||||
| 73159 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73160 | return int16_t(0); | ||||
| 73161 | } | ||||
| 73162 | return rvalDecl; | ||||
| 73163 | } | ||||
| 73164 | |||||
| 73165 | int32_t | ||||
| 73166 | TestJSImplInterfaceJSImpl::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73167 | { | ||||
| 73168 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73169 | if (aRv.Failed()) { | ||||
| 73170 | return int32_t(0); | ||||
| 73171 | } | ||||
| 73172 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73172); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73172; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73173 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73174 | |||||
| 73175 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73176 | |||||
| 73177 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73178 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73179 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73180 | && !InitIds(cx, atomsCache)) || | ||||
| 73181 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyLong_id, &rval)) { | ||||
| 73182 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73183 | return int32_t(0); | ||||
| 73184 | } | ||||
| 73185 | int32_t rvalDecl; | ||||
| 73186 | if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLong", &rvalDecl)) { | ||||
| 73187 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73188 | return int32_t(0); | ||||
| 73189 | } | ||||
| 73190 | return rvalDecl; | ||||
| 73191 | } | ||||
| 73192 | |||||
| 73193 | int32_t | ||||
| 73194 | TestJSImplInterfaceJSImpl::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73195 | { | ||||
| 73196 | CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73197 | if (aRv.Failed()) { | ||||
| 73198 | return int32_t(0); | ||||
| 73199 | } | ||||
| 73200 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73200); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73200; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73201 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73202 | |||||
| 73203 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73204 | |||||
| 73205 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73206 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73207 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73208 | && !InitIds(cx, atomsCache)) || | ||||
| 73209 | !JS_GetPropertyById(cx, callback, atomsCache->writableLong_id, &rval)) { | ||||
| 73210 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73211 | return int32_t(0); | ||||
| 73212 | } | ||||
| 73213 | int32_t rvalDecl; | ||||
| 73214 | if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLong", &rvalDecl)) { | ||||
| 73215 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73216 | return int32_t(0); | ||||
| 73217 | } | ||||
| 73218 | return rvalDecl; | ||||
| 73219 | } | ||||
| 73220 | |||||
| 73221 | int64_t | ||||
| 73222 | TestJSImplInterfaceJSImpl::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73223 | { | ||||
| 73224 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73225 | if (aRv.Failed()) { | ||||
| 73226 | return int64_t(0); | ||||
| 73227 | } | ||||
| 73228 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73228); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73228; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73229 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73230 | |||||
| 73231 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73232 | |||||
| 73233 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73234 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73235 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73236 | && !InitIds(cx, atomsCache)) || | ||||
| 73237 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyLongLong_id, &rval)) { | ||||
| 73238 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73239 | return int64_t(0); | ||||
| 73240 | } | ||||
| 73241 | int64_t rvalDecl; | ||||
| 73242 | if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLongLong", &rvalDecl)) { | ||||
| 73243 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73244 | return int64_t(0); | ||||
| 73245 | } | ||||
| 73246 | return rvalDecl; | ||||
| 73247 | } | ||||
| 73248 | |||||
| 73249 | int64_t | ||||
| 73250 | TestJSImplInterfaceJSImpl::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73251 | { | ||||
| 73252 | CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73253 | if (aRv.Failed()) { | ||||
| 73254 | return int64_t(0); | ||||
| 73255 | } | ||||
| 73256 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73256); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73256; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73257 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73258 | |||||
| 73259 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73260 | |||||
| 73261 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73262 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73263 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73264 | && !InitIds(cx, atomsCache)) || | ||||
| 73265 | !JS_GetPropertyById(cx, callback, atomsCache->writableLongLong_id, &rval)) { | ||||
| 73266 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73267 | return int64_t(0); | ||||
| 73268 | } | ||||
| 73269 | int64_t rvalDecl; | ||||
| 73270 | if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLongLong", &rvalDecl)) { | ||||
| 73271 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73272 | return int64_t(0); | ||||
| 73273 | } | ||||
| 73274 | return rvalDecl; | ||||
| 73275 | } | ||||
| 73276 | |||||
| 73277 | uint8_t | ||||
| 73278 | TestJSImplInterfaceJSImpl::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73279 | { | ||||
| 73280 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73281 | if (aRv.Failed()) { | ||||
| 73282 | return uint8_t(0); | ||||
| 73283 | } | ||||
| 73284 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73284); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73284; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73285 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73286 | |||||
| 73287 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73288 | |||||
| 73289 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73290 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73291 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73292 | && !InitIds(cx, atomsCache)) || | ||||
| 73293 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyOctet_id, &rval)) { | ||||
| 73294 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73295 | return uint8_t(0); | ||||
| 73296 | } | ||||
| 73297 | uint8_t rvalDecl; | ||||
| 73298 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyOctet", &rvalDecl)) { | ||||
| 73299 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73300 | return uint8_t(0); | ||||
| 73301 | } | ||||
| 73302 | return rvalDecl; | ||||
| 73303 | } | ||||
| 73304 | |||||
| 73305 | uint8_t | ||||
| 73306 | TestJSImplInterfaceJSImpl::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73307 | { | ||||
| 73308 | CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73309 | if (aRv.Failed()) { | ||||
| 73310 | return uint8_t(0); | ||||
| 73311 | } | ||||
| 73312 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73312); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73312; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73313 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73314 | |||||
| 73315 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73316 | |||||
| 73317 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73318 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73319 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73320 | && !InitIds(cx, atomsCache)) || | ||||
| 73321 | !JS_GetPropertyById(cx, callback, atomsCache->writableOctet_id, &rval)) { | ||||
| 73322 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73323 | return uint8_t(0); | ||||
| 73324 | } | ||||
| 73325 | uint8_t rvalDecl; | ||||
| 73326 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableOctet", &rvalDecl)) { | ||||
| 73327 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73328 | return uint8_t(0); | ||||
| 73329 | } | ||||
| 73330 | return rvalDecl; | ||||
| 73331 | } | ||||
| 73332 | |||||
| 73333 | uint16_t | ||||
| 73334 | TestJSImplInterfaceJSImpl::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73335 | { | ||||
| 73336 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73337 | if (aRv.Failed()) { | ||||
| 73338 | return uint16_t(0); | ||||
| 73339 | } | ||||
| 73340 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73340); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73340; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73341 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73342 | |||||
| 73343 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73344 | |||||
| 73345 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73346 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73347 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73348 | && !InitIds(cx, atomsCache)) || | ||||
| 73349 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedShort_id, &rval)) { | ||||
| 73350 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73351 | return uint16_t(0); | ||||
| 73352 | } | ||||
| 73353 | uint16_t rvalDecl; | ||||
| 73354 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedShort", &rvalDecl)) { | ||||
| 73355 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73356 | return uint16_t(0); | ||||
| 73357 | } | ||||
| 73358 | return rvalDecl; | ||||
| 73359 | } | ||||
| 73360 | |||||
| 73361 | uint16_t | ||||
| 73362 | TestJSImplInterfaceJSImpl::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73363 | { | ||||
| 73364 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73365 | if (aRv.Failed()) { | ||||
| 73366 | return uint16_t(0); | ||||
| 73367 | } | ||||
| 73368 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73368); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73368; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73369 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73370 | |||||
| 73371 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73372 | |||||
| 73373 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73374 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73375 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73376 | && !InitIds(cx, atomsCache)) || | ||||
| 73377 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, &rval)) { | ||||
| 73378 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73379 | return uint16_t(0); | ||||
| 73380 | } | ||||
| 73381 | uint16_t rvalDecl; | ||||
| 73382 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedShort", &rvalDecl)) { | ||||
| 73383 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73384 | return uint16_t(0); | ||||
| 73385 | } | ||||
| 73386 | return rvalDecl; | ||||
| 73387 | } | ||||
| 73388 | |||||
| 73389 | uint32_t | ||||
| 73390 | TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73391 | { | ||||
| 73392 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73393 | if (aRv.Failed()) { | ||||
| 73394 | return uint32_t(0); | ||||
| 73395 | } | ||||
| 73396 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73396); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73396; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73397 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73398 | |||||
| 73399 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73400 | |||||
| 73401 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73402 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73403 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73404 | && !InitIds(cx, atomsCache)) || | ||||
| 73405 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLong_id, &rval)) { | ||||
| 73406 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73407 | return uint32_t(0); | ||||
| 73408 | } | ||||
| 73409 | uint32_t rvalDecl; | ||||
| 73410 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLong", &rvalDecl)) { | ||||
| 73411 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73412 | return uint32_t(0); | ||||
| 73413 | } | ||||
| 73414 | return rvalDecl; | ||||
| 73415 | } | ||||
| 73416 | |||||
| 73417 | uint32_t | ||||
| 73418 | TestJSImplInterfaceJSImpl::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73419 | { | ||||
| 73420 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73421 | if (aRv.Failed()) { | ||||
| 73422 | return uint32_t(0); | ||||
| 73423 | } | ||||
| 73424 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73424); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73424; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73425 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73426 | |||||
| 73427 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73428 | |||||
| 73429 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73430 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73431 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73432 | && !InitIds(cx, atomsCache)) || | ||||
| 73433 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, &rval)) { | ||||
| 73434 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73435 | return uint32_t(0); | ||||
| 73436 | } | ||||
| 73437 | uint32_t rvalDecl; | ||||
| 73438 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLong", &rvalDecl)) { | ||||
| 73439 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73440 | return uint32_t(0); | ||||
| 73441 | } | ||||
| 73442 | return rvalDecl; | ||||
| 73443 | } | ||||
| 73444 | |||||
| 73445 | uint64_t | ||||
| 73446 | TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73447 | { | ||||
| 73448 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73449 | if (aRv.Failed()) { | ||||
| 73450 | return uint64_t(0); | ||||
| 73451 | } | ||||
| 73452 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73452); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73452; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73453 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73454 | |||||
| 73455 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73456 | |||||
| 73457 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73458 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73459 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73460 | && !InitIds(cx, atomsCache)) || | ||||
| 73461 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLongLong_id, &rval)) { | ||||
| 73462 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73463 | return uint64_t(0); | ||||
| 73464 | } | ||||
| 73465 | uint64_t rvalDecl; | ||||
| 73466 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLongLong", &rvalDecl)) { | ||||
| 73467 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73468 | return uint64_t(0); | ||||
| 73469 | } | ||||
| 73470 | return rvalDecl; | ||||
| 73471 | } | ||||
| 73472 | |||||
| 73473 | uint64_t | ||||
| 73474 | TestJSImplInterfaceJSImpl::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73475 | { | ||||
| 73476 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73477 | if (aRv.Failed()) { | ||||
| 73478 | return uint64_t(0); | ||||
| 73479 | } | ||||
| 73480 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73480); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73480; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73481 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73482 | |||||
| 73483 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73484 | |||||
| 73485 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73486 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73487 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73488 | && !InitIds(cx, atomsCache)) || | ||||
| 73489 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, &rval)) { | ||||
| 73490 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73491 | return uint64_t(0); | ||||
| 73492 | } | ||||
| 73493 | uint64_t rvalDecl; | ||||
| 73494 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLongLong", &rvalDecl)) { | ||||
| 73495 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73496 | return uint64_t(0); | ||||
| 73497 | } | ||||
| 73498 | return rvalDecl; | ||||
| 73499 | } | ||||
| 73500 | |||||
| 73501 | float | ||||
| 73502 | TestJSImplInterfaceJSImpl::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73503 | { | ||||
| 73504 | CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73505 | if (aRv.Failed()) { | ||||
| 73506 | return float(0); | ||||
| 73507 | } | ||||
| 73508 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73508); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73508; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73509 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73510 | |||||
| 73511 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73512 | |||||
| 73513 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73514 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73515 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73516 | && !InitIds(cx, atomsCache)) || | ||||
| 73517 | !JS_GetPropertyById(cx, callback, atomsCache->writableFloat_id, &rval)) { | ||||
| 73518 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73519 | return float(0); | ||||
| 73520 | } | ||||
| 73521 | float rvalDecl; | ||||
| 73522 | if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableFloat", &rvalDecl)) { | ||||
| 73523 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73524 | return float(0); | ||||
| 73525 | } else if (!std::isfinite(rvalDecl)) { | ||||
| 73526 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableFloat"); | ||||
| 73527 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73528 | return float(0); | ||||
| 73529 | } | ||||
| 73530 | return rvalDecl; | ||||
| 73531 | } | ||||
| 73532 | |||||
| 73533 | float | ||||
| 73534 | TestJSImplInterfaceJSImpl::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73535 | { | ||||
| 73536 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73537 | if (aRv.Failed()) { | ||||
| 73538 | return float(0); | ||||
| 73539 | } | ||||
| 73540 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73540); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73540; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73541 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73542 | |||||
| 73543 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73544 | |||||
| 73545 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73546 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73547 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73548 | && !InitIds(cx, atomsCache)) || | ||||
| 73549 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, &rval)) { | ||||
| 73550 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73551 | return float(0); | ||||
| 73552 | } | ||||
| 73553 | float rvalDecl; | ||||
| 73554 | if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedFloat", &rvalDecl)) { | ||||
| 73555 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73556 | return float(0); | ||||
| 73557 | } | ||||
| 73558 | return rvalDecl; | ||||
| 73559 | } | ||||
| 73560 | |||||
| 73561 | Nullable<float> | ||||
| 73562 | TestJSImplInterfaceJSImpl::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73563 | { | ||||
| 73564 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73565 | if (aRv.Failed()) { | ||||
| 73566 | return Nullable<float>(); | ||||
| 73567 | } | ||||
| 73568 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73568); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73568; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73569 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73570 | |||||
| 73571 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73572 | |||||
| 73573 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73574 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73575 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73576 | && !InitIds(cx, atomsCache)) || | ||||
| 73577 | !JS_GetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, &rval)) { | ||||
| 73578 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73579 | return Nullable<float>(); | ||||
| 73580 | } | ||||
| 73581 | Nullable<float> rvalDecl; | ||||
| 73582 | if (rval.isNullOrUndefined()) { | ||||
| 73583 | rvalDecl.SetNull(); | ||||
| 73584 | } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableFloat", &rvalDecl.SetValue())) { | ||||
| 73585 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73586 | return Nullable<float>(); | ||||
| 73587 | } else if (!std::isfinite(rvalDecl.Value())) { | ||||
| 73588 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableFloat"); | ||||
| 73589 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73590 | return Nullable<float>(); | ||||
| 73591 | } | ||||
| 73592 | return rvalDecl; | ||||
| 73593 | } | ||||
| 73594 | |||||
| 73595 | Nullable<float> | ||||
| 73596 | TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73597 | { | ||||
| 73598 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73599 | if (aRv.Failed()) { | ||||
| 73600 | return Nullable<float>(); | ||||
| 73601 | } | ||||
| 73602 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73602; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73603 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73604 | |||||
| 73605 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73606 | |||||
| 73607 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73608 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73609 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73610 | && !InitIds(cx, atomsCache)) || | ||||
| 73611 | !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, &rval)) { | ||||
| 73612 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73613 | return Nullable<float>(); | ||||
| 73614 | } | ||||
| 73615 | Nullable<float> rvalDecl; | ||||
| 73616 | if (rval.isNullOrUndefined()) { | ||||
| 73617 | rvalDecl.SetNull(); | ||||
| 73618 | } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedFloat", &rvalDecl.SetValue())) { | ||||
| 73619 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73620 | return Nullable<float>(); | ||||
| 73621 | } | ||||
| 73622 | return rvalDecl; | ||||
| 73623 | } | ||||
| 73624 | |||||
| 73625 | double | ||||
| 73626 | TestJSImplInterfaceJSImpl::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73627 | { | ||||
| 73628 | CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73629 | if (aRv.Failed()) { | ||||
| 73630 | return double(0); | ||||
| 73631 | } | ||||
| 73632 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73632); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73632; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73633 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73634 | |||||
| 73635 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73636 | |||||
| 73637 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73638 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73639 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73640 | && !InitIds(cx, atomsCache)) || | ||||
| 73641 | !JS_GetPropertyById(cx, callback, atomsCache->writableDouble_id, &rval)) { | ||||
| 73642 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73643 | return double(0); | ||||
| 73644 | } | ||||
| 73645 | double rvalDecl; | ||||
| 73646 | if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableDouble", &rvalDecl)) { | ||||
| 73647 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73648 | return double(0); | ||||
| 73649 | } else if (!std::isfinite(rvalDecl)) { | ||||
| 73650 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableDouble"); | ||||
| 73651 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73652 | return double(0); | ||||
| 73653 | } | ||||
| 73654 | return rvalDecl; | ||||
| 73655 | } | ||||
| 73656 | |||||
| 73657 | double | ||||
| 73658 | TestJSImplInterfaceJSImpl::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73659 | { | ||||
| 73660 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73661 | if (aRv.Failed()) { | ||||
| 73662 | return double(0); | ||||
| 73663 | } | ||||
| 73664 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73664); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73664; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73665 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73666 | |||||
| 73667 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73668 | |||||
| 73669 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73670 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73671 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73672 | && !InitIds(cx, atomsCache)) || | ||||
| 73673 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, &rval)) { | ||||
| 73674 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73675 | return double(0); | ||||
| 73676 | } | ||||
| 73677 | double rvalDecl; | ||||
| 73678 | if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedDouble", &rvalDecl)) { | ||||
| 73679 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73680 | return double(0); | ||||
| 73681 | } | ||||
| 73682 | return rvalDecl; | ||||
| 73683 | } | ||||
| 73684 | |||||
| 73685 | Nullable<double> | ||||
| 73686 | TestJSImplInterfaceJSImpl::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73687 | { | ||||
| 73688 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73689 | if (aRv.Failed()) { | ||||
| 73690 | return Nullable<double>(); | ||||
| 73691 | } | ||||
| 73692 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73692); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73692; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73693 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73694 | |||||
| 73695 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73696 | |||||
| 73697 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73698 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73699 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73700 | && !InitIds(cx, atomsCache)) || | ||||
| 73701 | !JS_GetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, &rval)) { | ||||
| 73702 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73703 | return Nullable<double>(); | ||||
| 73704 | } | ||||
| 73705 | Nullable<double> rvalDecl; | ||||
| 73706 | if (rval.isNullOrUndefined()) { | ||||
| 73707 | rvalDecl.SetNull(); | ||||
| 73708 | } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableDouble", &rvalDecl.SetValue())) { | ||||
| 73709 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73710 | return Nullable<double>(); | ||||
| 73711 | } else if (!std::isfinite(rvalDecl.Value())) { | ||||
| 73712 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableDouble"); | ||||
| 73713 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73714 | return Nullable<double>(); | ||||
| 73715 | } | ||||
| 73716 | return rvalDecl; | ||||
| 73717 | } | ||||
| 73718 | |||||
| 73719 | Nullable<double> | ||||
| 73720 | TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73721 | { | ||||
| 73722 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73723 | if (aRv.Failed()) { | ||||
| 73724 | return Nullable<double>(); | ||||
| 73725 | } | ||||
| 73726 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73726); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73726; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73727 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73728 | |||||
| 73729 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73730 | |||||
| 73731 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73732 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73733 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73734 | && !InitIds(cx, atomsCache)) || | ||||
| 73735 | !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, &rval)) { | ||||
| 73736 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73737 | return Nullable<double>(); | ||||
| 73738 | } | ||||
| 73739 | Nullable<double> rvalDecl; | ||||
| 73740 | if (rval.isNullOrUndefined()) { | ||||
| 73741 | rvalDecl.SetNull(); | ||||
| 73742 | } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedDouble", &rvalDecl.SetValue())) { | ||||
| 73743 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73744 | return Nullable<double>(); | ||||
| 73745 | } | ||||
| 73746 | return rvalDecl; | ||||
| 73747 | } | ||||
| 73748 | |||||
| 73749 | float | ||||
| 73750 | TestJSImplInterfaceJSImpl::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73751 | { | ||||
| 73752 | CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73753 | if (aRv.Failed()) { | ||||
| 73754 | return float(0); | ||||
| 73755 | } | ||||
| 73756 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73756); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73756; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73757 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73758 | |||||
| 73759 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73760 | |||||
| 73761 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73762 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73763 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73764 | && !InitIds(cx, atomsCache)) || | ||||
| 73765 | !JS_GetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, &rval)) { | ||||
| 73766 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73767 | return float(0); | ||||
| 73768 | } | ||||
| 73769 | float rvalDecl; | ||||
| 73770 | if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientFloatAttr", &rvalDecl)) { | ||||
| 73771 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73772 | return float(0); | ||||
| 73773 | } else if (!std::isfinite(rvalDecl)) { | ||||
| 73774 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientFloatAttr"); | ||||
| 73775 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73776 | return float(0); | ||||
| 73777 | } | ||||
| 73778 | return rvalDecl; | ||||
| 73779 | } | ||||
| 73780 | |||||
| 73781 | double | ||||
| 73782 | TestJSImplInterfaceJSImpl::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73783 | { | ||||
| 73784 | CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73785 | if (aRv.Failed()) { | ||||
| 73786 | return double(0); | ||||
| 73787 | } | ||||
| 73788 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73788); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73788; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73789 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73790 | |||||
| 73791 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73792 | |||||
| 73793 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73794 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73795 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73796 | && !InitIds(cx, atomsCache)) || | ||||
| 73797 | !JS_GetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, &rval)) { | ||||
| 73798 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73799 | return double(0); | ||||
| 73800 | } | ||||
| 73801 | double rvalDecl; | ||||
| 73802 | if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientDoubleAttr", &rvalDecl)) { | ||||
| 73803 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73804 | return double(0); | ||||
| 73805 | } else if (!std::isfinite(rvalDecl)) { | ||||
| 73806 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientDoubleAttr"); | ||||
| 73807 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73808 | return double(0); | ||||
| 73809 | } | ||||
| 73810 | return rvalDecl; | ||||
| 73811 | } | ||||
| 73812 | |||||
| 73813 | already_AddRefed<TestJSImplInterface> | ||||
| 73814 | TestJSImplInterfaceJSImpl::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73815 | { | ||||
| 73816 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73817 | if (aRv.Failed()) { | ||||
| 73818 | return nullptr; | ||||
| 73819 | } | ||||
| 73820 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73820); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73820; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73821 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73822 | |||||
| 73823 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73824 | |||||
| 73825 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73826 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73827 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73828 | && !InitIds(cx, atomsCache)) || | ||||
| 73829 | !JS_GetPropertyById(cx, callback, atomsCache->nonNullSelf_id, &rval)) { | ||||
| 73830 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73831 | return nullptr; | ||||
| 73832 | } | ||||
| 73833 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 73834 | if (rval.isObject()) { | ||||
| 73835 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 73836 | { | ||||
| 73837 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 73838 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 73839 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 73840 | // Be careful to not wrap random DOM objects here, even if | ||||
| 73841 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 73842 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 73843 | // that already has a content reflection... | ||||
| 73844 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 73845 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 73846 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 73847 | if (!callback || | ||||
| 73848 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 73849 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73850 | return nullptr; | ||||
| 73851 | } | ||||
| 73852 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 73853 | 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", 73854); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 73854; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 73854 | "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", 73854); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 73854; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 73855 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 73856 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 73857 | } else { | ||||
| 73858 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullSelf", "TestJSImplInterface"); | ||||
| 73859 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73860 | return nullptr; | ||||
| 73861 | } | ||||
| 73862 | } | ||||
| 73863 | } | ||||
| 73864 | } else { | ||||
| 73865 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullSelf"); | ||||
| 73866 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73867 | return nullptr; | ||||
| 73868 | } | ||||
| 73869 | return rvalDecl.forget(); | ||||
| 73870 | } | ||||
| 73871 | |||||
| 73872 | already_AddRefed<TestJSImplInterface> | ||||
| 73873 | TestJSImplInterfaceJSImpl::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73874 | { | ||||
| 73875 | CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73876 | if (aRv.Failed()) { | ||||
| 73877 | return nullptr; | ||||
| 73878 | } | ||||
| 73879 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73879); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73879; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73880 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73881 | |||||
| 73882 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73883 | |||||
| 73884 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73885 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73886 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73887 | && !InitIds(cx, atomsCache)) || | ||||
| 73888 | !JS_GetPropertyById(cx, callback, atomsCache->nullableSelf_id, &rval)) { | ||||
| 73889 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73890 | return nullptr; | ||||
| 73891 | } | ||||
| 73892 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 73893 | if (rval.isObject()) { | ||||
| 73894 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 73895 | { | ||||
| 73896 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 73897 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 73898 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 73899 | // Be careful to not wrap random DOM objects here, even if | ||||
| 73900 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 73901 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 73902 | // that already has a content reflection... | ||||
| 73903 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 73904 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 73905 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 73906 | if (!callback || | ||||
| 73907 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 73908 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73909 | return nullptr; | ||||
| 73910 | } | ||||
| 73911 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 73912 | 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", 73913); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 73913; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 73913 | "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", 73913); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 73913; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 73914 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 73915 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 73916 | } else { | ||||
| 73917 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableSelf", "TestJSImplInterface"); | ||||
| 73918 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73919 | return nullptr; | ||||
| 73920 | } | ||||
| 73921 | } | ||||
| 73922 | } | ||||
| 73923 | } else if (rval.isNullOrUndefined()) { | ||||
| 73924 | rvalDecl = nullptr; | ||||
| 73925 | } else { | ||||
| 73926 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableSelf"); | ||||
| 73927 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73928 | return nullptr; | ||||
| 73929 | } | ||||
| 73930 | return rvalDecl.forget(); | ||||
| 73931 | } | ||||
| 73932 | |||||
| 73933 | already_AddRefed<TestExternalInterface> | ||||
| 73934 | TestJSImplInterfaceJSImpl::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73935 | { | ||||
| 73936 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73937 | if (aRv.Failed()) { | ||||
| 73938 | return nullptr; | ||||
| 73939 | } | ||||
| 73940 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73940); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73940; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73941 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73942 | |||||
| 73943 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73944 | |||||
| 73945 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73946 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73947 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73948 | && !InitIds(cx, atomsCache)) || | ||||
| 73949 | !JS_GetPropertyById(cx, callback, atomsCache->nonNullExternal_id, &rval)) { | ||||
| 73950 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73951 | return nullptr; | ||||
| 73952 | } | ||||
| 73953 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 73954 | if (rval.isObject()) { | ||||
| 73955 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 73956 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 73957 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 73958 | 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)))) { | ||||
| 73959 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullExternal", "TestExternalInterface"); | ||||
| 73960 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73961 | return nullptr; | ||||
| 73962 | } | ||||
| 73963 | 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" , 73963); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 73963; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73964 | rvalDecl = rvalHolder; | ||||
| 73965 | } else { | ||||
| 73966 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullExternal"); | ||||
| 73967 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73968 | return nullptr; | ||||
| 73969 | } | ||||
| 73970 | return rvalDecl.forget(); | ||||
| 73971 | } | ||||
| 73972 | |||||
| 73973 | already_AddRefed<TestExternalInterface> | ||||
| 73974 | TestJSImplInterfaceJSImpl::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 73975 | { | ||||
| 73976 | CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 73977 | if (aRv.Failed()) { | ||||
| 73978 | return nullptr; | ||||
| 73979 | } | ||||
| 73980 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 73980); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 73980; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 73981 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 73982 | |||||
| 73983 | JS::Rooted<JS::Value> rval(cx); | ||||
| 73984 | |||||
| 73985 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 73986 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 73987 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 73988 | && !InitIds(cx, atomsCache)) || | ||||
| 73989 | !JS_GetPropertyById(cx, callback, atomsCache->nullableExternal_id, &rval)) { | ||||
| 73990 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 73991 | return nullptr; | ||||
| 73992 | } | ||||
| 73993 | RefPtr<mozilla::dom::TestExternalInterface> rvalDecl; | ||||
| 73994 | if (rval.isObject()) { | ||||
| 73995 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | ||||
| 73996 | RefPtr<mozilla::dom::TestExternalInterface> rvalHolder; | ||||
| 73997 | JS::Rooted<JSObject*> source(cx, &rval.toObject()); | ||||
| 73998 | 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)))) { | ||||
| 73999 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableExternal", "TestExternalInterface"); | ||||
| 74000 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74001 | return nullptr; | ||||
| 74002 | } | ||||
| 74003 | 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" , 74003); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder" ")"); do { *((volatile int*)__null) = 74003; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74004 | rvalDecl = rvalHolder; | ||||
| 74005 | } else if (rval.isNullOrUndefined()) { | ||||
| 74006 | rvalDecl = nullptr; | ||||
| 74007 | } else { | ||||
| 74008 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableExternal"); | ||||
| 74009 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74010 | return nullptr; | ||||
| 74011 | } | ||||
| 74012 | return rvalDecl.forget(); | ||||
| 74013 | } | ||||
| 74014 | |||||
| 74015 | already_AddRefed<TestCallbackInterface> | ||||
| 74016 | TestJSImplInterfaceJSImpl::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74017 | { | ||||
| 74018 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74019 | if (aRv.Failed()) { | ||||
| 74020 | return nullptr; | ||||
| 74021 | } | ||||
| 74022 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74022); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74022; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74023 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74024 | |||||
| 74025 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74026 | |||||
| 74027 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74028 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74029 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74030 | && !InitIds(cx, atomsCache)) || | ||||
| 74031 | !JS_GetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, &rval)) { | ||||
| 74032 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74033 | return nullptr; | ||||
| 74034 | } | ||||
| 74035 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 74036 | if (rval.isObject()) { | ||||
| 74037 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 74038 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 74039 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 74040 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 74041 | } | ||||
| 74042 | } else { | ||||
| 74043 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullCallbackInterface"); | ||||
| 74044 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74045 | return nullptr; | ||||
| 74046 | } | ||||
| 74047 | return rvalDecl.forget(); | ||||
| 74048 | } | ||||
| 74049 | |||||
| 74050 | already_AddRefed<TestCallbackInterface> | ||||
| 74051 | TestJSImplInterfaceJSImpl::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74052 | { | ||||
| 74053 | CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74054 | if (aRv.Failed()) { | ||||
| 74055 | return nullptr; | ||||
| 74056 | } | ||||
| 74057 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74057); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74057; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74058 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74059 | |||||
| 74060 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74061 | |||||
| 74062 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74063 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74064 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74065 | && !InitIds(cx, atomsCache)) || | ||||
| 74066 | !JS_GetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, &rval)) { | ||||
| 74067 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74068 | return nullptr; | ||||
| 74069 | } | ||||
| 74070 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 74071 | if (rval.isObject()) { | ||||
| 74072 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 74073 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 74074 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 74075 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 74076 | } | ||||
| 74077 | } else if (rval.isNullOrUndefined()) { | ||||
| 74078 | rvalDecl = nullptr; | ||||
| 74079 | } else { | ||||
| 74080 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableCallbackInterface"); | ||||
| 74081 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74082 | return nullptr; | ||||
| 74083 | } | ||||
| 74084 | return rvalDecl.forget(); | ||||
| 74085 | } | ||||
| 74086 | |||||
| 74087 | void | ||||
| 74088 | TestJSImplInterfaceJSImpl::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74089 | { | ||||
| 74090 | CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74091 | if (aRv.Failed()) { | ||||
| 74092 | return; | ||||
| 74093 | } | ||||
| 74094 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74094); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74094; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74095 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74096 | |||||
| 74097 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74098 | |||||
| 74099 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74100 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74101 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74102 | && !InitIds(cx, atomsCache)) || | ||||
| 74103 | !JS_GetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, &rval)) { | ||||
| 74104 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74105 | return; | ||||
| 74106 | } | ||||
| 74107 | RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx); | ||||
| 74108 | if (rval.isObject()) { | ||||
| 74109 | if (!rvalDecl.Init(&rval.toObject())) { | ||||
| 74110 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.uint8ArrayAttr", "Uint8Array"); | ||||
| 74111 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74112 | return; | ||||
| 74113 | } | ||||
| 74114 | if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) { | ||||
| 74115 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.uint8ArrayAttr"); | ||||
| 74116 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74117 | return; | ||||
| 74118 | } | ||||
| 74119 | if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) { | ||||
| 74120 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.uint8ArrayAttr"); | ||||
| 74121 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74122 | return; | ||||
| 74123 | } | ||||
| 74124 | if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) { | ||||
| 74125 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.uint8ArrayAttr"); | ||||
| 74126 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74127 | return; | ||||
| 74128 | } | ||||
| 74129 | } else { | ||||
| 74130 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.uint8ArrayAttr"); | ||||
| 74131 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74132 | return; | ||||
| 74133 | } | ||||
| 74134 | aRetVal.set(rvalDecl.Obj()); | ||||
| 74135 | } | ||||
| 74136 | |||||
| 74137 | void | ||||
| 74138 | TestJSImplInterfaceJSImpl::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74139 | { | ||||
| 74140 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyJSStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74141 | if (aRv.Failed()) { | ||||
| 74142 | return; | ||||
| 74143 | } | ||||
| 74144 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74144); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74144; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74145 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74146 | |||||
| 74147 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74148 | |||||
| 74149 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74150 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74151 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74152 | && !InitIds(cx, atomsCache)) || | ||||
| 74153 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyJSStringAttr_id, &rval)) { | ||||
| 74154 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74155 | return; | ||||
| 74156 | } | ||||
| 74157 | JS::Rooted<JSString*> rvalDecl(cx); | ||||
| 74158 | if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) { | ||||
| 74159 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74160 | return; | ||||
| 74161 | } | ||||
| 74162 | aRetVal.set(rvalDecl); | ||||
| 74163 | } | ||||
| 74164 | |||||
| 74165 | void | ||||
| 74166 | TestJSImplInterfaceJSImpl::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74167 | { | ||||
| 74168 | CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74169 | if (aRv.Failed()) { | ||||
| 74170 | return; | ||||
| 74171 | } | ||||
| 74172 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74172); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74172; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74173 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74174 | |||||
| 74175 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74176 | |||||
| 74177 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74178 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74179 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74180 | && !InitIds(cx, atomsCache)) || | ||||
| 74181 | !JS_GetPropertyById(cx, callback, atomsCache->jsStringAttr_id, &rval)) { | ||||
| 74182 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74183 | return; | ||||
| 74184 | } | ||||
| 74185 | JS::Rooted<JSString*> rvalDecl(cx); | ||||
| 74186 | if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) { | ||||
| 74187 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74188 | return; | ||||
| 74189 | } | ||||
| 74190 | aRetVal.set(rvalDecl); | ||||
| 74191 | } | ||||
| 74192 | |||||
| 74193 | MyTestEnum | ||||
| 74194 | TestJSImplInterfaceJSImpl::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74195 | { | ||||
| 74196 | CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74197 | if (aRv.Failed()) { | ||||
| 74198 | return MyTestEnum(0); | ||||
| 74199 | } | ||||
| 74200 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74200); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74200; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74201 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74202 | |||||
| 74203 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74204 | |||||
| 74205 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74206 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74207 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74208 | && !InitIds(cx, atomsCache)) || | ||||
| 74209 | !JS_GetPropertyById(cx, callback, atomsCache->enumAttribute_id, &rval)) { | ||||
| 74210 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74211 | return MyTestEnum(0); | ||||
| 74212 | } | ||||
| 74213 | MyTestEnum rvalDecl; | ||||
| 74214 | { | ||||
| 74215 | int index; | ||||
| 74216 | if (!binding_detail::FindEnumStringIndex<true>(cx, rval, | ||||
| 74217 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 74218 | "MyTestEnum", "return value of TestJSImplInterface.enumAttribute", | ||||
| 74219 | &index)) { | ||||
| 74220 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74221 | return MyTestEnum(0); | ||||
| 74222 | } | ||||
| 74223 | 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", 74223); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 74223; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74224 | rvalDecl = static_cast<MyTestEnum>(index); | ||||
| 74225 | } | ||||
| 74226 | return rvalDecl; | ||||
| 74227 | } | ||||
| 74228 | |||||
| 74229 | MyTestEnum | ||||
| 74230 | TestJSImplInterfaceJSImpl::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74231 | { | ||||
| 74232 | CallSetup s(this, aRv, "TestJSImplInterface.readonlyEnumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74233 | if (aRv.Failed()) { | ||||
| 74234 | return MyTestEnum(0); | ||||
| 74235 | } | ||||
| 74236 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74236); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74236; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74237 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74238 | |||||
| 74239 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74240 | |||||
| 74241 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74242 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74243 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74244 | && !InitIds(cx, atomsCache)) || | ||||
| 74245 | !JS_GetPropertyById(cx, callback, atomsCache->readonlyEnumAttribute_id, &rval)) { | ||||
| 74246 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74247 | return MyTestEnum(0); | ||||
| 74248 | } | ||||
| 74249 | MyTestEnum rvalDecl; | ||||
| 74250 | { | ||||
| 74251 | int index; | ||||
| 74252 | if (!binding_detail::FindEnumStringIndex<true>(cx, rval, | ||||
| 74253 | binding_detail::EnumStrings<MyTestEnum>::Values, | ||||
| 74254 | "MyTestEnum", "return value of TestJSImplInterface.readonlyEnumAttribute", | ||||
| 74255 | &index)) { | ||||
| 74256 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74257 | return MyTestEnum(0); | ||||
| 74258 | } | ||||
| 74259 | 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", 74259); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 74259; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74260 | rvalDecl = static_cast<MyTestEnum>(index); | ||||
| 74261 | } | ||||
| 74262 | return rvalDecl; | ||||
| 74263 | } | ||||
| 74264 | |||||
| 74265 | void | ||||
| 74266 | TestJSImplInterfaceJSImpl::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74267 | { | ||||
| 74268 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74269 | if (aRv.Failed()) { | ||||
| 74270 | return; | ||||
| 74271 | } | ||||
| 74272 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74272); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74272; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74273 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74274 | |||||
| 74275 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74276 | |||||
| 74277 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74278 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74279 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74280 | && !InitIds(cx, atomsCache)) || | ||||
| 74281 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnion_id, &rval)) { | ||||
| 74282 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74283 | return; | ||||
| 74284 | } | ||||
| 74285 | OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal); | ||||
| 74286 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnion", false)) { | ||||
| 74287 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74288 | return; | ||||
| 74289 | } | ||||
| 74290 | } | ||||
| 74291 | |||||
| 74292 | void | ||||
| 74293 | TestJSImplInterfaceJSImpl::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74294 | { | ||||
| 74295 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74296 | if (aRv.Failed()) { | ||||
| 74297 | return; | ||||
| 74298 | } | ||||
| 74299 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74299); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74299; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74300 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74301 | |||||
| 74302 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74303 | |||||
| 74304 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74305 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74306 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74307 | && !InitIds(cx, atomsCache)) || | ||||
| 74308 | !JS_GetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, &rval)) { | ||||
| 74309 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74310 | return; | ||||
| 74311 | } | ||||
| 74312 | OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal); | ||||
| 74313 | if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnionContainingNull", false)) { | ||||
| 74314 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74315 | return; | ||||
| 74316 | } | ||||
| 74317 | } | ||||
| 74318 | |||||
| 74319 | void | ||||
| 74320 | TestJSImplInterfaceJSImpl::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74321 | { | ||||
| 74322 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", 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 { *((volatile int *)__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->writableNullableUnion_id, &rval)) { | ||||
| 74336 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74337 | return; | ||||
| 74338 | } | ||||
| 74339 | Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal); | ||||
| 74340 | if (rval.isNullOrUndefined()) { | ||||
| 74341 | rvalDecl.SetNull(); | ||||
| 74342 | } else { | ||||
| 74343 | if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.writableNullableUnion", false)) { | ||||
| 74344 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74345 | return; | ||||
| 74346 | } | ||||
| 74347 | } | ||||
| 74348 | } | ||||
| 74349 | |||||
| 74350 | int8_t | ||||
| 74351 | TestJSImplInterfaceJSImpl::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74352 | { | ||||
| 74353 | CallSetup s(this, aRv, "TestJSImplInterface.attributeGetterRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74354 | if (aRv.Failed()) { | ||||
| 74355 | return int8_t(0); | ||||
| 74356 | } | ||||
| 74357 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74357); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74357; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74358 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74359 | |||||
| 74360 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74361 | |||||
| 74362 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74363 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74364 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74365 | && !InitIds(cx, atomsCache)) || | ||||
| 74366 | !JS_GetPropertyById(cx, callback, atomsCache->attributeGetterRenamedTo_id, &rval)) { | ||||
| 74367 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74368 | return int8_t(0); | ||||
| 74369 | } | ||||
| 74370 | int8_t rvalDecl; | ||||
| 74371 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeGetterRenamedFrom", &rvalDecl)) { | ||||
| 74372 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74373 | return int8_t(0); | ||||
| 74374 | } | ||||
| 74375 | return rvalDecl; | ||||
| 74376 | } | ||||
| 74377 | |||||
| 74378 | int8_t | ||||
| 74379 | TestJSImplInterfaceJSImpl::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74380 | { | ||||
| 74381 | CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74382 | if (aRv.Failed()) { | ||||
| 74383 | return int8_t(0); | ||||
| 74384 | } | ||||
| 74385 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74385); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74385; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74386 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74387 | |||||
| 74388 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74389 | |||||
| 74390 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74391 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74392 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74393 | && !InitIds(cx, atomsCache)) || | ||||
| 74394 | !JS_GetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, &rval)) { | ||||
| 74395 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74396 | return int8_t(0); | ||||
| 74397 | } | ||||
| 74398 | int8_t rvalDecl; | ||||
| 74399 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeRenamedFrom", &rvalDecl)) { | ||||
| 74400 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74401 | return int8_t(0); | ||||
| 74402 | } | ||||
| 74403 | return rvalDecl; | ||||
| 74404 | } | ||||
| 74405 | |||||
| 74406 | int8_t | ||||
| 74407 | TestJSImplInterfaceJSImpl::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74408 | { | ||||
| 74409 | CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74410 | if (aRv.Failed()) { | ||||
| 74411 | return int8_t(0); | ||||
| 74412 | } | ||||
| 74413 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74413); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74413; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74414 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74415 | |||||
| 74416 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74417 | |||||
| 74418 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74419 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74420 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74421 | && !InitIds(cx, atomsCache)) || | ||||
| 74422 | !JS_GetPropertyById(cx, callback, atomsCache->enforcedByte_id, &rval)) { | ||||
| 74423 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74424 | return int8_t(0); | ||||
| 74425 | } | ||||
| 74426 | int8_t rvalDecl; | ||||
| 74427 | if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, rval, "Return value of TestJSImplInterface.enforcedByte", &rvalDecl)) { | ||||
| 74428 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74429 | return int8_t(0); | ||||
| 74430 | } | ||||
| 74431 | return rvalDecl; | ||||
| 74432 | } | ||||
| 74433 | |||||
| 74434 | Nullable<int8_t> | ||||
| 74435 | TestJSImplInterfaceJSImpl::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74436 | { | ||||
| 74437 | CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74438 | if (aRv.Failed()) { | ||||
| 74439 | return Nullable<int8_t>(); | ||||
| 74440 | } | ||||
| 74441 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74441); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74441; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74442 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74443 | |||||
| 74444 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74445 | |||||
| 74446 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74447 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74448 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74449 | && !InitIds(cx, atomsCache)) || | ||||
| 74450 | !JS_GetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, &rval)) { | ||||
| 74451 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74452 | return Nullable<int8_t>(); | ||||
| 74453 | } | ||||
| 74454 | Nullable<int8_t> rvalDecl; | ||||
| 74455 | if (rval.isNullOrUndefined()) { | ||||
| 74456 | rvalDecl.SetNull(); | ||||
| 74457 | } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, rval, "Return value of TestJSImplInterface.enforcedByteNullable", &rvalDecl.SetValue())) { | ||||
| 74458 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74459 | return Nullable<int8_t>(); | ||||
| 74460 | } | ||||
| 74461 | return rvalDecl; | ||||
| 74462 | } | ||||
| 74463 | |||||
| 74464 | int8_t | ||||
| 74465 | TestJSImplInterfaceJSImpl::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74466 | { | ||||
| 74467 | CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74468 | if (aRv.Failed()) { | ||||
| 74469 | return int8_t(0); | ||||
| 74470 | } | ||||
| 74471 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74471); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74471; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74472 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74473 | |||||
| 74474 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74475 | |||||
| 74476 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74477 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74478 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74479 | && !InitIds(cx, atomsCache)) || | ||||
| 74480 | !JS_GetPropertyById(cx, callback, atomsCache->clampedByte_id, &rval)) { | ||||
| 74481 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74482 | return int8_t(0); | ||||
| 74483 | } | ||||
| 74484 | int8_t rvalDecl; | ||||
| 74485 | if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByte", &rvalDecl)) { | ||||
| 74486 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74487 | return int8_t(0); | ||||
| 74488 | } | ||||
| 74489 | return rvalDecl; | ||||
| 74490 | } | ||||
| 74491 | |||||
| 74492 | Nullable<int8_t> | ||||
| 74493 | TestJSImplInterfaceJSImpl::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74494 | { | ||||
| 74495 | CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74496 | if (aRv.Failed()) { | ||||
| 74497 | return Nullable<int8_t>(); | ||||
| 74498 | } | ||||
| 74499 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74499); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74499; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74500 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74501 | |||||
| 74502 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74503 | |||||
| 74504 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74505 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74506 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74507 | && !InitIds(cx, atomsCache)) || | ||||
| 74508 | !JS_GetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, &rval)) { | ||||
| 74509 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74510 | return Nullable<int8_t>(); | ||||
| 74511 | } | ||||
| 74512 | Nullable<int8_t> rvalDecl; | ||||
| 74513 | if (rval.isNullOrUndefined()) { | ||||
| 74514 | rvalDecl.SetNull(); | ||||
| 74515 | } else if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByteNullable", &rvalDecl.SetValue())) { | ||||
| 74516 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74517 | return Nullable<int8_t>(); | ||||
| 74518 | } | ||||
| 74519 | return rvalDecl; | ||||
| 74520 | } | ||||
| 74521 | |||||
| 74522 | int8_t | ||||
| 74523 | TestJSImplInterfaceJSImpl::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74524 | { | ||||
| 74525 | CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74526 | if (aRv.Failed()) { | ||||
| 74527 | return int8_t(0); | ||||
| 74528 | } | ||||
| 74529 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74529); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74529; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74530 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74531 | |||||
| 74532 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74533 | |||||
| 74534 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74535 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74536 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74537 | && !InitIds(cx, atomsCache)) || | ||||
| 74538 | !JS_GetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, &rval)) { | ||||
| 74539 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74540 | return int8_t(0); | ||||
| 74541 | } | ||||
| 74542 | int8_t rvalDecl; | ||||
| 74543 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedAttribute", &rvalDecl)) { | ||||
| 74544 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74545 | return int8_t(0); | ||||
| 74546 | } | ||||
| 74547 | return rvalDecl; | ||||
| 74548 | } | ||||
| 74549 | |||||
| 74550 | bool | ||||
| 74551 | TestJSImplInterfaceJSImpl::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74552 | { | ||||
| 74553 | CallSetup s(this, aRv, "TestJSImplInterface.prefable1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74554 | if (aRv.Failed()) { | ||||
| 74555 | return bool(0); | ||||
| 74556 | } | ||||
| 74557 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74557); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74557; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74558 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74559 | |||||
| 74560 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74561 | |||||
| 74562 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74563 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74564 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74565 | && !InitIds(cx, atomsCache)) || | ||||
| 74566 | !JS_GetPropertyById(cx, callback, atomsCache->prefable1_id, &rval)) { | ||||
| 74567 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74568 | return bool(0); | ||||
| 74569 | } | ||||
| 74570 | bool rvalDecl; | ||||
| 74571 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable1", &rvalDecl)) { | ||||
| 74572 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74573 | return bool(0); | ||||
| 74574 | } | ||||
| 74575 | return rvalDecl; | ||||
| 74576 | } | ||||
| 74577 | |||||
| 74578 | bool | ||||
| 74579 | TestJSImplInterfaceJSImpl::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74580 | { | ||||
| 74581 | CallSetup s(this, aRv, "TestJSImplInterface.prefable2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74582 | if (aRv.Failed()) { | ||||
| 74583 | return bool(0); | ||||
| 74584 | } | ||||
| 74585 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74585); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74585; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74586 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74587 | |||||
| 74588 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74589 | |||||
| 74590 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74591 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74592 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74593 | && !InitIds(cx, atomsCache)) || | ||||
| 74594 | !JS_GetPropertyById(cx, callback, atomsCache->prefable2_id, &rval)) { | ||||
| 74595 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74596 | return bool(0); | ||||
| 74597 | } | ||||
| 74598 | bool rvalDecl; | ||||
| 74599 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable2", &rvalDecl)) { | ||||
| 74600 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74601 | return bool(0); | ||||
| 74602 | } | ||||
| 74603 | return rvalDecl; | ||||
| 74604 | } | ||||
| 74605 | |||||
| 74606 | bool | ||||
| 74607 | TestJSImplInterfaceJSImpl::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74608 | { | ||||
| 74609 | CallSetup s(this, aRv, "TestJSImplInterface.prefable3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74610 | if (aRv.Failed()) { | ||||
| 74611 | return bool(0); | ||||
| 74612 | } | ||||
| 74613 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74613); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74613; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74614 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74615 | |||||
| 74616 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74617 | |||||
| 74618 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74619 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74620 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74621 | && !InitIds(cx, atomsCache)) || | ||||
| 74622 | !JS_GetPropertyById(cx, callback, atomsCache->prefable3_id, &rval)) { | ||||
| 74623 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74624 | return bool(0); | ||||
| 74625 | } | ||||
| 74626 | bool rvalDecl; | ||||
| 74627 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable3", &rvalDecl)) { | ||||
| 74628 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74629 | return bool(0); | ||||
| 74630 | } | ||||
| 74631 | return rvalDecl; | ||||
| 74632 | } | ||||
| 74633 | |||||
| 74634 | bool | ||||
| 74635 | TestJSImplInterfaceJSImpl::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74636 | { | ||||
| 74637 | CallSetup s(this, aRv, "TestJSImplInterface.prefable4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74638 | if (aRv.Failed()) { | ||||
| 74639 | return bool(0); | ||||
| 74640 | } | ||||
| 74641 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74641); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74641; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74642 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74643 | |||||
| 74644 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74645 | |||||
| 74646 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74647 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74648 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74649 | && !InitIds(cx, atomsCache)) || | ||||
| 74650 | !JS_GetPropertyById(cx, callback, atomsCache->prefable4_id, &rval)) { | ||||
| 74651 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74652 | return bool(0); | ||||
| 74653 | } | ||||
| 74654 | bool rvalDecl; | ||||
| 74655 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable4", &rvalDecl)) { | ||||
| 74656 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74657 | return bool(0); | ||||
| 74658 | } | ||||
| 74659 | return rvalDecl; | ||||
| 74660 | } | ||||
| 74661 | |||||
| 74662 | bool | ||||
| 74663 | TestJSImplInterfaceJSImpl::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74664 | { | ||||
| 74665 | CallSetup s(this, aRv, "TestJSImplInterface.prefable5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74666 | if (aRv.Failed()) { | ||||
| 74667 | return bool(0); | ||||
| 74668 | } | ||||
| 74669 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74669); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74669; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74670 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74671 | |||||
| 74672 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74673 | |||||
| 74674 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74675 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74676 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74677 | && !InitIds(cx, atomsCache)) || | ||||
| 74678 | !JS_GetPropertyById(cx, callback, atomsCache->prefable5_id, &rval)) { | ||||
| 74679 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74680 | return bool(0); | ||||
| 74681 | } | ||||
| 74682 | bool rvalDecl; | ||||
| 74683 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable5", &rvalDecl)) { | ||||
| 74684 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74685 | return bool(0); | ||||
| 74686 | } | ||||
| 74687 | return rvalDecl; | ||||
| 74688 | } | ||||
| 74689 | |||||
| 74690 | bool | ||||
| 74691 | TestJSImplInterfaceJSImpl::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74692 | { | ||||
| 74693 | CallSetup s(this, aRv, "TestJSImplInterface.prefable6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74694 | if (aRv.Failed()) { | ||||
| 74695 | return bool(0); | ||||
| 74696 | } | ||||
| 74697 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74697); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74697; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74698 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74699 | |||||
| 74700 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74701 | |||||
| 74702 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74703 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74704 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74705 | && !InitIds(cx, atomsCache)) || | ||||
| 74706 | !JS_GetPropertyById(cx, callback, atomsCache->prefable6_id, &rval)) { | ||||
| 74707 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74708 | return bool(0); | ||||
| 74709 | } | ||||
| 74710 | bool rvalDecl; | ||||
| 74711 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable6", &rvalDecl)) { | ||||
| 74712 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74713 | return bool(0); | ||||
| 74714 | } | ||||
| 74715 | return rvalDecl; | ||||
| 74716 | } | ||||
| 74717 | |||||
| 74718 | bool | ||||
| 74719 | TestJSImplInterfaceJSImpl::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74720 | { | ||||
| 74721 | CallSetup s(this, aRv, "TestJSImplInterface.prefable7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74722 | if (aRv.Failed()) { | ||||
| 74723 | return bool(0); | ||||
| 74724 | } | ||||
| 74725 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74725); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74725; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74726 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74727 | |||||
| 74728 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74729 | |||||
| 74730 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74731 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74732 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74733 | && !InitIds(cx, atomsCache)) || | ||||
| 74734 | !JS_GetPropertyById(cx, callback, atomsCache->prefable7_id, &rval)) { | ||||
| 74735 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74736 | return bool(0); | ||||
| 74737 | } | ||||
| 74738 | bool rvalDecl; | ||||
| 74739 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable7", &rvalDecl)) { | ||||
| 74740 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74741 | return bool(0); | ||||
| 74742 | } | ||||
| 74743 | return rvalDecl; | ||||
| 74744 | } | ||||
| 74745 | |||||
| 74746 | bool | ||||
| 74747 | TestJSImplInterfaceJSImpl::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74748 | { | ||||
| 74749 | CallSetup s(this, aRv, "TestJSImplInterface.prefable8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74750 | if (aRv.Failed()) { | ||||
| 74751 | return bool(0); | ||||
| 74752 | } | ||||
| 74753 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74753); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74753; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74754 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74755 | |||||
| 74756 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74757 | |||||
| 74758 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74759 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74760 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74761 | && !InitIds(cx, atomsCache)) || | ||||
| 74762 | !JS_GetPropertyById(cx, callback, atomsCache->prefable8_id, &rval)) { | ||||
| 74763 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74764 | return bool(0); | ||||
| 74765 | } | ||||
| 74766 | bool rvalDecl; | ||||
| 74767 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable8", &rvalDecl)) { | ||||
| 74768 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74769 | return bool(0); | ||||
| 74770 | } | ||||
| 74771 | return rvalDecl; | ||||
| 74772 | } | ||||
| 74773 | |||||
| 74774 | bool | ||||
| 74775 | TestJSImplInterfaceJSImpl::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74776 | { | ||||
| 74777 | CallSetup s(this, aRv, "TestJSImplInterface.prefable9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74778 | if (aRv.Failed()) { | ||||
| 74779 | return bool(0); | ||||
| 74780 | } | ||||
| 74781 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74781); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74781; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74782 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74783 | |||||
| 74784 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74785 | |||||
| 74786 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74787 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74788 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74789 | && !InitIds(cx, atomsCache)) || | ||||
| 74790 | !JS_GetPropertyById(cx, callback, atomsCache->prefable9_id, &rval)) { | ||||
| 74791 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74792 | return bool(0); | ||||
| 74793 | } | ||||
| 74794 | bool rvalDecl; | ||||
| 74795 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable9", &rvalDecl)) { | ||||
| 74796 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74797 | return bool(0); | ||||
| 74798 | } | ||||
| 74799 | return rvalDecl; | ||||
| 74800 | } | ||||
| 74801 | |||||
| 74802 | bool | ||||
| 74803 | TestJSImplInterfaceJSImpl::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74804 | { | ||||
| 74805 | CallSetup s(this, aRv, "TestJSImplInterface.prefable12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74806 | if (aRv.Failed()) { | ||||
| 74807 | return bool(0); | ||||
| 74808 | } | ||||
| 74809 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74809); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74809; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74810 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74811 | |||||
| 74812 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74813 | |||||
| 74814 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74815 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74816 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74817 | && !InitIds(cx, atomsCache)) || | ||||
| 74818 | !JS_GetPropertyById(cx, callback, atomsCache->prefable12_id, &rval)) { | ||||
| 74819 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74820 | return bool(0); | ||||
| 74821 | } | ||||
| 74822 | bool rvalDecl; | ||||
| 74823 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable12", &rvalDecl)) { | ||||
| 74824 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74825 | return bool(0); | ||||
| 74826 | } | ||||
| 74827 | return rvalDecl; | ||||
| 74828 | } | ||||
| 74829 | |||||
| 74830 | bool | ||||
| 74831 | TestJSImplInterfaceJSImpl::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74832 | { | ||||
| 74833 | CallSetup s(this, aRv, "TestJSImplInterface.prefable14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74834 | if (aRv.Failed()) { | ||||
| 74835 | return bool(0); | ||||
| 74836 | } | ||||
| 74837 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74837); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74837; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74838 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74839 | |||||
| 74840 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74841 | |||||
| 74842 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74843 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74844 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74845 | && !InitIds(cx, atomsCache)) || | ||||
| 74846 | !JS_GetPropertyById(cx, callback, atomsCache->prefable14_id, &rval)) { | ||||
| 74847 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74848 | return bool(0); | ||||
| 74849 | } | ||||
| 74850 | bool rvalDecl; | ||||
| 74851 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable14", &rvalDecl)) { | ||||
| 74852 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74853 | return bool(0); | ||||
| 74854 | } | ||||
| 74855 | return rvalDecl; | ||||
| 74856 | } | ||||
| 74857 | |||||
| 74858 | bool | ||||
| 74859 | TestJSImplInterfaceJSImpl::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74860 | { | ||||
| 74861 | CallSetup s(this, aRv, "TestJSImplInterface.prefable15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74862 | if (aRv.Failed()) { | ||||
| 74863 | return bool(0); | ||||
| 74864 | } | ||||
| 74865 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74865); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74865; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74866 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74867 | |||||
| 74868 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74869 | |||||
| 74870 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74871 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74872 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74873 | && !InitIds(cx, atomsCache)) || | ||||
| 74874 | !JS_GetPropertyById(cx, callback, atomsCache->prefable15_id, &rval)) { | ||||
| 74875 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74876 | return bool(0); | ||||
| 74877 | } | ||||
| 74878 | bool rvalDecl; | ||||
| 74879 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable15", &rvalDecl)) { | ||||
| 74880 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74881 | return bool(0); | ||||
| 74882 | } | ||||
| 74883 | return rvalDecl; | ||||
| 74884 | } | ||||
| 74885 | |||||
| 74886 | bool | ||||
| 74887 | TestJSImplInterfaceJSImpl::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74888 | { | ||||
| 74889 | CallSetup s(this, aRv, "TestJSImplInterface.prefable16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74890 | if (aRv.Failed()) { | ||||
| 74891 | return bool(0); | ||||
| 74892 | } | ||||
| 74893 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74893); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74893; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74894 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74895 | |||||
| 74896 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74897 | |||||
| 74898 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74899 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74900 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74901 | && !InitIds(cx, atomsCache)) || | ||||
| 74902 | !JS_GetPropertyById(cx, callback, atomsCache->prefable16_id, &rval)) { | ||||
| 74903 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74904 | return bool(0); | ||||
| 74905 | } | ||||
| 74906 | bool rvalDecl; | ||||
| 74907 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable16", &rvalDecl)) { | ||||
| 74908 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74909 | return bool(0); | ||||
| 74910 | } | ||||
| 74911 | return rvalDecl; | ||||
| 74912 | } | ||||
| 74913 | |||||
| 74914 | bool | ||||
| 74915 | TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74916 | { | ||||
| 74917 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74918 | if (aRv.Failed()) { | ||||
| 74919 | return bool(0); | ||||
| 74920 | } | ||||
| 74921 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74921); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74921; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74922 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74923 | |||||
| 74924 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74925 | |||||
| 74926 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74927 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74928 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74929 | && !InitIds(cx, atomsCache)) || | ||||
| 74930 | !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext1_id, &rval)) { | ||||
| 74931 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74932 | return bool(0); | ||||
| 74933 | } | ||||
| 74934 | bool rvalDecl; | ||||
| 74935 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext1", &rvalDecl)) { | ||||
| 74936 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74937 | return bool(0); | ||||
| 74938 | } | ||||
| 74939 | return rvalDecl; | ||||
| 74940 | } | ||||
| 74941 | |||||
| 74942 | bool | ||||
| 74943 | TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74944 | { | ||||
| 74945 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74946 | if (aRv.Failed()) { | ||||
| 74947 | return bool(0); | ||||
| 74948 | } | ||||
| 74949 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74949); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74949; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74950 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74951 | |||||
| 74952 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74953 | |||||
| 74954 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74955 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74956 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74957 | && !InitIds(cx, atomsCache)) || | ||||
| 74958 | !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext2_id, &rval)) { | ||||
| 74959 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74960 | return bool(0); | ||||
| 74961 | } | ||||
| 74962 | bool rvalDecl; | ||||
| 74963 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext2", &rvalDecl)) { | ||||
| 74964 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74965 | return bool(0); | ||||
| 74966 | } | ||||
| 74967 | return rvalDecl; | ||||
| 74968 | } | ||||
| 74969 | |||||
| 74970 | bool | ||||
| 74971 | TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 74972 | { | ||||
| 74973 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 74974 | if (aRv.Failed()) { | ||||
| 74975 | return bool(0); | ||||
| 74976 | } | ||||
| 74977 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 74977); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 74977; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 74978 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 74979 | |||||
| 74980 | JS::Rooted<JS::Value> rval(cx); | ||||
| 74981 | |||||
| 74982 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 74983 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 74984 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 74985 | && !InitIds(cx, atomsCache)) || | ||||
| 74986 | !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext3_id, &rval)) { | ||||
| 74987 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74988 | return bool(0); | ||||
| 74989 | } | ||||
| 74990 | bool rvalDecl; | ||||
| 74991 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext3", &rvalDecl)) { | ||||
| 74992 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 74993 | return bool(0); | ||||
| 74994 | } | ||||
| 74995 | return rvalDecl; | ||||
| 74996 | } | ||||
| 74997 | |||||
| 74998 | bool | ||||
| 74999 | TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75000 | { | ||||
| 75001 | CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75002 | if (aRv.Failed()) { | ||||
| 75003 | return bool(0); | ||||
| 75004 | } | ||||
| 75005 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75005); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75005; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75006 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75007 | |||||
| 75008 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75009 | |||||
| 75010 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75011 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75012 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75013 | && !InitIds(cx, atomsCache)) || | ||||
| 75014 | !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext4_id, &rval)) { | ||||
| 75015 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75016 | return bool(0); | ||||
| 75017 | } | ||||
| 75018 | bool rvalDecl; | ||||
| 75019 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext4", &rvalDecl)) { | ||||
| 75020 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75021 | return bool(0); | ||||
| 75022 | } | ||||
| 75023 | return rvalDecl; | ||||
| 75024 | } | ||||
| 75025 | |||||
| 75026 | int32_t | ||||
| 75027 | TestJSImplInterfaceJSImpl::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75028 | { | ||||
| 75029 | CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75030 | if (aRv.Failed()) { | ||||
| 75031 | return int32_t(0); | ||||
| 75032 | } | ||||
| 75033 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75033); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75033; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75034 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75035 | |||||
| 75036 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75037 | |||||
| 75038 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75039 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75040 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75041 | && !InitIds(cx, atomsCache)) || | ||||
| 75042 | !JS_GetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, &rval)) { | ||||
| 75043 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75044 | return int32_t(0); | ||||
| 75045 | } | ||||
| 75046 | int32_t rvalDecl; | ||||
| 75047 | if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attrWithLenientThis", &rvalDecl)) { | ||||
| 75048 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75049 | return int32_t(0); | ||||
| 75050 | } | ||||
| 75051 | return rvalDecl; | ||||
| 75052 | } | ||||
| 75053 | |||||
| 75054 | already_AddRefed<TestJSImplInterface> | ||||
| 75055 | TestJSImplInterfaceJSImpl::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75056 | { | ||||
| 75057 | CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75058 | if (aRv.Failed()) { | ||||
| 75059 | return nullptr; | ||||
| 75060 | } | ||||
| 75061 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75061; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75062 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75063 | |||||
| 75064 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75065 | |||||
| 75066 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75067 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75068 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75069 | && !InitIds(cx, atomsCache)) || | ||||
| 75070 | !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr_id, &rval)) { | ||||
| 75071 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75072 | return nullptr; | ||||
| 75073 | } | ||||
| 75074 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 75075 | if (rval.isObject()) { | ||||
| 75076 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 75077 | { | ||||
| 75078 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 75079 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 75080 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 75081 | // Be careful to not wrap random DOM objects here, even if | ||||
| 75082 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 75083 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 75084 | // that already has a content reflection... | ||||
| 75085 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 75086 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 75087 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 75088 | if (!callback || | ||||
| 75089 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 75090 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75091 | return nullptr; | ||||
| 75092 | } | ||||
| 75093 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 75094 | 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", 75095); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75095; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 75095 | "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", 75095); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75095; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 75096 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 75097 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 75098 | } else { | ||||
| 75099 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr", "TestJSImplInterface"); | ||||
| 75100 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75101 | return nullptr; | ||||
| 75102 | } | ||||
| 75103 | } | ||||
| 75104 | } | ||||
| 75105 | } else { | ||||
| 75106 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr"); | ||||
| 75107 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75108 | return nullptr; | ||||
| 75109 | } | ||||
| 75110 | return rvalDecl.forget(); | ||||
| 75111 | } | ||||
| 75112 | |||||
| 75113 | already_AddRefed<TestJSImplInterface> | ||||
| 75114 | TestJSImplInterfaceJSImpl::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75115 | { | ||||
| 75116 | CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75117 | if (aRv.Failed()) { | ||||
| 75118 | return nullptr; | ||||
| 75119 | } | ||||
| 75120 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75120); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75120; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75121 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75122 | |||||
| 75123 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75124 | |||||
| 75125 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75126 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75127 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75128 | && !InitIds(cx, atomsCache)) || | ||||
| 75129 | !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr2_id, &rval)) { | ||||
| 75130 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75131 | return nullptr; | ||||
| 75132 | } | ||||
| 75133 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 75134 | if (rval.isObject()) { | ||||
| 75135 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 75136 | { | ||||
| 75137 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 75138 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 75139 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 75140 | // Be careful to not wrap random DOM objects here, even if | ||||
| 75141 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 75142 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 75143 | // that already has a content reflection... | ||||
| 75144 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 75145 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 75146 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 75147 | if (!callback || | ||||
| 75148 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 75149 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75150 | return nullptr; | ||||
| 75151 | } | ||||
| 75152 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 75153 | 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", 75154); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75154; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 75154 | "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", 75154); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75154; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 75155 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 75156 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 75157 | } else { | ||||
| 75158 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr2", "TestJSImplInterface"); | ||||
| 75159 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75160 | return nullptr; | ||||
| 75161 | } | ||||
| 75162 | } | ||||
| 75163 | } | ||||
| 75164 | } else { | ||||
| 75165 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr2"); | ||||
| 75166 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75167 | return nullptr; | ||||
| 75168 | } | ||||
| 75169 | return rvalDecl.forget(); | ||||
| 75170 | } | ||||
| 75171 | |||||
| 75172 | already_AddRefed<TestJSImplInterface> | ||||
| 75173 | TestJSImplInterfaceJSImpl::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75174 | { | ||||
| 75175 | CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75176 | if (aRv.Failed()) { | ||||
| 75177 | return nullptr; | ||||
| 75178 | } | ||||
| 75179 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75179); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75179; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75180 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75181 | |||||
| 75182 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75183 | |||||
| 75184 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75185 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75186 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75187 | && !InitIds(cx, atomsCache)) || | ||||
| 75188 | !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr3_id, &rval)) { | ||||
| 75189 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75190 | return nullptr; | ||||
| 75191 | } | ||||
| 75192 | RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl; | ||||
| 75193 | if (rval.isObject()) { | ||||
| 75194 | static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes."); | ||||
| 75195 | { | ||||
| 75196 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 75197 | nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx); | ||||
| 75198 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 75199 | // Be careful to not wrap random DOM objects here, even if | ||||
| 75200 | // they're wrapped in opaque security wrappers for some reason. | ||||
| 75201 | // XXXbz Wish we could check for a JS-implemented object | ||||
| 75202 | // that already has a content reflection... | ||||
| 75203 | if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) { | ||||
| 75204 | nsCOMPtr<nsIGlobalObject> contentGlobal; | ||||
| 75205 | JS::Rooted<JSObject*> callback(cx, CallbackOrNull()); | ||||
| 75206 | if (!callback || | ||||
| 75207 | !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) { | ||||
| 75208 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75209 | return nullptr; | ||||
| 75210 | } | ||||
| 75211 | JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject()); | ||||
| 75212 | 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", 75213); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75213; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | ||||
| 75213 | "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", 75213); AnnotateMozCrashReason ("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") (" "Don't return JS implementations from other compartments" ")" ); do { *((volatile int*)__null) = 75213; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | ||||
| 75214 | JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj)); | ||||
| 75215 | rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal); | ||||
| 75216 | } else { | ||||
| 75217 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr3", "TestJSImplInterface"); | ||||
| 75218 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75219 | return nullptr; | ||||
| 75220 | } | ||||
| 75221 | } | ||||
| 75222 | } | ||||
| 75223 | } else { | ||||
| 75224 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr3"); | ||||
| 75225 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75226 | return nullptr; | ||||
| 75227 | } | ||||
| 75228 | return rvalDecl.forget(); | ||||
| 75229 | } | ||||
| 75230 | |||||
| 75231 | bool | ||||
| 75232 | TestJSImplInterfaceJSImpl::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75233 | { | ||||
| 75234 | CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75235 | if (aRv.Failed()) { | ||||
| 75236 | return bool(0); | ||||
| 75237 | } | ||||
| 75238 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75238); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75238; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75239 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75240 | |||||
| 75241 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75242 | |||||
| 75243 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75244 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75245 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75246 | && !InitIds(cx, atomsCache)) || | ||||
| 75247 | !JS_GetPropertyById(cx, callback, atomsCache->throwingAttr_id, &rval)) { | ||||
| 75248 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75249 | return bool(0); | ||||
| 75250 | } | ||||
| 75251 | bool rvalDecl; | ||||
| 75252 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingAttr", &rvalDecl)) { | ||||
| 75253 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75254 | return bool(0); | ||||
| 75255 | } | ||||
| 75256 | return rvalDecl; | ||||
| 75257 | } | ||||
| 75258 | |||||
| 75259 | bool | ||||
| 75260 | TestJSImplInterfaceJSImpl::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75261 | { | ||||
| 75262 | CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75263 | if (aRv.Failed()) { | ||||
| 75264 | return bool(0); | ||||
| 75265 | } | ||||
| 75266 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75266); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75266; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75267 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75268 | |||||
| 75269 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75270 | |||||
| 75271 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75272 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75273 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75274 | && !InitIds(cx, atomsCache)) || | ||||
| 75275 | !JS_GetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, &rval)) { | ||||
| 75276 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75277 | return bool(0); | ||||
| 75278 | } | ||||
| 75279 | bool rvalDecl; | ||||
| 75280 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingGetterAttr", &rvalDecl)) { | ||||
| 75281 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75282 | return bool(0); | ||||
| 75283 | } | ||||
| 75284 | return rvalDecl; | ||||
| 75285 | } | ||||
| 75286 | |||||
| 75287 | bool | ||||
| 75288 | TestJSImplInterfaceJSImpl::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75289 | { | ||||
| 75290 | CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75291 | if (aRv.Failed()) { | ||||
| 75292 | return bool(0); | ||||
| 75293 | } | ||||
| 75294 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75294); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75294; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75295 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75296 | |||||
| 75297 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75298 | |||||
| 75299 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75300 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75301 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75302 | && !InitIds(cx, atomsCache)) || | ||||
| 75303 | !JS_GetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, &rval)) { | ||||
| 75304 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75305 | return bool(0); | ||||
| 75306 | } | ||||
| 75307 | bool rvalDecl; | ||||
| 75308 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingSetterAttr", &rvalDecl)) { | ||||
| 75309 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75310 | return bool(0); | ||||
| 75311 | } | ||||
| 75312 | return rvalDecl; | ||||
| 75313 | } | ||||
| 75314 | |||||
| 75315 | bool | ||||
| 75316 | TestJSImplInterfaceJSImpl::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75317 | { | ||||
| 75318 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75319 | if (aRv.Failed()) { | ||||
| 75320 | return bool(0); | ||||
| 75321 | } | ||||
| 75322 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75322); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75322; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75323 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75324 | |||||
| 75325 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75326 | |||||
| 75327 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75328 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75329 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75330 | && !InitIds(cx, atomsCache)) || | ||||
| 75331 | !JS_GetPropertyById(cx, callback, atomsCache->canOOMAttr_id, &rval)) { | ||||
| 75332 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75333 | return bool(0); | ||||
| 75334 | } | ||||
| 75335 | bool rvalDecl; | ||||
| 75336 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMAttr", &rvalDecl)) { | ||||
| 75337 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75338 | return bool(0); | ||||
| 75339 | } | ||||
| 75340 | return rvalDecl; | ||||
| 75341 | } | ||||
| 75342 | |||||
| 75343 | bool | ||||
| 75344 | TestJSImplInterfaceJSImpl::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75345 | { | ||||
| 75346 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75347 | if (aRv.Failed()) { | ||||
| 75348 | return bool(0); | ||||
| 75349 | } | ||||
| 75350 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75350); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75350; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75351 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75352 | |||||
| 75353 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75354 | |||||
| 75355 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75356 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75357 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75358 | && !InitIds(cx, atomsCache)) || | ||||
| 75359 | !JS_GetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, &rval)) { | ||||
| 75360 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75361 | return bool(0); | ||||
| 75362 | } | ||||
| 75363 | bool rvalDecl; | ||||
| 75364 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMGetterAttr", &rvalDecl)) { | ||||
| 75365 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75366 | return bool(0); | ||||
| 75367 | } | ||||
| 75368 | return rvalDecl; | ||||
| 75369 | } | ||||
| 75370 | |||||
| 75371 | bool | ||||
| 75372 | TestJSImplInterfaceJSImpl::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75373 | { | ||||
| 75374 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75375 | if (aRv.Failed()) { | ||||
| 75376 | return bool(0); | ||||
| 75377 | } | ||||
| 75378 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75378; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75379 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75380 | |||||
| 75381 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75382 | |||||
| 75383 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75384 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75385 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75386 | && !InitIds(cx, atomsCache)) || | ||||
| 75387 | !JS_GetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, &rval)) { | ||||
| 75388 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75389 | return bool(0); | ||||
| 75390 | } | ||||
| 75391 | bool rvalDecl; | ||||
| 75392 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMSetterAttr", &rvalDecl)) { | ||||
| 75393 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75394 | return bool(0); | ||||
| 75395 | } | ||||
| 75396 | return rvalDecl; | ||||
| 75397 | } | ||||
| 75398 | |||||
| 75399 | bool | ||||
| 75400 | TestJSImplInterfaceJSImpl::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75401 | { | ||||
| 75402 | CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75403 | if (aRv.Failed()) { | ||||
| 75404 | return bool(0); | ||||
| 75405 | } | ||||
| 75406 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75406; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75407 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75408 | |||||
| 75409 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75410 | |||||
| 75411 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75412 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75413 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75414 | && !InitIds(cx, atomsCache)) || | ||||
| 75415 | !JS_GetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, &rval)) { | ||||
| 75416 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75417 | return bool(0); | ||||
| 75418 | } | ||||
| 75419 | bool rvalDecl; | ||||
| 75420 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.ceReactionsAttr", &rvalDecl)) { | ||||
| 75421 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75422 | return bool(0); | ||||
| 75423 | } | ||||
| 75424 | return rvalDecl; | ||||
| 75425 | } | ||||
| 75426 | |||||
| 75427 | void | ||||
| 75428 | TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75429 | { | ||||
| 75430 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75431 | if (aRv.Failed()) { | ||||
| 75432 | return; | ||||
| 75433 | } | ||||
| 75434 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75434); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75434; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75435 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75436 | |||||
| 75437 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75438 | |||||
| 75439 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75440 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75441 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75442 | && !InitIds(cx, atomsCache)) || | ||||
| 75443 | !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, &rval)) { | ||||
| 75444 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75445 | return; | ||||
| 75446 | } | ||||
| 75447 | JS::Rooted<JS::Value> rvalDecl(cx); | ||||
| 75448 | #ifdef __clang__1 | ||||
| 75449 | #pragma clang diagnostic push | ||||
| 75450 | #pragma clang diagnostic ignored "-Wunreachable-code" | ||||
| 75451 | #pragma clang diagnostic ignored "-Wunreachable-code-return" | ||||
| 75452 | #endif // __clang__ | ||||
| 75453 | if ((false) && !CallerSubsumes(rval)) { | ||||
| 75454 | cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSONShouldSkipThis"); | ||||
| 75455 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75456 | return; | ||||
| 75457 | } | ||||
| 75458 | #ifdef __clang__1 | ||||
| 75459 | #pragma clang diagnostic pop | ||||
| 75460 | #endif // __clang__ | ||||
| 75461 | rvalDecl = rval; | ||||
| 75462 | aRetVal.set(rvalDecl); | ||||
| 75463 | } | ||||
| 75464 | |||||
| 75465 | already_AddRefed<TestParentInterface> | ||||
| 75466 | TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75467 | { | ||||
| 75468 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75469 | if (aRv.Failed()) { | ||||
| 75470 | return nullptr; | ||||
| 75471 | } | ||||
| 75472 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75472); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75472; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75473 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75474 | |||||
| 75475 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75476 | |||||
| 75477 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75478 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75479 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75480 | && !InitIds(cx, atomsCache)) || | ||||
| 75481 | !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, &rval)) { | ||||
| 75482 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75483 | return nullptr; | ||||
| 75484 | } | ||||
| 75485 | RefPtr<mozilla::dom::TestParentInterface> rvalDecl; | ||||
| 75486 | if (rval.isObject()) { | ||||
| 75487 | static_assert(IsRefcounted<mozilla::dom::TestParentInterface>::value, "We can only store refcounted classes."); | ||||
| 75488 | { | ||||
| 75489 | // Our JSContext should be in the right global to do unwrapping in. | ||||
| 75490 | nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(rval, rvalDecl, cx); | ||||
| 75491 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | ||||
| 75492 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.toJSONShouldSkipThis2", "TestParentInterface"); | ||||
| 75493 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75494 | return nullptr; | ||||
| 75495 | } | ||||
| 75496 | } | ||||
| 75497 | } else { | ||||
| 75498 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis2"); | ||||
| 75499 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75500 | return nullptr; | ||||
| 75501 | } | ||||
| 75502 | return rvalDecl.forget(); | ||||
| 75503 | } | ||||
| 75504 | |||||
| 75505 | already_AddRefed<TestCallbackInterface> | ||||
| 75506 | TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75507 | { | ||||
| 75508 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75509 | if (aRv.Failed()) { | ||||
| 75510 | return nullptr; | ||||
| 75511 | } | ||||
| 75512 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75512); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75512; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75513 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75514 | |||||
| 75515 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75516 | |||||
| 75517 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75518 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75519 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75520 | && !InitIds(cx, atomsCache)) || | ||||
| 75521 | !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, &rval)) { | ||||
| 75522 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75523 | return nullptr; | ||||
| 75524 | } | ||||
| 75525 | RefPtr<TestCallbackInterface> rvalDecl; | ||||
| 75526 | if (rval.isObject()) { | ||||
| 75527 | { // scope for tempRoot and tempGlobalRoot if needed | ||||
| 75528 | JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject()); | ||||
| 75529 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 75530 | rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | ||||
| 75531 | } | ||||
| 75532 | } else { | ||||
| 75533 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis3"); | ||||
| 75534 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75535 | return nullptr; | ||||
| 75536 | } | ||||
| 75537 | return rvalDecl.forget(); | ||||
| 75538 | } | ||||
| 75539 | |||||
| 75540 | int8_t | ||||
| 75541 | TestJSImplInterfaceJSImpl::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75542 | { | ||||
| 75543 | CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75544 | if (aRv.Failed()) { | ||||
| 75545 | return int8_t(0); | ||||
| 75546 | } | ||||
| 75547 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75547); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75547; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75548 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75549 | |||||
| 75550 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75551 | |||||
| 75552 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75553 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75554 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75555 | && !InitIds(cx, atomsCache)) || | ||||
| 75556 | !JS_GetPropertyById(cx, callback, atomsCache->dashed_attribute_id, &rval)) { | ||||
| 75557 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75558 | return int8_t(0); | ||||
| 75559 | } | ||||
| 75560 | int8_t rvalDecl; | ||||
| 75561 | if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.dashed-attribute", &rvalDecl)) { | ||||
| 75562 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75563 | return int8_t(0); | ||||
| 75564 | } | ||||
| 75565 | return rvalDecl; | ||||
| 75566 | } | ||||
| 75567 | |||||
| 75568 | bool | ||||
| 75569 | TestJSImplInterfaceJSImpl::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75570 | { | ||||
| 75571 | CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75572 | if (aRv.Failed()) { | ||||
| 75573 | return bool(0); | ||||
| 75574 | } | ||||
| 75575 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75575); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75575; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75576 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75577 | |||||
| 75578 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75579 | |||||
| 75580 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75581 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75582 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75583 | && !InitIds(cx, atomsCache)) || | ||||
| 75584 | !JS_GetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, &rval)) { | ||||
| 75585 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75586 | return bool(0); | ||||
| 75587 | } | ||||
| 75588 | bool rvalDecl; | ||||
| 75589 | if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.nonEnumerableAttr", &rvalDecl)) { | ||||
| 75590 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75591 | return bool(0); | ||||
| 75592 | } | ||||
| 75593 | return rvalDecl; | ||||
| 75594 | } | ||||
| 75595 | |||||
| 75596 | void | ||||
| 75597 | TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75598 | { | ||||
| 75599 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75600 | if (aRv.Failed()) { | ||||
| 75601 | return; | ||||
| 75602 | } | ||||
| 75603 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75603); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75603; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75604 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75605 | |||||
| 75606 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75607 | |||||
| 75608 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75609 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75610 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75611 | && !InitIds(cx, atomsCache)) || | ||||
| 75612 | !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, &rval)) { | ||||
| 75613 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75614 | return; | ||||
| 75615 | } | ||||
| 75616 | RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx); | ||||
| 75617 | if (rval.isObject()) { | ||||
| 75618 | if (!rvalDecl.Init(&rval.toObject())) { | ||||
| 75619 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef", "ArrayBufferView"); | ||||
| 75620 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75621 | return; | ||||
| 75622 | } | ||||
| 75623 | if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) { | ||||
| 75624 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef"); | ||||
| 75625 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75626 | return; | ||||
| 75627 | } | ||||
| 75628 | if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) { | ||||
| 75629 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef"); | ||||
| 75630 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75631 | return; | ||||
| 75632 | } | ||||
| 75633 | } else { | ||||
| 75634 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef"); | ||||
| 75635 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75636 | return; | ||||
| 75637 | } | ||||
| 75638 | aRetVal.set(rvalDecl.Obj()); | ||||
| 75639 | } | ||||
| 75640 | |||||
| 75641 | void | ||||
| 75642 | TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75643 | { | ||||
| 75644 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75645 | if (aRv.Failed()) { | ||||
| 75646 | return; | ||||
| 75647 | } | ||||
| 75648 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75648); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75648; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75649 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75650 | |||||
| 75651 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75652 | |||||
| 75653 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75654 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75655 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75656 | && !InitIds(cx, atomsCache)) || | ||||
| 75657 | !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, &rval)) { | ||||
| 75658 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75659 | return; | ||||
| 75660 | } | ||||
| 75661 | RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx); | ||||
| 75662 | if (rval.isObject()) { | ||||
| 75663 | if (!rvalDecl.Init(&rval.toObject())) { | ||||
| 75664 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferView", "ArrayBufferView"); | ||||
| 75665 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75666 | return; | ||||
| 75667 | } | ||||
| 75668 | if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) { | ||||
| 75669 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferView"); | ||||
| 75670 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75671 | return; | ||||
| 75672 | } | ||||
| 75673 | if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) { | ||||
| 75674 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferView"); | ||||
| 75675 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75676 | return; | ||||
| 75677 | } | ||||
| 75678 | } else { | ||||
| 75679 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferView"); | ||||
| 75680 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75681 | return; | ||||
| 75682 | } | ||||
| 75683 | aRetVal.set(rvalDecl.Obj()); | ||||
| 75684 | } | ||||
| 75685 | |||||
| 75686 | void | ||||
| 75687 | TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75688 | { | ||||
| 75689 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75690 | if (aRv.Failed()) { | ||||
| 75691 | return; | ||||
| 75692 | } | ||||
| 75693 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75693); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75693; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75694 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75695 | |||||
| 75696 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75697 | |||||
| 75698 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75699 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75700 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75701 | && !InitIds(cx, atomsCache)) || | ||||
| 75702 | !JS_GetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, &rval)) { | ||||
| 75703 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75704 | return; | ||||
| 75705 | } | ||||
| 75706 | RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> rvalDecl(cx); | ||||
| 75707 | if (rval.isObject()) { | ||||
| 75708 | if (!rvalDecl.SetValue().Init(&rval.toObject())) { | ||||
| 75709 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView", "ArrayBufferViewOrNull"); | ||||
| 75710 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75711 | return; | ||||
| 75712 | } | ||||
| 75713 | if (JS::IsLargeArrayBufferView(rvalDecl.SetValue().Obj())) { | ||||
| 75714 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView"); | ||||
| 75715 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75716 | return; | ||||
| 75717 | } | ||||
| 75718 | if (JS::IsResizableArrayBufferView(rvalDecl.SetValue().Obj())) { | ||||
| 75719 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView"); | ||||
| 75720 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75721 | return; | ||||
| 75722 | } | ||||
| 75723 | } else if (rval.isNullOrUndefined()) { | ||||
| 75724 | rvalDecl.SetNull(); | ||||
| 75725 | } else { | ||||
| 75726 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView"); | ||||
| 75727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75728 | return; | ||||
| 75729 | } | ||||
| 75730 | aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj()); | ||||
| 75731 | } | ||||
| 75732 | |||||
| 75733 | void | ||||
| 75734 | TestJSImplInterfaceJSImpl::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75735 | { | ||||
| 75736 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75737 | if (aRv.Failed()) { | ||||
| 75738 | return; | ||||
| 75739 | } | ||||
| 75740 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75740); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75740; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75741 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75742 | |||||
| 75743 | JS::Rooted<JS::Value> rval(cx); | ||||
| 75744 | |||||
| 75745 | JS::Rooted<JSObject *> callback(cx, mCallback); | ||||
| 75746 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75747 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() | ||||
| 75748 | && !InitIds(cx, atomsCache)) || | ||||
| 75749 | !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, &rval)) { | ||||
| 75750 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75751 | return; | ||||
| 75752 | } | ||||
| 75753 | RootedSpiderMonkeyInterface<ArrayBuffer> rvalDecl(cx); | ||||
| 75754 | if (rval.isObject()) { | ||||
| 75755 | if (!rvalDecl.Init(&rval.toObject())) { | ||||
| 75756 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBuffer", "ArrayBuffer"); | ||||
| 75757 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75758 | return; | ||||
| 75759 | } | ||||
| 75760 | if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.Obj())) { | ||||
| 75761 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBuffer"); | ||||
| 75762 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75763 | return; | ||||
| 75764 | } | ||||
| 75765 | if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.Obj())) { | ||||
| 75766 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBuffer"); | ||||
| 75767 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75768 | return; | ||||
| 75769 | } | ||||
| 75770 | } else { | ||||
| 75771 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBuffer"); | ||||
| 75772 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75773 | return; | ||||
| 75774 | } | ||||
| 75775 | aRetVal.set(rvalDecl.Obj()); | ||||
| 75776 | } | ||||
| 75777 | |||||
| 75778 | void | ||||
| 75779 | TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75780 | { | ||||
| 75781 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", 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 { *((volatile int *)__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->allowSharedNullableArrayBuffer_id, &rval)) { | ||||
| 75795 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75796 | return; | ||||
| 75797 | } | ||||
| 75798 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> rvalDecl(cx); | ||||
| 75799 | if (rval.isObject()) { | ||||
| 75800 | if (!rvalDecl.SetValue().Init(&rval.toObject())) { | ||||
| 75801 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer", "ArrayBufferOrNull"); | ||||
| 75802 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75803 | return; | ||||
| 75804 | } | ||||
| 75805 | if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) { | ||||
| 75806 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer"); | ||||
| 75807 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75808 | return; | ||||
| 75809 | } | ||||
| 75810 | if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) { | ||||
| 75811 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer"); | ||||
| 75812 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75813 | return; | ||||
| 75814 | } | ||||
| 75815 | } else if (rval.isNullOrUndefined()) { | ||||
| 75816 | rvalDecl.SetNull(); | ||||
| 75817 | } else { | ||||
| 75818 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer"); | ||||
| 75819 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75820 | return; | ||||
| 75821 | } | ||||
| 75822 | aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj()); | ||||
| 75823 | } | ||||
| 75824 | |||||
| 75825 | void | ||||
| 75826 | TestJSImplInterfaceJSImpl::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75827 | { | ||||
| 75828 | CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75829 | if (aRv.Failed()) { | ||||
| 75830 | return; | ||||
| 75831 | } | ||||
| 75832 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75832); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75832; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75833 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75834 | |||||
| 75835 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75836 | if (!argv.resize(1)) { | ||||
| 75837 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75838 | // the right thing with that. | ||||
| 75839 | return; | ||||
| 75840 | } | ||||
| 75841 | do { | ||||
| 75842 | argv[0].setInt32(int32_t(arg)); | ||||
| 75843 | break; | ||||
| 75844 | } while (false); | ||||
| 75845 | |||||
| 75846 | 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", 75846); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 75846; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75847 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 75848 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75849 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 75850 | !InitIds(cx, atomsCache)) || | ||||
| 75851 | !JS_SetPropertyById(cx, callback, atomsCache->writableByte_id, argv[0])) { | ||||
| 75852 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75853 | return; | ||||
| 75854 | } | ||||
| 75855 | } | ||||
| 75856 | |||||
| 75857 | void | ||||
| 75858 | TestJSImplInterfaceJSImpl::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75859 | { | ||||
| 75860 | CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75861 | if (aRv.Failed()) { | ||||
| 75862 | return; | ||||
| 75863 | } | ||||
| 75864 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75864); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75864; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75865 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75866 | |||||
| 75867 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75868 | if (!argv.resize(1)) { | ||||
| 75869 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75870 | // the right thing with that. | ||||
| 75871 | return; | ||||
| 75872 | } | ||||
| 75873 | do { | ||||
| 75874 | argv[0].setInt32(int32_t(arg)); | ||||
| 75875 | break; | ||||
| 75876 | } while (false); | ||||
| 75877 | |||||
| 75878 | 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", 75878); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 75878; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75879 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 75880 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75881 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 75882 | !InitIds(cx, atomsCache)) || | ||||
| 75883 | !JS_SetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, argv[0])) { | ||||
| 75884 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75885 | return; | ||||
| 75886 | } | ||||
| 75887 | } | ||||
| 75888 | |||||
| 75889 | void | ||||
| 75890 | TestJSImplInterfaceJSImpl::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75891 | { | ||||
| 75892 | CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75893 | if (aRv.Failed()) { | ||||
| 75894 | return; | ||||
| 75895 | } | ||||
| 75896 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75896); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75896; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75897 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75898 | |||||
| 75899 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75900 | if (!argv.resize(1)) { | ||||
| 75901 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75902 | // the right thing with that. | ||||
| 75903 | return; | ||||
| 75904 | } | ||||
| 75905 | do { | ||||
| 75906 | argv[0].setInt32(int32_t(arg)); | ||||
| 75907 | break; | ||||
| 75908 | } while (false); | ||||
| 75909 | |||||
| 75910 | 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", 75910); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 75910; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75911 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 75912 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75913 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 75914 | !InitIds(cx, atomsCache)) || | ||||
| 75915 | !JS_SetPropertyById(cx, callback, atomsCache->domDependentByte_id, argv[0])) { | ||||
| 75916 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75917 | return; | ||||
| 75918 | } | ||||
| 75919 | } | ||||
| 75920 | |||||
| 75921 | void | ||||
| 75922 | TestJSImplInterfaceJSImpl::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75923 | { | ||||
| 75924 | CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75925 | if (aRv.Failed()) { | ||||
| 75926 | return; | ||||
| 75927 | } | ||||
| 75928 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75928); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75928; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75929 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75930 | |||||
| 75931 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75932 | if (!argv.resize(1)) { | ||||
| 75933 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75934 | // the right thing with that. | ||||
| 75935 | return; | ||||
| 75936 | } | ||||
| 75937 | do { | ||||
| 75938 | argv[0].setInt32(int32_t(arg)); | ||||
| 75939 | break; | ||||
| 75940 | } while (false); | ||||
| 75941 | |||||
| 75942 | 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", 75942); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 75942; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75943 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 75944 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75945 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 75946 | !InitIds(cx, atomsCache)) || | ||||
| 75947 | !JS_SetPropertyById(cx, callback, atomsCache->writableShort_id, argv[0])) { | ||||
| 75948 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75949 | return; | ||||
| 75950 | } | ||||
| 75951 | } | ||||
| 75952 | |||||
| 75953 | void | ||||
| 75954 | TestJSImplInterfaceJSImpl::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75955 | { | ||||
| 75956 | CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75957 | if (aRv.Failed()) { | ||||
| 75958 | return; | ||||
| 75959 | } | ||||
| 75960 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75960); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75960; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75961 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75962 | |||||
| 75963 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75964 | if (!argv.resize(1)) { | ||||
| 75965 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75966 | // the right thing with that. | ||||
| 75967 | return; | ||||
| 75968 | } | ||||
| 75969 | do { | ||||
| 75970 | argv[0].setInt32(int32_t(arg)); | ||||
| 75971 | break; | ||||
| 75972 | } while (false); | ||||
| 75973 | |||||
| 75974 | 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", 75974); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 75974; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75975 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 75976 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 75977 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 75978 | !InitIds(cx, atomsCache)) || | ||||
| 75979 | !JS_SetPropertyById(cx, callback, atomsCache->writableLong_id, argv[0])) { | ||||
| 75980 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 75981 | return; | ||||
| 75982 | } | ||||
| 75983 | } | ||||
| 75984 | |||||
| 75985 | void | ||||
| 75986 | TestJSImplInterfaceJSImpl::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 75987 | { | ||||
| 75988 | CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 75989 | if (aRv.Failed()) { | ||||
| 75990 | return; | ||||
| 75991 | } | ||||
| 75992 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 75992); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 75992; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 75993 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 75994 | |||||
| 75995 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 75996 | if (!argv.resize(1)) { | ||||
| 75997 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 75998 | // the right thing with that. | ||||
| 75999 | return; | ||||
| 76000 | } | ||||
| 76001 | do { | ||||
| 76002 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76003 | break; | ||||
| 76004 | } while (false); | ||||
| 76005 | |||||
| 76006 | 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", 76006); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76006; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76007 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76008 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76009 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76010 | !InitIds(cx, atomsCache)) || | ||||
| 76011 | !JS_SetPropertyById(cx, callback, atomsCache->writableLongLong_id, argv[0])) { | ||||
| 76012 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76013 | return; | ||||
| 76014 | } | ||||
| 76015 | } | ||||
| 76016 | |||||
| 76017 | void | ||||
| 76018 | TestJSImplInterfaceJSImpl::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76019 | { | ||||
| 76020 | CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76021 | if (aRv.Failed()) { | ||||
| 76022 | return; | ||||
| 76023 | } | ||||
| 76024 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76024); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76024; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76025 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76026 | |||||
| 76027 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76028 | if (!argv.resize(1)) { | ||||
| 76029 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76030 | // the right thing with that. | ||||
| 76031 | return; | ||||
| 76032 | } | ||||
| 76033 | do { | ||||
| 76034 | argv[0].setInt32(int32_t(arg)); | ||||
| 76035 | break; | ||||
| 76036 | } while (false); | ||||
| 76037 | |||||
| 76038 | 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", 76038); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76038; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76039 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76040 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76041 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76042 | !InitIds(cx, atomsCache)) || | ||||
| 76043 | !JS_SetPropertyById(cx, callback, atomsCache->writableOctet_id, argv[0])) { | ||||
| 76044 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76045 | return; | ||||
| 76046 | } | ||||
| 76047 | } | ||||
| 76048 | |||||
| 76049 | void | ||||
| 76050 | TestJSImplInterfaceJSImpl::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76051 | { | ||||
| 76052 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76053 | if (aRv.Failed()) { | ||||
| 76054 | return; | ||||
| 76055 | } | ||||
| 76056 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76056); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76056; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76057 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76058 | |||||
| 76059 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76060 | if (!argv.resize(1)) { | ||||
| 76061 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76062 | // the right thing with that. | ||||
| 76063 | return; | ||||
| 76064 | } | ||||
| 76065 | do { | ||||
| 76066 | argv[0].setInt32(int32_t(arg)); | ||||
| 76067 | break; | ||||
| 76068 | } while (false); | ||||
| 76069 | |||||
| 76070 | 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", 76070); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76070; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76071 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76072 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76073 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76074 | !InitIds(cx, atomsCache)) || | ||||
| 76075 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, argv[0])) { | ||||
| 76076 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76077 | return; | ||||
| 76078 | } | ||||
| 76079 | } | ||||
| 76080 | |||||
| 76081 | void | ||||
| 76082 | TestJSImplInterfaceJSImpl::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76083 | { | ||||
| 76084 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76085 | if (aRv.Failed()) { | ||||
| 76086 | return; | ||||
| 76087 | } | ||||
| 76088 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76088); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76088; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76089 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76090 | |||||
| 76091 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76092 | if (!argv.resize(1)) { | ||||
| 76093 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76094 | // the right thing with that. | ||||
| 76095 | return; | ||||
| 76096 | } | ||||
| 76097 | do { | ||||
| 76098 | argv[0].setNumber(arg); | ||||
| 76099 | break; | ||||
| 76100 | } while (false); | ||||
| 76101 | |||||
| 76102 | 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", 76102); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76102; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76103 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76104 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76105 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76106 | !InitIds(cx, atomsCache)) || | ||||
| 76107 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, argv[0])) { | ||||
| 76108 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76109 | return; | ||||
| 76110 | } | ||||
| 76111 | } | ||||
| 76112 | |||||
| 76113 | void | ||||
| 76114 | TestJSImplInterfaceJSImpl::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76115 | { | ||||
| 76116 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76117 | if (aRv.Failed()) { | ||||
| 76118 | return; | ||||
| 76119 | } | ||||
| 76120 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76120); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76120; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76121 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76122 | |||||
| 76123 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76124 | if (!argv.resize(1)) { | ||||
| 76125 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76126 | // the right thing with that. | ||||
| 76127 | return; | ||||
| 76128 | } | ||||
| 76129 | do { | ||||
| 76130 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76131 | break; | ||||
| 76132 | } while (false); | ||||
| 76133 | |||||
| 76134 | 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", 76134); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76134; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76135 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76136 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76137 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76138 | !InitIds(cx, atomsCache)) || | ||||
| 76139 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, argv[0])) { | ||||
| 76140 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76141 | return; | ||||
| 76142 | } | ||||
| 76143 | } | ||||
| 76144 | |||||
| 76145 | void | ||||
| 76146 | TestJSImplInterfaceJSImpl::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76147 | { | ||||
| 76148 | CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76149 | if (aRv.Failed()) { | ||||
| 76150 | return; | ||||
| 76151 | } | ||||
| 76152 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76152); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76152; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76153 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76154 | |||||
| 76155 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76156 | if (!argv.resize(1)) { | ||||
| 76157 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76158 | // the right thing with that. | ||||
| 76159 | return; | ||||
| 76160 | } | ||||
| 76161 | do { | ||||
| 76162 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76163 | break; | ||||
| 76164 | } while (false); | ||||
| 76165 | |||||
| 76166 | 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", 76166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76166; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76167 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76168 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76169 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76170 | !InitIds(cx, atomsCache)) || | ||||
| 76171 | !JS_SetPropertyById(cx, callback, atomsCache->writableFloat_id, argv[0])) { | ||||
| 76172 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76173 | return; | ||||
| 76174 | } | ||||
| 76175 | } | ||||
| 76176 | |||||
| 76177 | void | ||||
| 76178 | TestJSImplInterfaceJSImpl::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76179 | { | ||||
| 76180 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76181 | if (aRv.Failed()) { | ||||
| 76182 | return; | ||||
| 76183 | } | ||||
| 76184 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76184); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76184; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76185 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76186 | |||||
| 76187 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76188 | if (!argv.resize(1)) { | ||||
| 76189 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76190 | // the right thing with that. | ||||
| 76191 | return; | ||||
| 76192 | } | ||||
| 76193 | do { | ||||
| 76194 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76195 | break; | ||||
| 76196 | } while (false); | ||||
| 76197 | |||||
| 76198 | 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", 76198); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76198; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76199 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76200 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76201 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76202 | !InitIds(cx, atomsCache)) || | ||||
| 76203 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, argv[0])) { | ||||
| 76204 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76205 | return; | ||||
| 76206 | } | ||||
| 76207 | } | ||||
| 76208 | |||||
| 76209 | void | ||||
| 76210 | TestJSImplInterfaceJSImpl::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76211 | { | ||||
| 76212 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76213 | if (aRv.Failed()) { | ||||
| 76214 | return; | ||||
| 76215 | } | ||||
| 76216 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76216); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76216; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76217 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76218 | |||||
| 76219 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76220 | if (!argv.resize(1)) { | ||||
| 76221 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76222 | // the right thing with that. | ||||
| 76223 | return; | ||||
| 76224 | } | ||||
| 76225 | do { | ||||
| 76226 | if (arg.IsNull()) { | ||||
| 76227 | argv[0].setNull(); | ||||
| 76228 | break; | ||||
| 76229 | } | ||||
| 76230 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 76231 | break; | ||||
| 76232 | } while (false); | ||||
| 76233 | |||||
| 76234 | 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", 76234); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76234; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76235 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76236 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76237 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76238 | !InitIds(cx, atomsCache)) || | ||||
| 76239 | !JS_SetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, argv[0])) { | ||||
| 76240 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76241 | return; | ||||
| 76242 | } | ||||
| 76243 | } | ||||
| 76244 | |||||
| 76245 | void | ||||
| 76246 | TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76247 | { | ||||
| 76248 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76249 | if (aRv.Failed()) { | ||||
| 76250 | return; | ||||
| 76251 | } | ||||
| 76252 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76252); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76252; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76253 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76254 | |||||
| 76255 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76256 | if (!argv.resize(1)) { | ||||
| 76257 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76258 | // the right thing with that. | ||||
| 76259 | return; | ||||
| 76260 | } | ||||
| 76261 | do { | ||||
| 76262 | if (arg.IsNull()) { | ||||
| 76263 | argv[0].setNull(); | ||||
| 76264 | break; | ||||
| 76265 | } | ||||
| 76266 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 76267 | break; | ||||
| 76268 | } while (false); | ||||
| 76269 | |||||
| 76270 | 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", 76270); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76270; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76271 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76272 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76273 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76274 | !InitIds(cx, atomsCache)) || | ||||
| 76275 | !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, argv[0])) { | ||||
| 76276 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76277 | return; | ||||
| 76278 | } | ||||
| 76279 | } | ||||
| 76280 | |||||
| 76281 | void | ||||
| 76282 | TestJSImplInterfaceJSImpl::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76283 | { | ||||
| 76284 | CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76285 | if (aRv.Failed()) { | ||||
| 76286 | return; | ||||
| 76287 | } | ||||
| 76288 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76288); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76288; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76289 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76290 | |||||
| 76291 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76292 | if (!argv.resize(1)) { | ||||
| 76293 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76294 | // the right thing with that. | ||||
| 76295 | return; | ||||
| 76296 | } | ||||
| 76297 | do { | ||||
| 76298 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76299 | break; | ||||
| 76300 | } while (false); | ||||
| 76301 | |||||
| 76302 | 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", 76302); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76302; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76303 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76304 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76305 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76306 | !InitIds(cx, atomsCache)) || | ||||
| 76307 | !JS_SetPropertyById(cx, callback, atomsCache->writableDouble_id, argv[0])) { | ||||
| 76308 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76309 | return; | ||||
| 76310 | } | ||||
| 76311 | } | ||||
| 76312 | |||||
| 76313 | void | ||||
| 76314 | TestJSImplInterfaceJSImpl::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76315 | { | ||||
| 76316 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76317 | if (aRv.Failed()) { | ||||
| 76318 | return; | ||||
| 76319 | } | ||||
| 76320 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76320); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76320; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76321 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76322 | |||||
| 76323 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76324 | if (!argv.resize(1)) { | ||||
| 76325 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76326 | // the right thing with that. | ||||
| 76327 | return; | ||||
| 76328 | } | ||||
| 76329 | do { | ||||
| 76330 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76331 | break; | ||||
| 76332 | } while (false); | ||||
| 76333 | |||||
| 76334 | 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", 76334); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76334; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76335 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76336 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76337 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76338 | !InitIds(cx, atomsCache)) || | ||||
| 76339 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, argv[0])) { | ||||
| 76340 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76341 | return; | ||||
| 76342 | } | ||||
| 76343 | } | ||||
| 76344 | |||||
| 76345 | void | ||||
| 76346 | TestJSImplInterfaceJSImpl::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76347 | { | ||||
| 76348 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76349 | if (aRv.Failed()) { | ||||
| 76350 | return; | ||||
| 76351 | } | ||||
| 76352 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76352); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76352; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76353 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76354 | |||||
| 76355 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76356 | if (!argv.resize(1)) { | ||||
| 76357 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76358 | // the right thing with that. | ||||
| 76359 | return; | ||||
| 76360 | } | ||||
| 76361 | do { | ||||
| 76362 | if (arg.IsNull()) { | ||||
| 76363 | argv[0].setNull(); | ||||
| 76364 | break; | ||||
| 76365 | } | ||||
| 76366 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 76367 | break; | ||||
| 76368 | } while (false); | ||||
| 76369 | |||||
| 76370 | 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", 76370); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76370; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76371 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76372 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76373 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76374 | !InitIds(cx, atomsCache)) || | ||||
| 76375 | !JS_SetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, argv[0])) { | ||||
| 76376 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76377 | return; | ||||
| 76378 | } | ||||
| 76379 | } | ||||
| 76380 | |||||
| 76381 | void | ||||
| 76382 | TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76383 | { | ||||
| 76384 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76385 | if (aRv.Failed()) { | ||||
| 76386 | return; | ||||
| 76387 | } | ||||
| 76388 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76388); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76388; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76389 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76390 | |||||
| 76391 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76392 | if (!argv.resize(1)) { | ||||
| 76393 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76394 | // the right thing with that. | ||||
| 76395 | return; | ||||
| 76396 | } | ||||
| 76397 | do { | ||||
| 76398 | if (arg.IsNull()) { | ||||
| 76399 | argv[0].setNull(); | ||||
| 76400 | break; | ||||
| 76401 | } | ||||
| 76402 | argv[0].set(JS_NumberValue(double(arg.Value()))); | ||||
| 76403 | break; | ||||
| 76404 | } while (false); | ||||
| 76405 | |||||
| 76406 | 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", 76406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76406; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76407 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76408 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76409 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76410 | !InitIds(cx, atomsCache)) || | ||||
| 76411 | !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, argv[0])) { | ||||
| 76412 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76413 | return; | ||||
| 76414 | } | ||||
| 76415 | } | ||||
| 76416 | |||||
| 76417 | void | ||||
| 76418 | TestJSImplInterfaceJSImpl::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76419 | { | ||||
| 76420 | CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76421 | if (aRv.Failed()) { | ||||
| 76422 | return; | ||||
| 76423 | } | ||||
| 76424 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76424); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76424; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76425 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76426 | |||||
| 76427 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76428 | if (!argv.resize(1)) { | ||||
| 76429 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76430 | // the right thing with that. | ||||
| 76431 | return; | ||||
| 76432 | } | ||||
| 76433 | do { | ||||
| 76434 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76435 | break; | ||||
| 76436 | } while (false); | ||||
| 76437 | |||||
| 76438 | 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", 76438); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76438; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76439 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76440 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76441 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76442 | !InitIds(cx, atomsCache)) || | ||||
| 76443 | !JS_SetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, argv[0])) { | ||||
| 76444 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76445 | return; | ||||
| 76446 | } | ||||
| 76447 | } | ||||
| 76448 | |||||
| 76449 | void | ||||
| 76450 | TestJSImplInterfaceJSImpl::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76451 | { | ||||
| 76452 | CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76453 | if (aRv.Failed()) { | ||||
| 76454 | return; | ||||
| 76455 | } | ||||
| 76456 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76456); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76456; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76457 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76458 | |||||
| 76459 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76460 | if (!argv.resize(1)) { | ||||
| 76461 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76462 | // the right thing with that. | ||||
| 76463 | return; | ||||
| 76464 | } | ||||
| 76465 | do { | ||||
| 76466 | argv[0].set(JS_NumberValue(double(arg))); | ||||
| 76467 | break; | ||||
| 76468 | } while (false); | ||||
| 76469 | |||||
| 76470 | 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", 76470); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76470; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76471 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76472 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76473 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76474 | !InitIds(cx, atomsCache)) || | ||||
| 76475 | !JS_SetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, argv[0])) { | ||||
| 76476 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76477 | return; | ||||
| 76478 | } | ||||
| 76479 | } | ||||
| 76480 | |||||
| 76481 | void | ||||
| 76482 | TestJSImplInterfaceJSImpl::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76483 | { | ||||
| 76484 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76485 | if (aRv.Failed()) { | ||||
| 76486 | return; | ||||
| 76487 | } | ||||
| 76488 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76488); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76488; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76489 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76490 | |||||
| 76491 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76492 | if (!argv.resize(1)) { | ||||
| 76493 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76494 | // the right thing with that. | ||||
| 76495 | return; | ||||
| 76496 | } | ||||
| 76497 | do { | ||||
| 76498 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 76499 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 76499); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 76499; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76500 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76501 | return; | ||||
| 76502 | } | ||||
| 76503 | break; | ||||
| 76504 | } while (false); | ||||
| 76505 | |||||
| 76506 | 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", 76506); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76506; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76507 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76508 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76509 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76510 | !InitIds(cx, atomsCache)) || | ||||
| 76511 | !JS_SetPropertyById(cx, callback, atomsCache->nonNullSelf_id, argv[0])) { | ||||
| 76512 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76513 | return; | ||||
| 76514 | } | ||||
| 76515 | } | ||||
| 76516 | |||||
| 76517 | void | ||||
| 76518 | TestJSImplInterfaceJSImpl::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76519 | { | ||||
| 76520 | CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76521 | if (aRv.Failed()) { | ||||
| 76522 | return; | ||||
| 76523 | } | ||||
| 76524 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76524); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76524; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76525 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76526 | |||||
| 76527 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76528 | if (!argv.resize(1)) { | ||||
| 76529 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76530 | // the right thing with that. | ||||
| 76531 | return; | ||||
| 76532 | } | ||||
| 76533 | do { | ||||
| 76534 | if (!arg) { | ||||
| 76535 | argv[0].setNull(); | ||||
| 76536 | break; | ||||
| 76537 | } | ||||
| 76538 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 76539 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 76539); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 76539; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76540 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76541 | return; | ||||
| 76542 | } | ||||
| 76543 | break; | ||||
| 76544 | } while (false); | ||||
| 76545 | |||||
| 76546 | 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", 76546); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76546; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76547 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76548 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76549 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76550 | !InitIds(cx, atomsCache)) || | ||||
| 76551 | !JS_SetPropertyById(cx, callback, atomsCache->nullableSelf_id, argv[0])) { | ||||
| 76552 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76553 | return; | ||||
| 76554 | } | ||||
| 76555 | } | ||||
| 76556 | |||||
| 76557 | void | ||||
| 76558 | TestJSImplInterfaceJSImpl::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76559 | { | ||||
| 76560 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76561 | if (aRv.Failed()) { | ||||
| 76562 | return; | ||||
| 76563 | } | ||||
| 76564 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76564); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76564; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76565 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76566 | |||||
| 76567 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76568 | if (!argv.resize(1)) { | ||||
| 76569 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76570 | // the right thing with that. | ||||
| 76571 | return; | ||||
| 76572 | } | ||||
| 76573 | do { | ||||
| 76574 | if (!WrapObject(cx, arg, argv[0])) { | ||||
| 76575 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76576 | return; | ||||
| 76577 | } | ||||
| 76578 | break; | ||||
| 76579 | } while (false); | ||||
| 76580 | |||||
| 76581 | 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", 76581); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76581; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76582 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76583 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76584 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76585 | !InitIds(cx, atomsCache)) || | ||||
| 76586 | !JS_SetPropertyById(cx, callback, atomsCache->nonNullExternal_id, argv[0])) { | ||||
| 76587 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76588 | return; | ||||
| 76589 | } | ||||
| 76590 | } | ||||
| 76591 | |||||
| 76592 | void | ||||
| 76593 | TestJSImplInterfaceJSImpl::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76594 | { | ||||
| 76595 | CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76596 | if (aRv.Failed()) { | ||||
| 76597 | return; | ||||
| 76598 | } | ||||
| 76599 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76599); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76599; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76600 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76601 | |||||
| 76602 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76603 | if (!argv.resize(1)) { | ||||
| 76604 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76605 | // the right thing with that. | ||||
| 76606 | return; | ||||
| 76607 | } | ||||
| 76608 | do { | ||||
| 76609 | if (!arg) { | ||||
| 76610 | argv[0].setNull(); | ||||
| 76611 | break; | ||||
| 76612 | } | ||||
| 76613 | if (!WrapObject(cx, arg, argv[0])) { | ||||
| 76614 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76615 | return; | ||||
| 76616 | } | ||||
| 76617 | break; | ||||
| 76618 | } while (false); | ||||
| 76619 | |||||
| 76620 | 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", 76620); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76620; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76621 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76622 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76623 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76624 | !InitIds(cx, atomsCache)) || | ||||
| 76625 | !JS_SetPropertyById(cx, callback, atomsCache->nullableExternal_id, argv[0])) { | ||||
| 76626 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76627 | return; | ||||
| 76628 | } | ||||
| 76629 | } | ||||
| 76630 | |||||
| 76631 | void | ||||
| 76632 | TestJSImplInterfaceJSImpl::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76633 | { | ||||
| 76634 | CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76635 | if (aRv.Failed()) { | ||||
| 76636 | return; | ||||
| 76637 | } | ||||
| 76638 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76638); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76638; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76639 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76640 | |||||
| 76641 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76642 | if (!argv.resize(1)) { | ||||
| 76643 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76644 | // the right thing with that. | ||||
| 76645 | return; | ||||
| 76646 | } | ||||
| 76647 | do { | ||||
| 76648 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 76649 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 76650 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76651 | return; | ||||
| 76652 | } | ||||
| 76653 | break; | ||||
| 76654 | } while (false); | ||||
| 76655 | |||||
| 76656 | 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", 76656); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76656; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76657 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76658 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76659 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76660 | !InitIds(cx, atomsCache)) || | ||||
| 76661 | !JS_SetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, argv[0])) { | ||||
| 76662 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76663 | return; | ||||
| 76664 | } | ||||
| 76665 | } | ||||
| 76666 | |||||
| 76667 | void | ||||
| 76668 | TestJSImplInterfaceJSImpl::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76669 | { | ||||
| 76670 | CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76671 | if (aRv.Failed()) { | ||||
| 76672 | return; | ||||
| 76673 | } | ||||
| 76674 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76674); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76674; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76675 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76676 | |||||
| 76677 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76678 | if (!argv.resize(1)) { | ||||
| 76679 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76680 | // the right thing with that. | ||||
| 76681 | return; | ||||
| 76682 | } | ||||
| 76683 | do { | ||||
| 76684 | if (arg) { | ||||
| 76685 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 76686 | if (!MaybeWrapObjectOrNullValue(cx, argv[0])) { | ||||
| 76687 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76688 | return; | ||||
| 76689 | } | ||||
| 76690 | break; | ||||
| 76691 | } else { | ||||
| 76692 | argv[0].setNull(); | ||||
| 76693 | break; | ||||
| 76694 | } | ||||
| 76695 | } while (false); | ||||
| 76696 | |||||
| 76697 | 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", 76697); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76697; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76698 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76699 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76700 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76701 | !InitIds(cx, atomsCache)) || | ||||
| 76702 | !JS_SetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, argv[0])) { | ||||
| 76703 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76704 | return; | ||||
| 76705 | } | ||||
| 76706 | } | ||||
| 76707 | |||||
| 76708 | void | ||||
| 76709 | TestJSImplInterfaceJSImpl::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76710 | { | ||||
| 76711 | CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76712 | if (aRv.Failed()) { | ||||
| 76713 | return; | ||||
| 76714 | } | ||||
| 76715 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76715); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76715; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76716 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76717 | |||||
| 76718 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76719 | if (!argv.resize(1)) { | ||||
| 76720 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76721 | // the right thing with that. | ||||
| 76722 | return; | ||||
| 76723 | } | ||||
| 76724 | do { | ||||
| 76725 | argv[0].setObject(*arg.Obj()); | ||||
| 76726 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 76727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76728 | return; | ||||
| 76729 | } | ||||
| 76730 | break; | ||||
| 76731 | } while (false); | ||||
| 76732 | |||||
| 76733 | 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", 76733); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76733; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76734 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76735 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76736 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76737 | !InitIds(cx, atomsCache)) || | ||||
| 76738 | !JS_SetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, argv[0])) { | ||||
| 76739 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76740 | return; | ||||
| 76741 | } | ||||
| 76742 | } | ||||
| 76743 | |||||
| 76744 | void | ||||
| 76745 | TestJSImplInterfaceJSImpl::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76746 | { | ||||
| 76747 | CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76748 | if (aRv.Failed()) { | ||||
| 76749 | return; | ||||
| 76750 | } | ||||
| 76751 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76751; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76752 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76753 | |||||
| 76754 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76755 | if (!argv.resize(1)) { | ||||
| 76756 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76757 | // the right thing with that. | ||||
| 76758 | return; | ||||
| 76759 | } | ||||
| 76760 | do { | ||||
| 76761 | argv[0].setString(arg); | ||||
| 76762 | if (!MaybeWrapStringValue(cx, argv[0])) { | ||||
| 76763 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76764 | return; | ||||
| 76765 | } | ||||
| 76766 | break; | ||||
| 76767 | } while (false); | ||||
| 76768 | |||||
| 76769 | 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", 76769); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76769; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76770 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76771 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76772 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76773 | !InitIds(cx, atomsCache)) || | ||||
| 76774 | !JS_SetPropertyById(cx, callback, atomsCache->jsStringAttr_id, argv[0])) { | ||||
| 76775 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76776 | return; | ||||
| 76777 | } | ||||
| 76778 | } | ||||
| 76779 | |||||
| 76780 | void | ||||
| 76781 | TestJSImplInterfaceJSImpl::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76782 | { | ||||
| 76783 | CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76784 | if (aRv.Failed()) { | ||||
| 76785 | return; | ||||
| 76786 | } | ||||
| 76787 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76787); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76787; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76788 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76789 | |||||
| 76790 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76791 | if (!argv.resize(1)) { | ||||
| 76792 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76793 | // the right thing with that. | ||||
| 76794 | return; | ||||
| 76795 | } | ||||
| 76796 | do { | ||||
| 76797 | if (!ToJSValue(cx, arg, argv[0])) { | ||||
| 76798 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76799 | return; | ||||
| 76800 | } | ||||
| 76801 | break; | ||||
| 76802 | } while (false); | ||||
| 76803 | |||||
| 76804 | 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", 76804); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76804; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76805 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76806 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76807 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76808 | !InitIds(cx, atomsCache)) || | ||||
| 76809 | !JS_SetPropertyById(cx, callback, atomsCache->enumAttribute_id, argv[0])) { | ||||
| 76810 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76811 | return; | ||||
| 76812 | } | ||||
| 76813 | } | ||||
| 76814 | |||||
| 76815 | void | ||||
| 76816 | TestJSImplInterfaceJSImpl::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76817 | { | ||||
| 76818 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76819 | if (aRv.Failed()) { | ||||
| 76820 | return; | ||||
| 76821 | } | ||||
| 76822 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76822); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76822; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76823 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76824 | |||||
| 76825 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76826 | if (!argv.resize(1)) { | ||||
| 76827 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76828 | // the right thing with that. | ||||
| 76829 | return; | ||||
| 76830 | } | ||||
| 76831 | do { | ||||
| 76832 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 76833 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 76834 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76835 | return; | ||||
| 76836 | } | ||||
| 76837 | break; | ||||
| 76838 | } while (false); | ||||
| 76839 | |||||
| 76840 | 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", 76840); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76840; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76841 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76842 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76843 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76844 | !InitIds(cx, atomsCache)) || | ||||
| 76845 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnion_id, argv[0])) { | ||||
| 76846 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76847 | return; | ||||
| 76848 | } | ||||
| 76849 | } | ||||
| 76850 | |||||
| 76851 | void | ||||
| 76852 | TestJSImplInterfaceJSImpl::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76853 | { | ||||
| 76854 | CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76855 | if (aRv.Failed()) { | ||||
| 76856 | return; | ||||
| 76857 | } | ||||
| 76858 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76858); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76858; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76859 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76860 | |||||
| 76861 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76862 | if (!argv.resize(1)) { | ||||
| 76863 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76864 | // the right thing with that. | ||||
| 76865 | return; | ||||
| 76866 | } | ||||
| 76867 | do { | ||||
| 76868 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 76869 | if (!arg.ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 76870 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76871 | return; | ||||
| 76872 | } | ||||
| 76873 | break; | ||||
| 76874 | } while (false); | ||||
| 76875 | |||||
| 76876 | 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", 76876); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76876; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76877 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76878 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76879 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76880 | !InitIds(cx, atomsCache)) || | ||||
| 76881 | !JS_SetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, argv[0])) { | ||||
| 76882 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76883 | return; | ||||
| 76884 | } | ||||
| 76885 | } | ||||
| 76886 | |||||
| 76887 | void | ||||
| 76888 | TestJSImplInterfaceJSImpl::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76889 | { | ||||
| 76890 | CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76891 | if (aRv.Failed()) { | ||||
| 76892 | return; | ||||
| 76893 | } | ||||
| 76894 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76894); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76894; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76895 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76896 | |||||
| 76897 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76898 | if (!argv.resize(1)) { | ||||
| 76899 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76900 | // the right thing with that. | ||||
| 76901 | return; | ||||
| 76902 | } | ||||
| 76903 | do { | ||||
| 76904 | JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray()); | ||||
| 76905 | if (arg.IsNull()) { | ||||
| 76906 | argv[0].setNull(); | ||||
| 76907 | break; | ||||
| 76908 | } | ||||
| 76909 | if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) { | ||||
| 76910 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76911 | return; | ||||
| 76912 | } | ||||
| 76913 | break; | ||||
| 76914 | } while (false); | ||||
| 76915 | |||||
| 76916 | 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", 76916); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76916; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76917 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76918 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76919 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76920 | !InitIds(cx, atomsCache)) || | ||||
| 76921 | !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnion_id, argv[0])) { | ||||
| 76922 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76923 | return; | ||||
| 76924 | } | ||||
| 76925 | } | ||||
| 76926 | |||||
| 76927 | void | ||||
| 76928 | TestJSImplInterfaceJSImpl::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76929 | { | ||||
| 76930 | CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76931 | if (aRv.Failed()) { | ||||
| 76932 | return; | ||||
| 76933 | } | ||||
| 76934 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76934); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76934; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76935 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76936 | |||||
| 76937 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76938 | if (!argv.resize(1)) { | ||||
| 76939 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76940 | // the right thing with that. | ||||
| 76941 | return; | ||||
| 76942 | } | ||||
| 76943 | do { | ||||
| 76944 | argv[0].setInt32(int32_t(arg)); | ||||
| 76945 | break; | ||||
| 76946 | } while (false); | ||||
| 76947 | |||||
| 76948 | 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", 76948); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76948; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76949 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76950 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76951 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76952 | !InitIds(cx, atomsCache)) || | ||||
| 76953 | !JS_SetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, argv[0])) { | ||||
| 76954 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76955 | return; | ||||
| 76956 | } | ||||
| 76957 | } | ||||
| 76958 | |||||
| 76959 | void | ||||
| 76960 | TestJSImplInterfaceJSImpl::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76961 | { | ||||
| 76962 | CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76963 | if (aRv.Failed()) { | ||||
| 76964 | return; | ||||
| 76965 | } | ||||
| 76966 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76966); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76966; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76967 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 76968 | |||||
| 76969 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 76970 | if (!argv.resize(1)) { | ||||
| 76971 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 76972 | // the right thing with that. | ||||
| 76973 | return; | ||||
| 76974 | } | ||||
| 76975 | do { | ||||
| 76976 | argv[0].setInt32(int32_t(arg)); | ||||
| 76977 | break; | ||||
| 76978 | } while (false); | ||||
| 76979 | |||||
| 76980 | 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", 76980); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 76980; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76981 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 76982 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 76983 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 76984 | !InitIds(cx, atomsCache)) || | ||||
| 76985 | !JS_SetPropertyById(cx, callback, atomsCache->enforcedByte_id, argv[0])) { | ||||
| 76986 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 76987 | return; | ||||
| 76988 | } | ||||
| 76989 | } | ||||
| 76990 | |||||
| 76991 | void | ||||
| 76992 | TestJSImplInterfaceJSImpl::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 76993 | { | ||||
| 76994 | CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 76995 | if (aRv.Failed()) { | ||||
| 76996 | return; | ||||
| 76997 | } | ||||
| 76998 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 76998); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 76998; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 76999 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77000 | |||||
| 77001 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77002 | if (!argv.resize(1)) { | ||||
| 77003 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77004 | // the right thing with that. | ||||
| 77005 | return; | ||||
| 77006 | } | ||||
| 77007 | do { | ||||
| 77008 | if (arg.IsNull()) { | ||||
| 77009 | argv[0].setNull(); | ||||
| 77010 | break; | ||||
| 77011 | } | ||||
| 77012 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 77013 | break; | ||||
| 77014 | } while (false); | ||||
| 77015 | |||||
| 77016 | 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", 77016); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77016; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77017 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77018 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77019 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77020 | !InitIds(cx, atomsCache)) || | ||||
| 77021 | !JS_SetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, argv[0])) { | ||||
| 77022 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77023 | return; | ||||
| 77024 | } | ||||
| 77025 | } | ||||
| 77026 | |||||
| 77027 | void | ||||
| 77028 | TestJSImplInterfaceJSImpl::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77029 | { | ||||
| 77030 | CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77031 | if (aRv.Failed()) { | ||||
| 77032 | return; | ||||
| 77033 | } | ||||
| 77034 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77034); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77034; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77035 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77036 | |||||
| 77037 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77038 | if (!argv.resize(1)) { | ||||
| 77039 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77040 | // the right thing with that. | ||||
| 77041 | return; | ||||
| 77042 | } | ||||
| 77043 | do { | ||||
| 77044 | argv[0].setInt32(int32_t(arg)); | ||||
| 77045 | break; | ||||
| 77046 | } while (false); | ||||
| 77047 | |||||
| 77048 | 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", 77048); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77048; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77049 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77050 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77051 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77052 | !InitIds(cx, atomsCache)) || | ||||
| 77053 | !JS_SetPropertyById(cx, callback, atomsCache->clampedByte_id, argv[0])) { | ||||
| 77054 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77055 | return; | ||||
| 77056 | } | ||||
| 77057 | } | ||||
| 77058 | |||||
| 77059 | void | ||||
| 77060 | TestJSImplInterfaceJSImpl::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77061 | { | ||||
| 77062 | CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77063 | if (aRv.Failed()) { | ||||
| 77064 | return; | ||||
| 77065 | } | ||||
| 77066 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77066); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77066; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77067 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77068 | |||||
| 77069 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77070 | if (!argv.resize(1)) { | ||||
| 77071 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77072 | // the right thing with that. | ||||
| 77073 | return; | ||||
| 77074 | } | ||||
| 77075 | do { | ||||
| 77076 | if (arg.IsNull()) { | ||||
| 77077 | argv[0].setNull(); | ||||
| 77078 | break; | ||||
| 77079 | } | ||||
| 77080 | argv[0].setInt32(int32_t(arg.Value())); | ||||
| 77081 | break; | ||||
| 77082 | } while (false); | ||||
| 77083 | |||||
| 77084 | 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", 77084); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77084; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77085 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77086 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77087 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77088 | !InitIds(cx, atomsCache)) || | ||||
| 77089 | !JS_SetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, argv[0])) { | ||||
| 77090 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77091 | return; | ||||
| 77092 | } | ||||
| 77093 | } | ||||
| 77094 | |||||
| 77095 | void | ||||
| 77096 | TestJSImplInterfaceJSImpl::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77097 | { | ||||
| 77098 | CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77099 | if (aRv.Failed()) { | ||||
| 77100 | return; | ||||
| 77101 | } | ||||
| 77102 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77102); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77102; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77103 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77104 | |||||
| 77105 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77106 | if (!argv.resize(1)) { | ||||
| 77107 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77108 | // the right thing with that. | ||||
| 77109 | return; | ||||
| 77110 | } | ||||
| 77111 | do { | ||||
| 77112 | argv[0].setInt32(int32_t(arg)); | ||||
| 77113 | break; | ||||
| 77114 | } while (false); | ||||
| 77115 | |||||
| 77116 | 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", 77116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77116; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77117 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77118 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77119 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77120 | !InitIds(cx, atomsCache)) || | ||||
| 77121 | !JS_SetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, argv[0])) { | ||||
| 77122 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77123 | return; | ||||
| 77124 | } | ||||
| 77125 | } | ||||
| 77126 | |||||
| 77127 | void | ||||
| 77128 | TestJSImplInterfaceJSImpl::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77129 | { | ||||
| 77130 | CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77131 | if (aRv.Failed()) { | ||||
| 77132 | return; | ||||
| 77133 | } | ||||
| 77134 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77134); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77134; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77135 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77136 | |||||
| 77137 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77138 | if (!argv.resize(1)) { | ||||
| 77139 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77140 | // the right thing with that. | ||||
| 77141 | return; | ||||
| 77142 | } | ||||
| 77143 | do { | ||||
| 77144 | argv[0].setInt32(int32_t(arg)); | ||||
| 77145 | break; | ||||
| 77146 | } while (false); | ||||
| 77147 | |||||
| 77148 | 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", 77148); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77148; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77149 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77150 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77151 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77152 | !InitIds(cx, atomsCache)) || | ||||
| 77153 | !JS_SetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, argv[0])) { | ||||
| 77154 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77155 | return; | ||||
| 77156 | } | ||||
| 77157 | } | ||||
| 77158 | |||||
| 77159 | void | ||||
| 77160 | TestJSImplInterfaceJSImpl::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77161 | { | ||||
| 77162 | CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77163 | if (aRv.Failed()) { | ||||
| 77164 | return; | ||||
| 77165 | } | ||||
| 77166 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77166; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77167 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77168 | |||||
| 77169 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77170 | if (!argv.resize(1)) { | ||||
| 77171 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77172 | // the right thing with that. | ||||
| 77173 | return; | ||||
| 77174 | } | ||||
| 77175 | do { | ||||
| 77176 | argv[0].setBoolean(arg); | ||||
| 77177 | break; | ||||
| 77178 | } while (false); | ||||
| 77179 | |||||
| 77180 | 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", 77180); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77180; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77181 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77182 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77183 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77184 | !InitIds(cx, atomsCache)) || | ||||
| 77185 | !JS_SetPropertyById(cx, callback, atomsCache->throwingAttr_id, argv[0])) { | ||||
| 77186 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77187 | return; | ||||
| 77188 | } | ||||
| 77189 | } | ||||
| 77190 | |||||
| 77191 | void | ||||
| 77192 | TestJSImplInterfaceJSImpl::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77193 | { | ||||
| 77194 | CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77195 | if (aRv.Failed()) { | ||||
| 77196 | return; | ||||
| 77197 | } | ||||
| 77198 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77198); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77198; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77199 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77200 | |||||
| 77201 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77202 | if (!argv.resize(1)) { | ||||
| 77203 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77204 | // the right thing with that. | ||||
| 77205 | return; | ||||
| 77206 | } | ||||
| 77207 | do { | ||||
| 77208 | argv[0].setBoolean(arg); | ||||
| 77209 | break; | ||||
| 77210 | } while (false); | ||||
| 77211 | |||||
| 77212 | 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", 77212); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77212; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77213 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77214 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77215 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77216 | !InitIds(cx, atomsCache)) || | ||||
| 77217 | !JS_SetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, argv[0])) { | ||||
| 77218 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77219 | return; | ||||
| 77220 | } | ||||
| 77221 | } | ||||
| 77222 | |||||
| 77223 | void | ||||
| 77224 | TestJSImplInterfaceJSImpl::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77225 | { | ||||
| 77226 | CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77227 | if (aRv.Failed()) { | ||||
| 77228 | return; | ||||
| 77229 | } | ||||
| 77230 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77230); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77230; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77231 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77232 | |||||
| 77233 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77234 | if (!argv.resize(1)) { | ||||
| 77235 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77236 | // the right thing with that. | ||||
| 77237 | return; | ||||
| 77238 | } | ||||
| 77239 | do { | ||||
| 77240 | argv[0].setBoolean(arg); | ||||
| 77241 | break; | ||||
| 77242 | } while (false); | ||||
| 77243 | |||||
| 77244 | 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", 77244); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77244; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77245 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77246 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77247 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77248 | !InitIds(cx, atomsCache)) || | ||||
| 77249 | !JS_SetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, argv[0])) { | ||||
| 77250 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77251 | return; | ||||
| 77252 | } | ||||
| 77253 | } | ||||
| 77254 | |||||
| 77255 | void | ||||
| 77256 | TestJSImplInterfaceJSImpl::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77257 | { | ||||
| 77258 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77259 | if (aRv.Failed()) { | ||||
| 77260 | return; | ||||
| 77261 | } | ||||
| 77262 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77262); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77262; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77263 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77264 | |||||
| 77265 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77266 | if (!argv.resize(1)) { | ||||
| 77267 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77268 | // the right thing with that. | ||||
| 77269 | return; | ||||
| 77270 | } | ||||
| 77271 | do { | ||||
| 77272 | argv[0].setBoolean(arg); | ||||
| 77273 | break; | ||||
| 77274 | } while (false); | ||||
| 77275 | |||||
| 77276 | 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", 77276); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77276; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77277 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77278 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77279 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77280 | !InitIds(cx, atomsCache)) || | ||||
| 77281 | !JS_SetPropertyById(cx, callback, atomsCache->canOOMAttr_id, argv[0])) { | ||||
| 77282 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77283 | return; | ||||
| 77284 | } | ||||
| 77285 | } | ||||
| 77286 | |||||
| 77287 | void | ||||
| 77288 | TestJSImplInterfaceJSImpl::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77289 | { | ||||
| 77290 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77291 | if (aRv.Failed()) { | ||||
| 77292 | return; | ||||
| 77293 | } | ||||
| 77294 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77294); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77294; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77295 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77296 | |||||
| 77297 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77298 | if (!argv.resize(1)) { | ||||
| 77299 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77300 | // the right thing with that. | ||||
| 77301 | return; | ||||
| 77302 | } | ||||
| 77303 | do { | ||||
| 77304 | argv[0].setBoolean(arg); | ||||
| 77305 | break; | ||||
| 77306 | } while (false); | ||||
| 77307 | |||||
| 77308 | 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", 77308); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77308; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77309 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77310 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77311 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77312 | !InitIds(cx, atomsCache)) || | ||||
| 77313 | !JS_SetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, argv[0])) { | ||||
| 77314 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77315 | return; | ||||
| 77316 | } | ||||
| 77317 | } | ||||
| 77318 | |||||
| 77319 | void | ||||
| 77320 | TestJSImplInterfaceJSImpl::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77321 | { | ||||
| 77322 | CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77323 | if (aRv.Failed()) { | ||||
| 77324 | return; | ||||
| 77325 | } | ||||
| 77326 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77326); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77326; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77327 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77328 | |||||
| 77329 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77330 | if (!argv.resize(1)) { | ||||
| 77331 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77332 | // the right thing with that. | ||||
| 77333 | return; | ||||
| 77334 | } | ||||
| 77335 | do { | ||||
| 77336 | argv[0].setBoolean(arg); | ||||
| 77337 | break; | ||||
| 77338 | } while (false); | ||||
| 77339 | |||||
| 77340 | 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", 77340); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77340; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77341 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77342 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77343 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77344 | !InitIds(cx, atomsCache)) || | ||||
| 77345 | !JS_SetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, argv[0])) { | ||||
| 77346 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77347 | return; | ||||
| 77348 | } | ||||
| 77349 | } | ||||
| 77350 | |||||
| 77351 | void | ||||
| 77352 | TestJSImplInterfaceJSImpl::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77353 | { | ||||
| 77354 | CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77355 | if (aRv.Failed()) { | ||||
| 77356 | return; | ||||
| 77357 | } | ||||
| 77358 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77358); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77358; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77359 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77360 | |||||
| 77361 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77362 | if (!argv.resize(1)) { | ||||
| 77363 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77364 | // the right thing with that. | ||||
| 77365 | return; | ||||
| 77366 | } | ||||
| 77367 | do { | ||||
| 77368 | argv[0].setBoolean(arg); | ||||
| 77369 | break; | ||||
| 77370 | } while (false); | ||||
| 77371 | |||||
| 77372 | 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", 77372); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77372; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77373 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77374 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77375 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77376 | !InitIds(cx, atomsCache)) || | ||||
| 77377 | !JS_SetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, argv[0])) { | ||||
| 77378 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77379 | return; | ||||
| 77380 | } | ||||
| 77381 | } | ||||
| 77382 | |||||
| 77383 | void | ||||
| 77384 | TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77385 | { | ||||
| 77386 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77387 | if (aRv.Failed()) { | ||||
| 77388 | return; | ||||
| 77389 | } | ||||
| 77390 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77390); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77390; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77391 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77392 | |||||
| 77393 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77394 | if (!argv.resize(1)) { | ||||
| 77395 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77396 | // the right thing with that. | ||||
| 77397 | return; | ||||
| 77398 | } | ||||
| 77399 | do { | ||||
| 77400 | JS::ExposeValueToActiveJS(arg); | ||||
| 77401 | argv[0].set(arg); | ||||
| 77402 | if (!MaybeWrapValue(cx, argv[0])) { | ||||
| 77403 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77404 | return; | ||||
| 77405 | } | ||||
| 77406 | break; | ||||
| 77407 | } while (false); | ||||
| 77408 | |||||
| 77409 | 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", 77409); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77409; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77410 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77411 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77412 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77413 | !InitIds(cx, atomsCache)) || | ||||
| 77414 | !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, argv[0])) { | ||||
| 77415 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77416 | return; | ||||
| 77417 | } | ||||
| 77418 | } | ||||
| 77419 | |||||
| 77420 | void | ||||
| 77421 | TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77422 | { | ||||
| 77423 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77424 | if (aRv.Failed()) { | ||||
| 77425 | return; | ||||
| 77426 | } | ||||
| 77427 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77427); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77427; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77428 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77429 | |||||
| 77430 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77431 | if (!argv.resize(1)) { | ||||
| 77432 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77433 | // the right thing with that. | ||||
| 77434 | return; | ||||
| 77435 | } | ||||
| 77436 | do { | ||||
| 77437 | if (!GetOrCreateDOMReflector(cx, arg, argv[0])) { | ||||
| 77438 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 77438); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 77438; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77439 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77440 | return; | ||||
| 77441 | } | ||||
| 77442 | break; | ||||
| 77443 | } while (false); | ||||
| 77444 | |||||
| 77445 | 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", 77445); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77445; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77446 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77447 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77448 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77449 | !InitIds(cx, atomsCache)) || | ||||
| 77450 | !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, argv[0])) { | ||||
| 77451 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77452 | return; | ||||
| 77453 | } | ||||
| 77454 | } | ||||
| 77455 | |||||
| 77456 | void | ||||
| 77457 | TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77458 | { | ||||
| 77459 | CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77460 | if (aRv.Failed()) { | ||||
| 77461 | return; | ||||
| 77462 | } | ||||
| 77463 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77463); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77463; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77464 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77465 | |||||
| 77466 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77467 | if (!argv.resize(1)) { | ||||
| 77468 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77469 | // the right thing with that. | ||||
| 77470 | return; | ||||
| 77471 | } | ||||
| 77472 | do { | ||||
| 77473 | argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg)); | ||||
| 77474 | if (!MaybeWrapObjectValue(cx, argv[0])) { | ||||
| 77475 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77476 | return; | ||||
| 77477 | } | ||||
| 77478 | break; | ||||
| 77479 | } while (false); | ||||
| 77480 | |||||
| 77481 | 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", 77481); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77481; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77482 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77483 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77484 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77485 | !InitIds(cx, atomsCache)) || | ||||
| 77486 | !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, argv[0])) { | ||||
| 77487 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77488 | return; | ||||
| 77489 | } | ||||
| 77490 | } | ||||
| 77491 | |||||
| 77492 | void | ||||
| 77493 | TestJSImplInterfaceJSImpl::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77494 | { | ||||
| 77495 | CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77496 | if (aRv.Failed()) { | ||||
| 77497 | return; | ||||
| 77498 | } | ||||
| 77499 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77499); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77499; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77500 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77501 | |||||
| 77502 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77503 | if (!argv.resize(1)) { | ||||
| 77504 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77505 | // the right thing with that. | ||||
| 77506 | return; | ||||
| 77507 | } | ||||
| 77508 | do { | ||||
| 77509 | argv[0].setInt32(int32_t(arg)); | ||||
| 77510 | break; | ||||
| 77511 | } while (false); | ||||
| 77512 | |||||
| 77513 | 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", 77513); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77513; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77514 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77515 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77516 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77517 | !InitIds(cx, atomsCache)) || | ||||
| 77518 | !JS_SetPropertyById(cx, callback, atomsCache->dashed_attribute_id, argv[0])) { | ||||
| 77519 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77520 | return; | ||||
| 77521 | } | ||||
| 77522 | } | ||||
| 77523 | |||||
| 77524 | void | ||||
| 77525 | TestJSImplInterfaceJSImpl::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77526 | { | ||||
| 77527 | CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77528 | if (aRv.Failed()) { | ||||
| 77529 | return; | ||||
| 77530 | } | ||||
| 77531 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77531); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77531; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77532 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77533 | |||||
| 77534 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77535 | if (!argv.resize(1)) { | ||||
| 77536 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77537 | // the right thing with that. | ||||
| 77538 | return; | ||||
| 77539 | } | ||||
| 77540 | do { | ||||
| 77541 | argv[0].setBoolean(arg); | ||||
| 77542 | break; | ||||
| 77543 | } while (false); | ||||
| 77544 | |||||
| 77545 | 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", 77545); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77545; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77546 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77547 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77548 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77549 | !InitIds(cx, atomsCache)) || | ||||
| 77550 | !JS_SetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, argv[0])) { | ||||
| 77551 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77552 | return; | ||||
| 77553 | } | ||||
| 77554 | } | ||||
| 77555 | |||||
| 77556 | void | ||||
| 77557 | TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77558 | { | ||||
| 77559 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77560 | if (aRv.Failed()) { | ||||
| 77561 | return; | ||||
| 77562 | } | ||||
| 77563 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77563); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77563; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77564 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77565 | |||||
| 77566 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77567 | if (!argv.resize(1)) { | ||||
| 77568 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77569 | // the right thing with that. | ||||
| 77570 | return; | ||||
| 77571 | } | ||||
| 77572 | do { | ||||
| 77573 | argv[0].setObject(*arg.Obj()); | ||||
| 77574 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 77575 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77576 | return; | ||||
| 77577 | } | ||||
| 77578 | break; | ||||
| 77579 | } while (false); | ||||
| 77580 | |||||
| 77581 | 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", 77581); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77581; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77582 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77583 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77584 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77585 | !InitIds(cx, atomsCache)) || | ||||
| 77586 | !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, argv[0])) { | ||||
| 77587 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77588 | return; | ||||
| 77589 | } | ||||
| 77590 | } | ||||
| 77591 | |||||
| 77592 | void | ||||
| 77593 | TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77594 | { | ||||
| 77595 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77596 | if (aRv.Failed()) { | ||||
| 77597 | return; | ||||
| 77598 | } | ||||
| 77599 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77599); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77599; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77600 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77601 | |||||
| 77602 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77603 | if (!argv.resize(1)) { | ||||
| 77604 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77605 | // the right thing with that. | ||||
| 77606 | return; | ||||
| 77607 | } | ||||
| 77608 | do { | ||||
| 77609 | argv[0].setObject(*arg.Obj()); | ||||
| 77610 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 77611 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77612 | return; | ||||
| 77613 | } | ||||
| 77614 | break; | ||||
| 77615 | } while (false); | ||||
| 77616 | |||||
| 77617 | 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", 77617); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77617; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77618 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77619 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77620 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77621 | !InitIds(cx, atomsCache)) || | ||||
| 77622 | !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, argv[0])) { | ||||
| 77623 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77624 | return; | ||||
| 77625 | } | ||||
| 77626 | } | ||||
| 77627 | |||||
| 77628 | void | ||||
| 77629 | TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77630 | { | ||||
| 77631 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77632 | if (aRv.Failed()) { | ||||
| 77633 | return; | ||||
| 77634 | } | ||||
| 77635 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77635); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77635; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77636 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77637 | |||||
| 77638 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77639 | if (!argv.resize(1)) { | ||||
| 77640 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77641 | // the right thing with that. | ||||
| 77642 | return; | ||||
| 77643 | } | ||||
| 77644 | do { | ||||
| 77645 | if (arg.IsNull()) { | ||||
| 77646 | argv[0].setNull(); | ||||
| 77647 | break; | ||||
| 77648 | } | ||||
| 77649 | argv[0].setObject(*arg.Value().Obj()); | ||||
| 77650 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 77651 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77652 | return; | ||||
| 77653 | } | ||||
| 77654 | break; | ||||
| 77655 | } while (false); | ||||
| 77656 | |||||
| 77657 | 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", 77657); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77657; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77658 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77659 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77660 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77661 | !InitIds(cx, atomsCache)) || | ||||
| 77662 | !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, argv[0])) { | ||||
| 77663 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77664 | return; | ||||
| 77665 | } | ||||
| 77666 | } | ||||
| 77667 | |||||
| 77668 | void | ||||
| 77669 | TestJSImplInterfaceJSImpl::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77670 | { | ||||
| 77671 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77672 | if (aRv.Failed()) { | ||||
| 77673 | return; | ||||
| 77674 | } | ||||
| 77675 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77675); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77675; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77676 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77677 | |||||
| 77678 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77679 | if (!argv.resize(1)) { | ||||
| 77680 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77681 | // the right thing with that. | ||||
| 77682 | return; | ||||
| 77683 | } | ||||
| 77684 | do { | ||||
| 77685 | argv[0].setObject(*arg.Obj()); | ||||
| 77686 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 77687 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77688 | return; | ||||
| 77689 | } | ||||
| 77690 | break; | ||||
| 77691 | } while (false); | ||||
| 77692 | |||||
| 77693 | 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", 77693); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77693; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77694 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77695 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77696 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77697 | !InitIds(cx, atomsCache)) || | ||||
| 77698 | !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, argv[0])) { | ||||
| 77699 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77700 | return; | ||||
| 77701 | } | ||||
| 77702 | } | ||||
| 77703 | |||||
| 77704 | void | ||||
| 77705 | TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77706 | { | ||||
| 77707 | CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true); | ||||
| 77708 | if (aRv.Failed()) { | ||||
| 77709 | return; | ||||
| 77710 | } | ||||
| 77711 | MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(s.GetContext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s.GetContext()" , "../TestJSImplGenBinding.cpp", 77711); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int *)__null) = 77711; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77712 | BindingCallContext& cx = s.GetCallContext(); | ||||
| 77713 | |||||
| 77714 | JS::RootedVector<JS::Value> argv(cx); | ||||
| 77715 | if (!argv.resize(1)) { | ||||
| 77716 | // That threw an exception on the JSContext, and our CallSetup will do | ||||
| 77717 | // the right thing with that. | ||||
| 77718 | return; | ||||
| 77719 | } | ||||
| 77720 | do { | ||||
| 77721 | if (arg.IsNull()) { | ||||
| 77722 | argv[0].setNull(); | ||||
| 77723 | break; | ||||
| 77724 | } | ||||
| 77725 | argv[0].setObject(*arg.Value().Obj()); | ||||
| 77726 | if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) { | ||||
| 77727 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77728 | return; | ||||
| 77729 | } | ||||
| 77730 | break; | ||||
| 77731 | } while (false); | ||||
| 77732 | |||||
| 77733 | 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", 77733); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile int*)__null) = 77733; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77734 | JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray()); | ||||
| 77735 | TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx); | ||||
| 77736 | if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() && | ||||
| 77737 | !InitIds(cx, atomsCache)) || | ||||
| 77738 | !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBuffer_id, argv[0])) { | ||||
| 77739 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77740 | return; | ||||
| 77741 | } | ||||
| 77742 | } | ||||
| 77743 | |||||
| 77744 | |||||
| 77745 | NS_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); } | ||||
| 77746 | NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplInterface)void TestJSImplInterface::cycleCollection::Unlink(void* p) { TestJSImplInterface * tmp = DowncastCCParticipant<TestJSImplInterface>(p); | ||||
| 77747 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl); | ||||
| 77748 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent); | ||||
| 77749 | NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p); | ||||
| 77750 | tmp->ClearWeakReferences(); | ||||
| 77751 | NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; } | ||||
| 77752 | NS_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" ); | ||||
| 77753 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0); | ||||
| 77754 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0 ); | ||||
| 77755 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; } | ||||
| 77756 | NS_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", 77756 ); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0" ") (" "illegal refcnt" ")"); do { *((volatile int*)__null) = 77756; __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; } | ||||
| 77757 | NS_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", 77757 ); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0" ") (" "dup release" ")"); do { *((volatile int*)__null) = 77757 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); _mOwningThread.AssertOwnership("TestJSImplInterface" " not thread-safe"); nsISupports* base = TestJSImplInterface ::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr (base); NS_LogRelease((this), (count), ("TestJSImplInterface" )); return count; } void TestJSImplInterface::DeleteCycleCollectable (void) { delete (this); } | ||||
| 77758 | NS_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", 77758); MOZ_PretendNoReturn (); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals ( aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant , void>::kIID), (nsCycleCollectionISupports::COMTypeInfo< nsCycleCollectionISupports, void>::kIID)) && (LowWordEquals (aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant , void>::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports ::COMTypeInfo<nsCycleCollectionISupports, void>::kIID)) )) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant ::COMTypeInfo<nsXPCOMCycleCollectionParticipant, void>:: kIID))) { *aInstancePtr = TestJSImplInterface::cycleCollection ::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, ( nsCycleCollectionISupports::COMTypeInfo<nsCycleCollectionISupports , void>::kIID))) { *aInstancePtr = TestJSImplInterface::cycleCollection ::Upcast(this); return NS_OK; } foundInterface = nullptr; } else | ||||
| 77759 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::COMTypeInfo<nsWrapperCache , void>::kIID))) { *aInstancePtr = static_cast<nsWrapperCache *>(this); return NS_OK; } else | ||||
| 77760 | NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t <decltype(*this)>, nsISupports>)) foundInterface = static_cast <nsISupports*>(this); else | ||||
| 77761 | NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t <decltype(*this)>, nsISupportsWeakReference>)) foundInterface = static_cast<nsISupportsWeakReference*>(this); else | ||||
| 77762 | NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aIID.Equals((nsISupports::COMTypeInfo<nsISupports , void>::kIID)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::COMTypeInfo <nsISupports, void>::kIID))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))" , "../TestJSImplGenBinding.cpp", 77762); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))" ")"); do { *((volatile int*)__null) = 77762; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); status = NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status = NS_OK; } *aInstancePtr = foundInterface; return status; } | ||||
| 77763 | |||||
| 77764 | TestJSImplInterface::TestJSImplInterface(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent) | ||||
| 77765 | : mImpl(new TestJSImplInterfaceJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)), | ||||
| 77766 | mParent(aParent) | ||||
| 77767 | { | ||||
| 77768 | } | ||||
| 77769 | |||||
| 77770 | |||||
| 77771 | TestJSImplInterface::~TestJSImplInterface() | ||||
| 77772 | { | ||||
| 77773 | } | ||||
| 77774 | |||||
| 77775 | nsISupports* | ||||
| 77776 | TestJSImplInterface::GetParentObject() const | ||||
| 77777 | { | ||||
| 77778 | return mParent; | ||||
| 77779 | } | ||||
| 77780 | |||||
| 77781 | DocGroup* | ||||
| 77782 | TestJSImplInterface::GetDocGroup() const | ||||
| 77783 | { | ||||
| 77784 | nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(mParent); | ||||
| 77785 | if (!window) { | ||||
| 77786 | return nullptr; | ||||
| 77787 | } | ||||
| 77788 | return window->GetDocGroup(); | ||||
| 77789 | } | ||||
| 77790 | |||||
| 77791 | JSObject* | ||||
| 77792 | TestJSImplInterface::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) | ||||
| 77793 | { | ||||
| 77794 | JS::Rooted<JSObject*> obj(aCx, TestJSImplInterface_Binding::Wrap(aCx, this, aGivenProto)); | ||||
| 77795 | if (!obj) { | ||||
| 77796 | return nullptr; | ||||
| 77797 | } | ||||
| 77798 | |||||
| 77799 | // Now define it on our chrome object | ||||
| 77800 | JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull()); | ||||
| 77801 | if (!JS_WrapObject(aCx, &obj)) { | ||||
| 77802 | return nullptr; | ||||
| 77803 | } | ||||
| 77804 | JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull()); | ||||
| 77805 | if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) { | ||||
| 77806 | return nullptr; | ||||
| 77807 | } | ||||
| 77808 | return obj; | ||||
| 77809 | } | ||||
| 77810 | |||||
| 77811 | already_AddRefed<TestJSImplInterface> | ||||
| 77812 | TestJSImplInterface::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) | ||||
| 77813 | { | ||||
| 77814 | RefPtr<TestJSImplInterface> impl = | ||||
| 77815 | ConstructJSImplementation<TestJSImplInterface>("@mozilla.org/test-js-impl-interface;1", global, aRv); | ||||
| 77816 | if (aRv.Failed()) { | ||||
| 77817 | return nullptr; | ||||
| 77818 | } | ||||
| 77819 | // Wrap the object before calling __Init so that __DOM_IMPL__ is available. | ||||
| 77820 | JS::Rooted<JSObject*> scopeObj(cx, global.Get()); | ||||
| 77821 | 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", 77821); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(scopeObj, cx)" ")"); do { *((volatile int*)__null) = 77821; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77822 | JS::Rooted<JS::Value> wrappedVal(cx); | ||||
| 77823 | if (!GetOrCreateDOMReflector(cx, impl, &wrappedVal, aGivenProto)) { | ||||
| 77824 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestJSImplGenBinding.cpp", 77824); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 77824; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 77825 | aRv.Throw(NS_ERROR_UNEXPECTED); | ||||
| 77826 | return nullptr; | ||||
| 77827 | } | ||||
| 77828 | // Initialize the object with the constructor arguments. | ||||
| 77829 | impl->mImpl->__Init(str, num, boolArg, iface, arg1, dict, any1, obj1, obj2, seq, any2, obj3, obj4, typedArr, arrayBuf, aRv, js::GetNonCCWObjectRealm(scopeObj)); | ||||
| 77830 | if (aRv.Failed()) { | ||||
| 77831 | return nullptr; | ||||
| 77832 | } | ||||
| 77833 | return impl.forget(); | ||||
| 77834 | } | ||||
| 77835 | |||||
| 77836 | int8_t | ||||
| 77837 | TestJSImplInterface::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77838 | { | ||||
| 77839 | return mImpl->GetReadonlyByte(aRv, aRealm); | ||||
| 77840 | } | ||||
| 77841 | |||||
| 77842 | int8_t | ||||
| 77843 | TestJSImplInterface::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77844 | { | ||||
| 77845 | return mImpl->GetWritableByte(aRv, aRealm); | ||||
| 77846 | } | ||||
| 77847 | |||||
| 77848 | void | ||||
| 77849 | TestJSImplInterface::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77850 | { | ||||
| 77851 | mImpl->SetWritableByte(arg, aRv, aRealm); | ||||
| 77852 | } | ||||
| 77853 | |||||
| 77854 | void | ||||
| 77855 | TestJSImplInterface::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77856 | { | ||||
| 77857 | return mImpl->PassByte(arg, aRv, aRealm); | ||||
| 77858 | } | ||||
| 77859 | |||||
| 77860 | int8_t | ||||
| 77861 | TestJSImplInterface::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77862 | { | ||||
| 77863 | return mImpl->ReceiveByte(aRv, aRealm); | ||||
| 77864 | } | ||||
| 77865 | |||||
| 77866 | void | ||||
| 77867 | TestJSImplInterface::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77868 | { | ||||
| 77869 | return mImpl->PassOptionalByte(arg, aRv, aRealm); | ||||
| 77870 | } | ||||
| 77871 | |||||
| 77872 | void | ||||
| 77873 | TestJSImplInterface::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77874 | { | ||||
| 77875 | return mImpl->PassOptionalByteBeforeRequired(arg1, arg2, aRv, aRealm); | ||||
| 77876 | } | ||||
| 77877 | |||||
| 77878 | void | ||||
| 77879 | TestJSImplInterface::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77880 | { | ||||
| 77881 | return mImpl->PassOptionalByteWithDefault(arg, aRv, aRealm); | ||||
| 77882 | } | ||||
| 77883 | |||||
| 77884 | void | ||||
| 77885 | TestJSImplInterface::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77886 | { | ||||
| 77887 | return mImpl->PassOptionalByteWithDefaultBeforeRequired(arg1, arg2, aRv, aRealm); | ||||
| 77888 | } | ||||
| 77889 | |||||
| 77890 | void | ||||
| 77891 | TestJSImplInterface::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77892 | { | ||||
| 77893 | return mImpl->PassNullableByte(arg, aRv, aRealm); | ||||
| 77894 | } | ||||
| 77895 | |||||
| 77896 | void | ||||
| 77897 | TestJSImplInterface::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77898 | { | ||||
| 77899 | return mImpl->PassOptionalNullableByte(arg, aRv, aRealm); | ||||
| 77900 | } | ||||
| 77901 | |||||
| 77902 | void | ||||
| 77903 | TestJSImplInterface::PassVariadicByte(const Sequence<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77904 | { | ||||
| 77905 | return mImpl->PassVariadicByte(arg, aRv, aRealm); | ||||
| 77906 | } | ||||
| 77907 | |||||
| 77908 | int8_t | ||||
| 77909 | TestJSImplInterface::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77910 | { | ||||
| 77911 | return mImpl->GetSideEffectFreeByte(aRv, aRealm); | ||||
| 77912 | } | ||||
| 77913 | |||||
| 77914 | void | ||||
| 77915 | TestJSImplInterface::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77916 | { | ||||
| 77917 | mImpl->SetSideEffectFreeByte(arg, aRv, aRealm); | ||||
| 77918 | } | ||||
| 77919 | |||||
| 77920 | int8_t | ||||
| 77921 | TestJSImplInterface::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77922 | { | ||||
| 77923 | return mImpl->GetDomDependentByte(aRv, aRealm); | ||||
| 77924 | } | ||||
| 77925 | |||||
| 77926 | void | ||||
| 77927 | TestJSImplInterface::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77928 | { | ||||
| 77929 | mImpl->SetDomDependentByte(arg, aRv, aRealm); | ||||
| 77930 | } | ||||
| 77931 | |||||
| 77932 | int8_t | ||||
| 77933 | TestJSImplInterface::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77934 | { | ||||
| 77935 | return mImpl->GetConstantByte(aRv, aRealm); | ||||
| 77936 | } | ||||
| 77937 | |||||
| 77938 | int8_t | ||||
| 77939 | TestJSImplInterface::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77940 | { | ||||
| 77941 | return mImpl->GetDeviceStateDependentByte(aRv, aRealm); | ||||
| 77942 | } | ||||
| 77943 | |||||
| 77944 | int8_t | ||||
| 77945 | TestJSImplInterface::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77946 | { | ||||
| 77947 | return mImpl->ReturnByteSideEffectFree(aRv, aRealm); | ||||
| 77948 | } | ||||
| 77949 | |||||
| 77950 | int8_t | ||||
| 77951 | TestJSImplInterface::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77952 | { | ||||
| 77953 | return mImpl->ReturnDOMDependentByte(aRv, aRealm); | ||||
| 77954 | } | ||||
| 77955 | |||||
| 77956 | int8_t | ||||
| 77957 | TestJSImplInterface::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77958 | { | ||||
| 77959 | return mImpl->ReturnConstantByte(aRv, aRealm); | ||||
| 77960 | } | ||||
| 77961 | |||||
| 77962 | int8_t | ||||
| 77963 | TestJSImplInterface::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77964 | { | ||||
| 77965 | return mImpl->ReturnDeviceStateDependentByte(aRv, aRealm); | ||||
| 77966 | } | ||||
| 77967 | |||||
| 77968 | int16_t | ||||
| 77969 | TestJSImplInterface::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77970 | { | ||||
| 77971 | return mImpl->GetReadonlyShort(aRv, aRealm); | ||||
| 77972 | } | ||||
| 77973 | |||||
| 77974 | int16_t | ||||
| 77975 | TestJSImplInterface::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 77976 | { | ||||
| 77977 | return mImpl->GetWritableShort(aRv, aRealm); | ||||
| 77978 | } | ||||
| 77979 | |||||
| 77980 | void | ||||
| 77981 | TestJSImplInterface::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77982 | { | ||||
| 77983 | mImpl->SetWritableShort(arg, aRv, aRealm); | ||||
| 77984 | } | ||||
| 77985 | |||||
| 77986 | void | ||||
| 77987 | TestJSImplInterface::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77988 | { | ||||
| 77989 | return mImpl->PassShort(arg, aRv, aRealm); | ||||
| 77990 | } | ||||
| 77991 | |||||
| 77992 | int16_t | ||||
| 77993 | TestJSImplInterface::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 77994 | { | ||||
| 77995 | return mImpl->ReceiveShort(aRv, aRealm); | ||||
| 77996 | } | ||||
| 77997 | |||||
| 77998 | void | ||||
| 77999 | TestJSImplInterface::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78000 | { | ||||
| 78001 | return mImpl->PassOptionalShort(arg, aRv, aRealm); | ||||
| 78002 | } | ||||
| 78003 | |||||
| 78004 | void | ||||
| 78005 | TestJSImplInterface::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78006 | { | ||||
| 78007 | return mImpl->PassOptionalShortWithDefault(arg, aRv, aRealm); | ||||
| 78008 | } | ||||
| 78009 | |||||
| 78010 | int32_t | ||||
| 78011 | TestJSImplInterface::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78012 | { | ||||
| 78013 | return mImpl->GetReadonlyLong(aRv, aRealm); | ||||
| 78014 | } | ||||
| 78015 | |||||
| 78016 | int32_t | ||||
| 78017 | TestJSImplInterface::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78018 | { | ||||
| 78019 | return mImpl->GetWritableLong(aRv, aRealm); | ||||
| 78020 | } | ||||
| 78021 | |||||
| 78022 | void | ||||
| 78023 | TestJSImplInterface::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78024 | { | ||||
| 78025 | mImpl->SetWritableLong(arg, aRv, aRealm); | ||||
| 78026 | } | ||||
| 78027 | |||||
| 78028 | void | ||||
| 78029 | TestJSImplInterface::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78030 | { | ||||
| 78031 | return mImpl->PassLong(arg, aRv, aRealm); | ||||
| 78032 | } | ||||
| 78033 | |||||
| 78034 | int32_t | ||||
| 78035 | TestJSImplInterface::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78036 | { | ||||
| 78037 | return mImpl->ReceiveLong(aRv, aRealm); | ||||
| 78038 | } | ||||
| 78039 | |||||
| 78040 | void | ||||
| 78041 | TestJSImplInterface::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78042 | { | ||||
| 78043 | return mImpl->PassOptionalLong(arg, aRv, aRealm); | ||||
| 78044 | } | ||||
| 78045 | |||||
| 78046 | void | ||||
| 78047 | TestJSImplInterface::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78048 | { | ||||
| 78049 | return mImpl->PassOptionalLongWithDefault(arg, aRv, aRealm); | ||||
| 78050 | } | ||||
| 78051 | |||||
| 78052 | int64_t | ||||
| 78053 | TestJSImplInterface::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78054 | { | ||||
| 78055 | return mImpl->GetReadonlyLongLong(aRv, aRealm); | ||||
| 78056 | } | ||||
| 78057 | |||||
| 78058 | int64_t | ||||
| 78059 | TestJSImplInterface::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78060 | { | ||||
| 78061 | return mImpl->GetWritableLongLong(aRv, aRealm); | ||||
| 78062 | } | ||||
| 78063 | |||||
| 78064 | void | ||||
| 78065 | TestJSImplInterface::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78066 | { | ||||
| 78067 | mImpl->SetWritableLongLong(arg, aRv, aRealm); | ||||
| 78068 | } | ||||
| 78069 | |||||
| 78070 | void | ||||
| 78071 | TestJSImplInterface::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78072 | { | ||||
| 78073 | return mImpl->PassLongLong(arg, aRv, aRealm); | ||||
| 78074 | } | ||||
| 78075 | |||||
| 78076 | int64_t | ||||
| 78077 | TestJSImplInterface::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78078 | { | ||||
| 78079 | return mImpl->ReceiveLongLong(aRv, aRealm); | ||||
| 78080 | } | ||||
| 78081 | |||||
| 78082 | void | ||||
| 78083 | TestJSImplInterface::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78084 | { | ||||
| 78085 | return mImpl->PassOptionalLongLong(arg, aRv, aRealm); | ||||
| 78086 | } | ||||
| 78087 | |||||
| 78088 | void | ||||
| 78089 | TestJSImplInterface::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78090 | { | ||||
| 78091 | return mImpl->PassOptionalLongLongWithDefault(arg, aRv, aRealm); | ||||
| 78092 | } | ||||
| 78093 | |||||
| 78094 | uint8_t | ||||
| 78095 | TestJSImplInterface::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78096 | { | ||||
| 78097 | return mImpl->GetReadonlyOctet(aRv, aRealm); | ||||
| 78098 | } | ||||
| 78099 | |||||
| 78100 | uint8_t | ||||
| 78101 | TestJSImplInterface::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78102 | { | ||||
| 78103 | return mImpl->GetWritableOctet(aRv, aRealm); | ||||
| 78104 | } | ||||
| 78105 | |||||
| 78106 | void | ||||
| 78107 | TestJSImplInterface::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78108 | { | ||||
| 78109 | mImpl->SetWritableOctet(arg, aRv, aRealm); | ||||
| 78110 | } | ||||
| 78111 | |||||
| 78112 | void | ||||
| 78113 | TestJSImplInterface::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78114 | { | ||||
| 78115 | return mImpl->PassOctet(arg, aRv, aRealm); | ||||
| 78116 | } | ||||
| 78117 | |||||
| 78118 | uint8_t | ||||
| 78119 | TestJSImplInterface::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78120 | { | ||||
| 78121 | return mImpl->ReceiveOctet(aRv, aRealm); | ||||
| 78122 | } | ||||
| 78123 | |||||
| 78124 | void | ||||
| 78125 | TestJSImplInterface::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78126 | { | ||||
| 78127 | return mImpl->PassOptionalOctet(arg, aRv, aRealm); | ||||
| 78128 | } | ||||
| 78129 | |||||
| 78130 | void | ||||
| 78131 | TestJSImplInterface::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78132 | { | ||||
| 78133 | return mImpl->PassOptionalOctetWithDefault(arg, aRv, aRealm); | ||||
| 78134 | } | ||||
| 78135 | |||||
| 78136 | uint16_t | ||||
| 78137 | TestJSImplInterface::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78138 | { | ||||
| 78139 | return mImpl->GetReadonlyUnsignedShort(aRv, aRealm); | ||||
| 78140 | } | ||||
| 78141 | |||||
| 78142 | uint16_t | ||||
| 78143 | TestJSImplInterface::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78144 | { | ||||
| 78145 | return mImpl->GetWritableUnsignedShort(aRv, aRealm); | ||||
| 78146 | } | ||||
| 78147 | |||||
| 78148 | void | ||||
| 78149 | TestJSImplInterface::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78150 | { | ||||
| 78151 | mImpl->SetWritableUnsignedShort(arg, aRv, aRealm); | ||||
| 78152 | } | ||||
| 78153 | |||||
| 78154 | void | ||||
| 78155 | TestJSImplInterface::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78156 | { | ||||
| 78157 | return mImpl->PassUnsignedShort(arg, aRv, aRealm); | ||||
| 78158 | } | ||||
| 78159 | |||||
| 78160 | uint16_t | ||||
| 78161 | TestJSImplInterface::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78162 | { | ||||
| 78163 | return mImpl->ReceiveUnsignedShort(aRv, aRealm); | ||||
| 78164 | } | ||||
| 78165 | |||||
| 78166 | void | ||||
| 78167 | TestJSImplInterface::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78168 | { | ||||
| 78169 | return mImpl->PassOptionalUnsignedShort(arg, aRv, aRealm); | ||||
| 78170 | } | ||||
| 78171 | |||||
| 78172 | void | ||||
| 78173 | TestJSImplInterface::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78174 | { | ||||
| 78175 | return mImpl->PassOptionalUnsignedShortWithDefault(arg, aRv, aRealm); | ||||
| 78176 | } | ||||
| 78177 | |||||
| 78178 | uint32_t | ||||
| 78179 | TestJSImplInterface::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78180 | { | ||||
| 78181 | return mImpl->GetReadonlyUnsignedLong(aRv, aRealm); | ||||
| 78182 | } | ||||
| 78183 | |||||
| 78184 | uint32_t | ||||
| 78185 | TestJSImplInterface::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78186 | { | ||||
| 78187 | return mImpl->GetWritableUnsignedLong(aRv, aRealm); | ||||
| 78188 | } | ||||
| 78189 | |||||
| 78190 | void | ||||
| 78191 | TestJSImplInterface::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78192 | { | ||||
| 78193 | mImpl->SetWritableUnsignedLong(arg, aRv, aRealm); | ||||
| 78194 | } | ||||
| 78195 | |||||
| 78196 | void | ||||
| 78197 | TestJSImplInterface::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78198 | { | ||||
| 78199 | return mImpl->PassUnsignedLong(arg, aRv, aRealm); | ||||
| 78200 | } | ||||
| 78201 | |||||
| 78202 | uint32_t | ||||
| 78203 | TestJSImplInterface::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78204 | { | ||||
| 78205 | return mImpl->ReceiveUnsignedLong(aRv, aRealm); | ||||
| 78206 | } | ||||
| 78207 | |||||
| 78208 | void | ||||
| 78209 | TestJSImplInterface::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78210 | { | ||||
| 78211 | return mImpl->PassOptionalUnsignedLong(arg, aRv, aRealm); | ||||
| 78212 | } | ||||
| 78213 | |||||
| 78214 | void | ||||
| 78215 | TestJSImplInterface::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78216 | { | ||||
| 78217 | return mImpl->PassOptionalUnsignedLongWithDefault(arg, aRv, aRealm); | ||||
| 78218 | } | ||||
| 78219 | |||||
| 78220 | uint64_t | ||||
| 78221 | TestJSImplInterface::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78222 | { | ||||
| 78223 | return mImpl->GetReadonlyUnsignedLongLong(aRv, aRealm); | ||||
| 78224 | } | ||||
| 78225 | |||||
| 78226 | uint64_t | ||||
| 78227 | TestJSImplInterface::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78228 | { | ||||
| 78229 | return mImpl->GetWritableUnsignedLongLong(aRv, aRealm); | ||||
| 78230 | } | ||||
| 78231 | |||||
| 78232 | void | ||||
| 78233 | TestJSImplInterface::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78234 | { | ||||
| 78235 | mImpl->SetWritableUnsignedLongLong(arg, aRv, aRealm); | ||||
| 78236 | } | ||||
| 78237 | |||||
| 78238 | void | ||||
| 78239 | TestJSImplInterface::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78240 | { | ||||
| 78241 | return mImpl->PassUnsignedLongLong(arg, aRv, aRealm); | ||||
| 78242 | } | ||||
| 78243 | |||||
| 78244 | uint64_t | ||||
| 78245 | TestJSImplInterface::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78246 | { | ||||
| 78247 | return mImpl->ReceiveUnsignedLongLong(aRv, aRealm); | ||||
| 78248 | } | ||||
| 78249 | |||||
| 78250 | void | ||||
| 78251 | TestJSImplInterface::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78252 | { | ||||
| 78253 | return mImpl->PassOptionalUnsignedLongLong(arg, aRv, aRealm); | ||||
| 78254 | } | ||||
| 78255 | |||||
| 78256 | void | ||||
| 78257 | TestJSImplInterface::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78258 | { | ||||
| 78259 | return mImpl->PassOptionalUnsignedLongLongWithDefault(arg, aRv, aRealm); | ||||
| 78260 | } | ||||
| 78261 | |||||
| 78262 | float | ||||
| 78263 | TestJSImplInterface::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78264 | { | ||||
| 78265 | return mImpl->GetWritableFloat(aRv, aRealm); | ||||
| 78266 | } | ||||
| 78267 | |||||
| 78268 | void | ||||
| 78269 | TestJSImplInterface::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78270 | { | ||||
| 78271 | mImpl->SetWritableFloat(arg, aRv, aRealm); | ||||
| 78272 | } | ||||
| 78273 | |||||
| 78274 | float | ||||
| 78275 | TestJSImplInterface::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78276 | { | ||||
| 78277 | return mImpl->GetWritableUnrestrictedFloat(aRv, aRealm); | ||||
| 78278 | } | ||||
| 78279 | |||||
| 78280 | void | ||||
| 78281 | TestJSImplInterface::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78282 | { | ||||
| 78283 | mImpl->SetWritableUnrestrictedFloat(arg, aRv, aRealm); | ||||
| 78284 | } | ||||
| 78285 | |||||
| 78286 | Nullable<float> | ||||
| 78287 | TestJSImplInterface::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78288 | { | ||||
| 78289 | return mImpl->GetWritableNullableFloat(aRv, aRealm); | ||||
| 78290 | } | ||||
| 78291 | |||||
| 78292 | void | ||||
| 78293 | TestJSImplInterface::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78294 | { | ||||
| 78295 | mImpl->SetWritableNullableFloat(arg, aRv, aRealm); | ||||
| 78296 | } | ||||
| 78297 | |||||
| 78298 | Nullable<float> | ||||
| 78299 | TestJSImplInterface::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78300 | { | ||||
| 78301 | return mImpl->GetWritableNullableUnrestrictedFloat(aRv, aRealm); | ||||
| 78302 | } | ||||
| 78303 | |||||
| 78304 | void | ||||
| 78305 | TestJSImplInterface::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78306 | { | ||||
| 78307 | mImpl->SetWritableNullableUnrestrictedFloat(arg, aRv, aRealm); | ||||
| 78308 | } | ||||
| 78309 | |||||
| 78310 | double | ||||
| 78311 | TestJSImplInterface::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78312 | { | ||||
| 78313 | return mImpl->GetWritableDouble(aRv, aRealm); | ||||
| 78314 | } | ||||
| 78315 | |||||
| 78316 | void | ||||
| 78317 | TestJSImplInterface::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78318 | { | ||||
| 78319 | mImpl->SetWritableDouble(arg, aRv, aRealm); | ||||
| 78320 | } | ||||
| 78321 | |||||
| 78322 | double | ||||
| 78323 | TestJSImplInterface::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78324 | { | ||||
| 78325 | return mImpl->GetWritableUnrestrictedDouble(aRv, aRealm); | ||||
| 78326 | } | ||||
| 78327 | |||||
| 78328 | void | ||||
| 78329 | TestJSImplInterface::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78330 | { | ||||
| 78331 | mImpl->SetWritableUnrestrictedDouble(arg, aRv, aRealm); | ||||
| 78332 | } | ||||
| 78333 | |||||
| 78334 | Nullable<double> | ||||
| 78335 | TestJSImplInterface::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78336 | { | ||||
| 78337 | return mImpl->GetWritableNullableDouble(aRv, aRealm); | ||||
| 78338 | } | ||||
| 78339 | |||||
| 78340 | void | ||||
| 78341 | TestJSImplInterface::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78342 | { | ||||
| 78343 | mImpl->SetWritableNullableDouble(arg, aRv, aRealm); | ||||
| 78344 | } | ||||
| 78345 | |||||
| 78346 | Nullable<double> | ||||
| 78347 | TestJSImplInterface::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78348 | { | ||||
| 78349 | return mImpl->GetWritableNullableUnrestrictedDouble(aRv, aRealm); | ||||
| 78350 | } | ||||
| 78351 | |||||
| 78352 | void | ||||
| 78353 | TestJSImplInterface::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78354 | { | ||||
| 78355 | mImpl->SetWritableNullableUnrestrictedDouble(arg, aRv, aRealm); | ||||
| 78356 | } | ||||
| 78357 | |||||
| 78358 | void | ||||
| 78359 | TestJSImplInterface::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) | ||||
| 78360 | { | ||||
| 78361 | return mImpl->PassFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm); | ||||
| 78362 | } | ||||
| 78363 | |||||
| 78364 | void | ||||
| 78365 | TestJSImplInterface::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) | ||||
| 78366 | { | ||||
| 78367 | return mImpl->PassLenientFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm); | ||||
| 78368 | } | ||||
| 78369 | |||||
| 78370 | float | ||||
| 78371 | TestJSImplInterface::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78372 | { | ||||
| 78373 | return mImpl->GetLenientFloatAttr(aRv, aRealm); | ||||
| 78374 | } | ||||
| 78375 | |||||
| 78376 | void | ||||
| 78377 | TestJSImplInterface::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78378 | { | ||||
| 78379 | mImpl->SetLenientFloatAttr(arg, aRv, aRealm); | ||||
| 78380 | } | ||||
| 78381 | |||||
| 78382 | double | ||||
| 78383 | TestJSImplInterface::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78384 | { | ||||
| 78385 | return mImpl->GetLenientDoubleAttr(aRv, aRealm); | ||||
| 78386 | } | ||||
| 78387 | |||||
| 78388 | void | ||||
| 78389 | TestJSImplInterface::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78390 | { | ||||
| 78391 | mImpl->SetLenientDoubleAttr(arg, aRv, aRealm); | ||||
| 78392 | } | ||||
| 78393 | |||||
| 78394 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78395 | already_AddRefed<TestJSImplInterface> | ||||
| 78396 | TestJSImplInterface::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78397 | { | ||||
| 78398 | return mImpl->ReceiveSelf(aRv, aRealm); | ||||
| 78399 | } | ||||
| 78400 | |||||
| 78401 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78402 | already_AddRefed<TestJSImplInterface> | ||||
| 78403 | TestJSImplInterface::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78404 | { | ||||
| 78405 | return mImpl->ReceiveNullableSelf(aRv, aRealm); | ||||
| 78406 | } | ||||
| 78407 | |||||
| 78408 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78409 | already_AddRefed<TestJSImplInterface> | ||||
| 78410 | TestJSImplInterface::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78411 | { | ||||
| 78412 | return mImpl->ReceiveWeakSelf(aRv, aRealm); | ||||
| 78413 | } | ||||
| 78414 | |||||
| 78415 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78416 | already_AddRefed<TestJSImplInterface> | ||||
| 78417 | TestJSImplInterface::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78418 | { | ||||
| 78419 | return mImpl->ReceiveWeakNullableSelf(aRv, aRealm); | ||||
| 78420 | } | ||||
| 78421 | |||||
| 78422 | void | ||||
| 78423 | TestJSImplInterface::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78424 | { | ||||
| 78425 | return mImpl->PassSelf(arg, aRv, aRealm); | ||||
| 78426 | } | ||||
| 78427 | |||||
| 78428 | void | ||||
| 78429 | TestJSImplInterface::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78430 | { | ||||
| 78431 | return mImpl->PassNullableSelf(arg, aRv, aRealm); | ||||
| 78432 | } | ||||
| 78433 | |||||
| 78434 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78435 | already_AddRefed<TestJSImplInterface> | ||||
| 78436 | TestJSImplInterface::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78437 | { | ||||
| 78438 | return mImpl->GetNonNullSelf(aRv, aRealm); | ||||
| 78439 | } | ||||
| 78440 | |||||
| 78441 | void | ||||
| 78442 | TestJSImplInterface::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78443 | { | ||||
| 78444 | mImpl->SetNonNullSelf(arg, aRv, aRealm); | ||||
| 78445 | } | ||||
| 78446 | |||||
| 78447 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78448 | already_AddRefed<TestJSImplInterface> | ||||
| 78449 | TestJSImplInterface::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78450 | { | ||||
| 78451 | return mImpl->GetNullableSelf(aRv, aRealm); | ||||
| 78452 | } | ||||
| 78453 | |||||
| 78454 | void | ||||
| 78455 | TestJSImplInterface::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78456 | { | ||||
| 78457 | mImpl->SetNullableSelf(arg, aRv, aRealm); | ||||
| 78458 | } | ||||
| 78459 | |||||
| 78460 | void | ||||
| 78461 | TestJSImplInterface::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78462 | { | ||||
| 78463 | return mImpl->PassOptionalSelf(arg, aRv, aRealm); | ||||
| 78464 | } | ||||
| 78465 | |||||
| 78466 | void | ||||
| 78467 | TestJSImplInterface::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78468 | { | ||||
| 78469 | return mImpl->PassOptionalNonNullSelf(arg, aRv, aRealm); | ||||
| 78470 | } | ||||
| 78471 | |||||
| 78472 | void | ||||
| 78473 | TestJSImplInterface::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78474 | { | ||||
| 78475 | return mImpl->PassOptionalSelfWithDefault(arg, aRv, aRealm); | ||||
| 78476 | } | ||||
| 78477 | |||||
| 78478 | already_AddRefed<TestNonWrapperCacheInterface> | ||||
| 78479 | TestJSImplInterface::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78480 | { | ||||
| 78481 | return mImpl->ReceiveNonWrapperCacheInterface(aRv, aRealm); | ||||
| 78482 | } | ||||
| 78483 | |||||
| 78484 | already_AddRefed<TestNonWrapperCacheInterface> | ||||
| 78485 | TestJSImplInterface::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78486 | { | ||||
| 78487 | return mImpl->ReceiveNullableNonWrapperCacheInterface(aRv, aRealm); | ||||
| 78488 | } | ||||
| 78489 | |||||
| 78490 | void | ||||
| 78491 | TestJSImplInterface::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78492 | { | ||||
| 78493 | return mImpl->ReceiveNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm); | ||||
| 78494 | } | ||||
| 78495 | |||||
| 78496 | void | ||||
| 78497 | TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78498 | { | ||||
| 78499 | return mImpl->ReceiveNullableNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm); | ||||
| 78500 | } | ||||
| 78501 | |||||
| 78502 | void | ||||
| 78503 | TestJSImplInterface::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78504 | { | ||||
| 78505 | return mImpl->ReceiveNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78506 | } | ||||
| 78507 | |||||
| 78508 | void | ||||
| 78509 | TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78510 | { | ||||
| 78511 | return mImpl->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78512 | } | ||||
| 78513 | |||||
| 78514 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78515 | already_AddRefed<TestExternalInterface> | ||||
| 78516 | TestJSImplInterface::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78517 | { | ||||
| 78518 | return mImpl->ReceiveExternal(aRv, aRealm); | ||||
| 78519 | } | ||||
| 78520 | |||||
| 78521 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78522 | already_AddRefed<TestExternalInterface> | ||||
| 78523 | TestJSImplInterface::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78524 | { | ||||
| 78525 | return mImpl->ReceiveNullableExternal(aRv, aRealm); | ||||
| 78526 | } | ||||
| 78527 | |||||
| 78528 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78529 | already_AddRefed<TestExternalInterface> | ||||
| 78530 | TestJSImplInterface::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78531 | { | ||||
| 78532 | return mImpl->ReceiveWeakExternal(aRv, aRealm); | ||||
| 78533 | } | ||||
| 78534 | |||||
| 78535 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78536 | already_AddRefed<TestExternalInterface> | ||||
| 78537 | TestJSImplInterface::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78538 | { | ||||
| 78539 | return mImpl->ReceiveWeakNullableExternal(aRv, aRealm); | ||||
| 78540 | } | ||||
| 78541 | |||||
| 78542 | void | ||||
| 78543 | TestJSImplInterface::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78544 | { | ||||
| 78545 | return mImpl->PassExternal(arg, aRv, aRealm); | ||||
| 78546 | } | ||||
| 78547 | |||||
| 78548 | void | ||||
| 78549 | TestJSImplInterface::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78550 | { | ||||
| 78551 | return mImpl->PassNullableExternal(arg, aRv, aRealm); | ||||
| 78552 | } | ||||
| 78553 | |||||
| 78554 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78555 | already_AddRefed<TestExternalInterface> | ||||
| 78556 | TestJSImplInterface::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78557 | { | ||||
| 78558 | return mImpl->GetNonNullExternal(aRv, aRealm); | ||||
| 78559 | } | ||||
| 78560 | |||||
| 78561 | void | ||||
| 78562 | TestJSImplInterface::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78563 | { | ||||
| 78564 | mImpl->SetNonNullExternal(arg, aRv, aRealm); | ||||
| 78565 | } | ||||
| 78566 | |||||
| 78567 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78568 | already_AddRefed<TestExternalInterface> | ||||
| 78569 | TestJSImplInterface::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78570 | { | ||||
| 78571 | return mImpl->GetNullableExternal(aRv, aRealm); | ||||
| 78572 | } | ||||
| 78573 | |||||
| 78574 | void | ||||
| 78575 | TestJSImplInterface::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78576 | { | ||||
| 78577 | mImpl->SetNullableExternal(arg, aRv, aRealm); | ||||
| 78578 | } | ||||
| 78579 | |||||
| 78580 | void | ||||
| 78581 | TestJSImplInterface::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78582 | { | ||||
| 78583 | return mImpl->PassOptionalExternal(arg, aRv, aRealm); | ||||
| 78584 | } | ||||
| 78585 | |||||
| 78586 | void | ||||
| 78587 | TestJSImplInterface::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78588 | { | ||||
| 78589 | return mImpl->PassOptionalNonNullExternal(arg, aRv, aRealm); | ||||
| 78590 | } | ||||
| 78591 | |||||
| 78592 | void | ||||
| 78593 | TestJSImplInterface::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78594 | { | ||||
| 78595 | return mImpl->PassOptionalExternalWithDefault(arg, aRv, aRealm); | ||||
| 78596 | } | ||||
| 78597 | |||||
| 78598 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78599 | already_AddRefed<TestCallbackInterface> | ||||
| 78600 | TestJSImplInterface::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78601 | { | ||||
| 78602 | return mImpl->ReceiveCallbackInterface(aRv, aRealm); | ||||
| 78603 | } | ||||
| 78604 | |||||
| 78605 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78606 | already_AddRefed<TestCallbackInterface> | ||||
| 78607 | TestJSImplInterface::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78608 | { | ||||
| 78609 | return mImpl->ReceiveNullableCallbackInterface(aRv, aRealm); | ||||
| 78610 | } | ||||
| 78611 | |||||
| 78612 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78613 | already_AddRefed<TestCallbackInterface> | ||||
| 78614 | TestJSImplInterface::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78615 | { | ||||
| 78616 | return mImpl->ReceiveWeakCallbackInterface(aRv, aRealm); | ||||
| 78617 | } | ||||
| 78618 | |||||
| 78619 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78620 | already_AddRefed<TestCallbackInterface> | ||||
| 78621 | TestJSImplInterface::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78622 | { | ||||
| 78623 | return mImpl->ReceiveWeakNullableCallbackInterface(aRv, aRealm); | ||||
| 78624 | } | ||||
| 78625 | |||||
| 78626 | void | ||||
| 78627 | TestJSImplInterface::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78628 | { | ||||
| 78629 | return mImpl->PassCallbackInterface(arg, aRv, aRealm); | ||||
| 78630 | } | ||||
| 78631 | |||||
| 78632 | void | ||||
| 78633 | TestJSImplInterface::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78634 | { | ||||
| 78635 | return mImpl->PassNullableCallbackInterface(arg, aRv, aRealm); | ||||
| 78636 | } | ||||
| 78637 | |||||
| 78638 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78639 | already_AddRefed<TestCallbackInterface> | ||||
| 78640 | TestJSImplInterface::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78641 | { | ||||
| 78642 | return mImpl->GetNonNullCallbackInterface(aRv, aRealm); | ||||
| 78643 | } | ||||
| 78644 | |||||
| 78645 | void | ||||
| 78646 | TestJSImplInterface::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78647 | { | ||||
| 78648 | mImpl->SetNonNullCallbackInterface(arg, aRv, aRealm); | ||||
| 78649 | } | ||||
| 78650 | |||||
| 78651 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 78652 | already_AddRefed<TestCallbackInterface> | ||||
| 78653 | TestJSImplInterface::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 78654 | { | ||||
| 78655 | return mImpl->GetNullableCallbackInterface(aRv, aRealm); | ||||
| 78656 | } | ||||
| 78657 | |||||
| 78658 | void | ||||
| 78659 | TestJSImplInterface::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78660 | { | ||||
| 78661 | mImpl->SetNullableCallbackInterface(arg, aRv, aRealm); | ||||
| 78662 | } | ||||
| 78663 | |||||
| 78664 | void | ||||
| 78665 | TestJSImplInterface::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78666 | { | ||||
| 78667 | return mImpl->PassOptionalCallbackInterface(arg, aRv, aRealm); | ||||
| 78668 | } | ||||
| 78669 | |||||
| 78670 | void | ||||
| 78671 | TestJSImplInterface::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78672 | { | ||||
| 78673 | return mImpl->PassOptionalNonNullCallbackInterface(arg, aRv, aRealm); | ||||
| 78674 | } | ||||
| 78675 | |||||
| 78676 | void | ||||
| 78677 | TestJSImplInterface::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78678 | { | ||||
| 78679 | return mImpl->PassOptionalCallbackInterfaceWithDefault(arg, aRv, aRealm); | ||||
| 78680 | } | ||||
| 78681 | |||||
| 78682 | void | ||||
| 78683 | TestJSImplInterface::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78684 | { | ||||
| 78685 | return mImpl->ReceiveSequence(aRetVal, aRv, aRealm); | ||||
| 78686 | } | ||||
| 78687 | |||||
| 78688 | void | ||||
| 78689 | TestJSImplInterface::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78690 | { | ||||
| 78691 | return mImpl->ReceiveNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78692 | } | ||||
| 78693 | |||||
| 78694 | void | ||||
| 78695 | TestJSImplInterface::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78696 | { | ||||
| 78697 | return mImpl->ReceiveSequenceOfNullableInts(aRetVal, aRv, aRealm); | ||||
| 78698 | } | ||||
| 78699 | |||||
| 78700 | void | ||||
| 78701 | TestJSImplInterface::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78702 | { | ||||
| 78703 | return mImpl->ReceiveNullableSequenceOfNullableInts(aRetVal, aRv, aRealm); | ||||
| 78704 | } | ||||
| 78705 | |||||
| 78706 | void | ||||
| 78707 | TestJSImplInterface::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78708 | { | ||||
| 78709 | return mImpl->PassSequence(arg, aRv, aRealm); | ||||
| 78710 | } | ||||
| 78711 | |||||
| 78712 | void | ||||
| 78713 | TestJSImplInterface::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78714 | { | ||||
| 78715 | return mImpl->PassNullableSequence(arg, aRv, aRealm); | ||||
| 78716 | } | ||||
| 78717 | |||||
| 78718 | void | ||||
| 78719 | TestJSImplInterface::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78720 | { | ||||
| 78721 | return mImpl->PassSequenceOfNullableInts(arg, aRv, aRealm); | ||||
| 78722 | } | ||||
| 78723 | |||||
| 78724 | void | ||||
| 78725 | TestJSImplInterface::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78726 | { | ||||
| 78727 | return mImpl->PassOptionalSequenceOfNullableInts(arg, aRv, aRealm); | ||||
| 78728 | } | ||||
| 78729 | |||||
| 78730 | void | ||||
| 78731 | TestJSImplInterface::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78732 | { | ||||
| 78733 | return mImpl->PassOptionalNullableSequenceOfNullableInts(arg, aRv, aRealm); | ||||
| 78734 | } | ||||
| 78735 | |||||
| 78736 | void | ||||
| 78737 | TestJSImplInterface::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78738 | { | ||||
| 78739 | return mImpl->ReceiveCastableObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78740 | } | ||||
| 78741 | |||||
| 78742 | void | ||||
| 78743 | TestJSImplInterface::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78744 | { | ||||
| 78745 | return mImpl->ReceiveCallbackObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78746 | } | ||||
| 78747 | |||||
| 78748 | void | ||||
| 78749 | TestJSImplInterface::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78750 | { | ||||
| 78751 | return mImpl->ReceiveNullableCastableObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78752 | } | ||||
| 78753 | |||||
| 78754 | void | ||||
| 78755 | TestJSImplInterface::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78756 | { | ||||
| 78757 | return mImpl->ReceiveNullableCallbackObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78758 | } | ||||
| 78759 | |||||
| 78760 | void | ||||
| 78761 | TestJSImplInterface::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78762 | { | ||||
| 78763 | return mImpl->ReceiveCastableObjectNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78764 | } | ||||
| 78765 | |||||
| 78766 | void | ||||
| 78767 | TestJSImplInterface::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78768 | { | ||||
| 78769 | return mImpl->ReceiveNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78770 | } | ||||
| 78771 | |||||
| 78772 | void | ||||
| 78773 | TestJSImplInterface::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78774 | { | ||||
| 78775 | return mImpl->ReceiveWeakCastableObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78776 | } | ||||
| 78777 | |||||
| 78778 | void | ||||
| 78779 | TestJSImplInterface::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78780 | { | ||||
| 78781 | return mImpl->ReceiveWeakNullableCastableObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78782 | } | ||||
| 78783 | |||||
| 78784 | void | ||||
| 78785 | TestJSImplInterface::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78786 | { | ||||
| 78787 | return mImpl->ReceiveWeakCastableObjectNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78788 | } | ||||
| 78789 | |||||
| 78790 | void | ||||
| 78791 | TestJSImplInterface::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78792 | { | ||||
| 78793 | return mImpl->ReceiveWeakNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm); | ||||
| 78794 | } | ||||
| 78795 | |||||
| 78796 | void | ||||
| 78797 | TestJSImplInterface::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78798 | { | ||||
| 78799 | return mImpl->PassCastableObjectSequence(arg, aRv, aRealm); | ||||
| 78800 | } | ||||
| 78801 | |||||
| 78802 | void | ||||
| 78803 | TestJSImplInterface::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78804 | { | ||||
| 78805 | return mImpl->PassNullableCastableObjectSequence(arg, aRv, aRealm); | ||||
| 78806 | } | ||||
| 78807 | |||||
| 78808 | void | ||||
| 78809 | TestJSImplInterface::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78810 | { | ||||
| 78811 | return mImpl->PassCastableObjectNullableSequence(arg, aRv, aRealm); | ||||
| 78812 | } | ||||
| 78813 | |||||
| 78814 | void | ||||
| 78815 | TestJSImplInterface::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78816 | { | ||||
| 78817 | return mImpl->PassNullableCastableObjectNullableSequence(arg, aRv, aRealm); | ||||
| 78818 | } | ||||
| 78819 | |||||
| 78820 | void | ||||
| 78821 | TestJSImplInterface::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78822 | { | ||||
| 78823 | return mImpl->PassOptionalSequence(arg, aRv, aRealm); | ||||
| 78824 | } | ||||
| 78825 | |||||
| 78826 | void | ||||
| 78827 | TestJSImplInterface::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78828 | { | ||||
| 78829 | return mImpl->PassOptionalSequenceWithDefaultValue(arg, aRv, aRealm); | ||||
| 78830 | } | ||||
| 78831 | |||||
| 78832 | void | ||||
| 78833 | TestJSImplInterface::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78834 | { | ||||
| 78835 | return mImpl->PassOptionalNullableSequence(arg, aRv, aRealm); | ||||
| 78836 | } | ||||
| 78837 | |||||
| 78838 | void | ||||
| 78839 | TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78840 | { | ||||
| 78841 | return mImpl->PassOptionalNullableSequenceWithDefaultValue(arg, aRv, aRealm); | ||||
| 78842 | } | ||||
| 78843 | |||||
| 78844 | void | ||||
| 78845 | TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78846 | { | ||||
| 78847 | return mImpl->PassOptionalNullableSequenceWithDefaultValue2(arg, aRv, aRealm); | ||||
| 78848 | } | ||||
| 78849 | |||||
| 78850 | void | ||||
| 78851 | TestJSImplInterface::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78852 | { | ||||
| 78853 | return mImpl->PassOptionalObjectSequence(arg, aRv, aRealm); | ||||
| 78854 | } | ||||
| 78855 | |||||
| 78856 | void | ||||
| 78857 | TestJSImplInterface::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78858 | { | ||||
| 78859 | return mImpl->PassExternalInterfaceSequence(arg, aRv, aRealm); | ||||
| 78860 | } | ||||
| 78861 | |||||
| 78862 | void | ||||
| 78863 | TestJSImplInterface::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78864 | { | ||||
| 78865 | return mImpl->PassNullableExternalInterfaceSequence(arg, aRv, aRealm); | ||||
| 78866 | } | ||||
| 78867 | |||||
| 78868 | void | ||||
| 78869 | TestJSImplInterface::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78870 | { | ||||
| 78871 | return mImpl->ReceiveStringSequence(aRetVal, aRv, aRealm); | ||||
| 78872 | } | ||||
| 78873 | |||||
| 78874 | void | ||||
| 78875 | TestJSImplInterface::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78876 | { | ||||
| 78877 | return mImpl->ReceiveByteStringSequence(aRetVal, aRv, aRealm); | ||||
| 78878 | } | ||||
| 78879 | |||||
| 78880 | void | ||||
| 78881 | TestJSImplInterface::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78882 | { | ||||
| 78883 | return mImpl->ReceiveUTF8StringSequence(aRetVal, aRv, aRealm); | ||||
| 78884 | } | ||||
| 78885 | |||||
| 78886 | void | ||||
| 78887 | TestJSImplInterface::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78888 | { | ||||
| 78889 | return mImpl->ReceiveAnySequence(aRetVal, aRv, aRealm); | ||||
| 78890 | } | ||||
| 78891 | |||||
| 78892 | void | ||||
| 78893 | TestJSImplInterface::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78894 | { | ||||
| 78895 | return mImpl->ReceiveNullableAnySequence(aRetVal, aRv, aRealm); | ||||
| 78896 | } | ||||
| 78897 | |||||
| 78898 | void | ||||
| 78899 | TestJSImplInterface::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78900 | { | ||||
| 78901 | return mImpl->ReceiveObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78902 | } | ||||
| 78903 | |||||
| 78904 | void | ||||
| 78905 | TestJSImplInterface::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78906 | { | ||||
| 78907 | return mImpl->ReceiveNullableObjectSequence(aRetVal, aRv, aRealm); | ||||
| 78908 | } | ||||
| 78909 | |||||
| 78910 | void | ||||
| 78911 | TestJSImplInterface::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78912 | { | ||||
| 78913 | return mImpl->PassSequenceOfSequences(arg, aRv, aRealm); | ||||
| 78914 | } | ||||
| 78915 | |||||
| 78916 | void | ||||
| 78917 | TestJSImplInterface::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78918 | { | ||||
| 78919 | return mImpl->PassSequenceOfSequencesOfSequences(arg, aRv, aRealm); | ||||
| 78920 | } | ||||
| 78921 | |||||
| 78922 | void | ||||
| 78923 | TestJSImplInterface::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78924 | { | ||||
| 78925 | return mImpl->PassRecord(arg, aRv, aRealm); | ||||
| 78926 | } | ||||
| 78927 | |||||
| 78928 | void | ||||
| 78929 | TestJSImplInterface::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78930 | { | ||||
| 78931 | return mImpl->PassNullableRecord(arg, aRv, aRealm); | ||||
| 78932 | } | ||||
| 78933 | |||||
| 78934 | void | ||||
| 78935 | TestJSImplInterface::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78936 | { | ||||
| 78937 | return mImpl->PassRecordOfNullableInts(arg, aRv, aRealm); | ||||
| 78938 | } | ||||
| 78939 | |||||
| 78940 | void | ||||
| 78941 | TestJSImplInterface::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78942 | { | ||||
| 78943 | return mImpl->PassOptionalRecordOfNullableInts(arg, aRv, aRealm); | ||||
| 78944 | } | ||||
| 78945 | |||||
| 78946 | void | ||||
| 78947 | TestJSImplInterface::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78948 | { | ||||
| 78949 | return mImpl->PassOptionalNullableRecordOfNullableInts(arg, aRv, aRealm); | ||||
| 78950 | } | ||||
| 78951 | |||||
| 78952 | void | ||||
| 78953 | TestJSImplInterface::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78954 | { | ||||
| 78955 | return mImpl->PassCastableObjectRecord(arg, aRv, aRealm); | ||||
| 78956 | } | ||||
| 78957 | |||||
| 78958 | void | ||||
| 78959 | TestJSImplInterface::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78960 | { | ||||
| 78961 | return mImpl->PassNullableCastableObjectRecord(arg, aRv, aRealm); | ||||
| 78962 | } | ||||
| 78963 | |||||
| 78964 | void | ||||
| 78965 | TestJSImplInterface::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78966 | { | ||||
| 78967 | return mImpl->PassCastableObjectNullableRecord(arg, aRv, aRealm); | ||||
| 78968 | } | ||||
| 78969 | |||||
| 78970 | void | ||||
| 78971 | TestJSImplInterface::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78972 | { | ||||
| 78973 | return mImpl->PassNullableCastableObjectNullableRecord(arg, aRv, aRealm); | ||||
| 78974 | } | ||||
| 78975 | |||||
| 78976 | void | ||||
| 78977 | TestJSImplInterface::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78978 | { | ||||
| 78979 | return mImpl->PassOptionalRecord(arg, aRv, aRealm); | ||||
| 78980 | } | ||||
| 78981 | |||||
| 78982 | void | ||||
| 78983 | TestJSImplInterface::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78984 | { | ||||
| 78985 | return mImpl->PassOptionalNullableRecord(arg, aRv, aRealm); | ||||
| 78986 | } | ||||
| 78987 | |||||
| 78988 | void | ||||
| 78989 | TestJSImplInterface::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78990 | { | ||||
| 78991 | return mImpl->PassOptionalNullableRecordWithDefaultValue(arg, aRv, aRealm); | ||||
| 78992 | } | ||||
| 78993 | |||||
| 78994 | void | ||||
| 78995 | TestJSImplInterface::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 78996 | { | ||||
| 78997 | return mImpl->PassOptionalObjectRecord(arg, aRv, aRealm); | ||||
| 78998 | } | ||||
| 78999 | |||||
| 79000 | void | ||||
| 79001 | TestJSImplInterface::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79002 | { | ||||
| 79003 | return mImpl->PassExternalInterfaceRecord(arg, aRv, aRealm); | ||||
| 79004 | } | ||||
| 79005 | |||||
| 79006 | void | ||||
| 79007 | TestJSImplInterface::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79008 | { | ||||
| 79009 | return mImpl->PassNullableExternalInterfaceRecord(arg, aRv, aRealm); | ||||
| 79010 | } | ||||
| 79011 | |||||
| 79012 | void | ||||
| 79013 | TestJSImplInterface::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79014 | { | ||||
| 79015 | return mImpl->PassStringRecord(arg, aRv, aRealm); | ||||
| 79016 | } | ||||
| 79017 | |||||
| 79018 | void | ||||
| 79019 | TestJSImplInterface::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79020 | { | ||||
| 79021 | return mImpl->PassByteStringRecord(arg, aRv, aRealm); | ||||
| 79022 | } | ||||
| 79023 | |||||
| 79024 | void | ||||
| 79025 | TestJSImplInterface::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79026 | { | ||||
| 79027 | return mImpl->PassUTF8StringRecord(arg, aRv, aRealm); | ||||
| 79028 | } | ||||
| 79029 | |||||
| 79030 | void | ||||
| 79031 | TestJSImplInterface::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79032 | { | ||||
| 79033 | return mImpl->PassRecordOfRecords(arg, aRv, aRealm); | ||||
| 79034 | } | ||||
| 79035 | |||||
| 79036 | void | ||||
| 79037 | TestJSImplInterface::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79038 | { | ||||
| 79039 | return mImpl->ReceiveRecord(aRetVal, aRv, aRealm); | ||||
| 79040 | } | ||||
| 79041 | |||||
| 79042 | void | ||||
| 79043 | TestJSImplInterface::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79044 | { | ||||
| 79045 | return mImpl->ReceiveNullableRecord(aRetVal, aRv, aRealm); | ||||
| 79046 | } | ||||
| 79047 | |||||
| 79048 | void | ||||
| 79049 | TestJSImplInterface::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79050 | { | ||||
| 79051 | return mImpl->ReceiveRecordOfNullableInts(aRetVal, aRv, aRealm); | ||||
| 79052 | } | ||||
| 79053 | |||||
| 79054 | void | ||||
| 79055 | TestJSImplInterface::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79056 | { | ||||
| 79057 | return mImpl->ReceiveNullableRecordOfNullableInts(aRetVal, aRv, aRealm); | ||||
| 79058 | } | ||||
| 79059 | |||||
| 79060 | void | ||||
| 79061 | TestJSImplInterface::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79062 | { | ||||
| 79063 | return mImpl->ReceiveAnyRecord(aRetVal, aRv, aRealm); | ||||
| 79064 | } | ||||
| 79065 | |||||
| 79066 | void | ||||
| 79067 | TestJSImplInterface::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79068 | { | ||||
| 79069 | return mImpl->PassArrayBuffer(arg, aRv, aRealm); | ||||
| 79070 | } | ||||
| 79071 | |||||
| 79072 | void | ||||
| 79073 | TestJSImplInterface::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79074 | { | ||||
| 79075 | return mImpl->PassNullableArrayBuffer(arg, aRv, aRealm); | ||||
| 79076 | } | ||||
| 79077 | |||||
| 79078 | void | ||||
| 79079 | TestJSImplInterface::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79080 | { | ||||
| 79081 | return mImpl->PassOptionalArrayBuffer(arg, aRv, aRealm); | ||||
| 79082 | } | ||||
| 79083 | |||||
| 79084 | void | ||||
| 79085 | TestJSImplInterface::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79086 | { | ||||
| 79087 | return mImpl->PassOptionalNullableArrayBuffer(arg, aRv, aRealm); | ||||
| 79088 | } | ||||
| 79089 | |||||
| 79090 | void | ||||
| 79091 | TestJSImplInterface::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79092 | { | ||||
| 79093 | return mImpl->PassOptionalNullableArrayBufferWithDefaultValue(arg, aRv, aRealm); | ||||
| 79094 | } | ||||
| 79095 | |||||
| 79096 | void | ||||
| 79097 | TestJSImplInterface::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79098 | { | ||||
| 79099 | return mImpl->PassArrayBufferView(arg, aRv, aRealm); | ||||
| 79100 | } | ||||
| 79101 | |||||
| 79102 | void | ||||
| 79103 | TestJSImplInterface::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79104 | { | ||||
| 79105 | return mImpl->PassInt8Array(arg, aRv, aRealm); | ||||
| 79106 | } | ||||
| 79107 | |||||
| 79108 | void | ||||
| 79109 | TestJSImplInterface::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79110 | { | ||||
| 79111 | return mImpl->PassInt16Array(arg, aRv, aRealm); | ||||
| 79112 | } | ||||
| 79113 | |||||
| 79114 | void | ||||
| 79115 | TestJSImplInterface::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79116 | { | ||||
| 79117 | return mImpl->PassInt32Array(arg, aRv, aRealm); | ||||
| 79118 | } | ||||
| 79119 | |||||
| 79120 | void | ||||
| 79121 | TestJSImplInterface::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79122 | { | ||||
| 79123 | return mImpl->PassUint8Array(arg, aRv, aRealm); | ||||
| 79124 | } | ||||
| 79125 | |||||
| 79126 | void | ||||
| 79127 | TestJSImplInterface::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79128 | { | ||||
| 79129 | return mImpl->PassUint16Array(arg, aRv, aRealm); | ||||
| 79130 | } | ||||
| 79131 | |||||
| 79132 | void | ||||
| 79133 | TestJSImplInterface::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79134 | { | ||||
| 79135 | return mImpl->PassUint32Array(arg, aRv, aRealm); | ||||
| 79136 | } | ||||
| 79137 | |||||
| 79138 | void | ||||
| 79139 | TestJSImplInterface::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79140 | { | ||||
| 79141 | return mImpl->PassUint8ClampedArray(arg, aRv, aRealm); | ||||
| 79142 | } | ||||
| 79143 | |||||
| 79144 | void | ||||
| 79145 | TestJSImplInterface::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79146 | { | ||||
| 79147 | return mImpl->PassFloat32Array(arg, aRv, aRealm); | ||||
| 79148 | } | ||||
| 79149 | |||||
| 79150 | void | ||||
| 79151 | TestJSImplInterface::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79152 | { | ||||
| 79153 | return mImpl->PassFloat64Array(arg, aRv, aRealm); | ||||
| 79154 | } | ||||
| 79155 | |||||
| 79156 | void | ||||
| 79157 | TestJSImplInterface::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79158 | { | ||||
| 79159 | return mImpl->PassSequenceOfArrayBuffers(arg, aRv, aRealm); | ||||
| 79160 | } | ||||
| 79161 | |||||
| 79162 | void | ||||
| 79163 | TestJSImplInterface::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79164 | { | ||||
| 79165 | return mImpl->PassSequenceOfNullableArrayBuffers(arg, aRv, aRealm); | ||||
| 79166 | } | ||||
| 79167 | |||||
| 79168 | void | ||||
| 79169 | TestJSImplInterface::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79170 | { | ||||
| 79171 | return mImpl->PassRecordOfArrayBuffers(arg, aRv, aRealm); | ||||
| 79172 | } | ||||
| 79173 | |||||
| 79174 | void | ||||
| 79175 | TestJSImplInterface::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79176 | { | ||||
| 79177 | return mImpl->PassRecordOfNullableArrayBuffers(arg, aRv, aRealm); | ||||
| 79178 | } | ||||
| 79179 | |||||
| 79180 | void | ||||
| 79181 | TestJSImplInterface::PassVariadicTypedArray(const Sequence<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79182 | { | ||||
| 79183 | return mImpl->PassVariadicTypedArray(arg, aRv, aRealm); | ||||
| 79184 | } | ||||
| 79185 | |||||
| 79186 | void | ||||
| 79187 | TestJSImplInterface::PassVariadicNullableTypedArray(const Sequence<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79188 | { | ||||
| 79189 | return mImpl->PassVariadicNullableTypedArray(arg, aRv, aRealm); | ||||
| 79190 | } | ||||
| 79191 | |||||
| 79192 | void | ||||
| 79193 | TestJSImplInterface::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79194 | { | ||||
| 79195 | return mImpl->ReceiveUint8Array(aRetVal, aRv, aRealm); | ||||
| 79196 | } | ||||
| 79197 | |||||
| 79198 | void | ||||
| 79199 | TestJSImplInterface::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 79200 | { | ||||
| 79201 | return mImpl->GetUint8ArrayAttr(aRetVal, aRv, aRealm); | ||||
| 79202 | } | ||||
| 79203 | |||||
| 79204 | void | ||||
| 79205 | TestJSImplInterface::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79206 | { | ||||
| 79207 | mImpl->SetUint8ArrayAttr(arg, aRv, aRealm); | ||||
| 79208 | } | ||||
| 79209 | |||||
| 79210 | void | ||||
| 79211 | TestJSImplInterface::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79212 | { | ||||
| 79213 | return mImpl->PassString(arg, aRv, aRealm); | ||||
| 79214 | } | ||||
| 79215 | |||||
| 79216 | void | ||||
| 79217 | TestJSImplInterface::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79218 | { | ||||
| 79219 | return mImpl->PassNullableString(arg, aRv, aRealm); | ||||
| 79220 | } | ||||
| 79221 | |||||
| 79222 | void | ||||
| 79223 | TestJSImplInterface::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79224 | { | ||||
| 79225 | return mImpl->PassOptionalString(arg, aRv, aRealm); | ||||
| 79226 | } | ||||
| 79227 | |||||
| 79228 | void | ||||
| 79229 | TestJSImplInterface::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79230 | { | ||||
| 79231 | return mImpl->PassOptionalStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79232 | } | ||||
| 79233 | |||||
| 79234 | void | ||||
| 79235 | TestJSImplInterface::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79236 | { | ||||
| 79237 | return mImpl->PassOptionalNullableString(arg, aRv, aRealm); | ||||
| 79238 | } | ||||
| 79239 | |||||
| 79240 | void | ||||
| 79241 | TestJSImplInterface::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79242 | { | ||||
| 79243 | return mImpl->PassOptionalNullableStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79244 | } | ||||
| 79245 | |||||
| 79246 | void | ||||
| 79247 | TestJSImplInterface::PassVariadicString(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79248 | { | ||||
| 79249 | return mImpl->PassVariadicString(arg, aRv, aRealm); | ||||
| 79250 | } | ||||
| 79251 | |||||
| 79252 | void | ||||
| 79253 | TestJSImplInterface::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79254 | { | ||||
| 79255 | return mImpl->PassByteString(arg, aRv, aRealm); | ||||
| 79256 | } | ||||
| 79257 | |||||
| 79258 | void | ||||
| 79259 | TestJSImplInterface::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79260 | { | ||||
| 79261 | return mImpl->PassNullableByteString(arg, aRv, aRealm); | ||||
| 79262 | } | ||||
| 79263 | |||||
| 79264 | void | ||||
| 79265 | TestJSImplInterface::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79266 | { | ||||
| 79267 | return mImpl->PassOptionalByteString(arg, aRv, aRealm); | ||||
| 79268 | } | ||||
| 79269 | |||||
| 79270 | void | ||||
| 79271 | TestJSImplInterface::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79272 | { | ||||
| 79273 | return mImpl->PassOptionalByteStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79274 | } | ||||
| 79275 | |||||
| 79276 | void | ||||
| 79277 | TestJSImplInterface::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79278 | { | ||||
| 79279 | return mImpl->PassOptionalNullableByteString(arg, aRv, aRealm); | ||||
| 79280 | } | ||||
| 79281 | |||||
| 79282 | void | ||||
| 79283 | TestJSImplInterface::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79284 | { | ||||
| 79285 | return mImpl->PassOptionalNullableByteStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79286 | } | ||||
| 79287 | |||||
| 79288 | void | ||||
| 79289 | TestJSImplInterface::PassVariadicByteString(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79290 | { | ||||
| 79291 | return mImpl->PassVariadicByteString(arg, aRv, aRealm); | ||||
| 79292 | } | ||||
| 79293 | |||||
| 79294 | void | ||||
| 79295 | TestJSImplInterface::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79296 | { | ||||
| 79297 | return mImpl->PassUnionByteString(arg, aRv, aRealm); | ||||
| 79298 | } | ||||
| 79299 | |||||
| 79300 | void | ||||
| 79301 | TestJSImplInterface::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79302 | { | ||||
| 79303 | return mImpl->PassOptionalUnionByteString(arg, aRv, aRealm); | ||||
| 79304 | } | ||||
| 79305 | |||||
| 79306 | void | ||||
| 79307 | TestJSImplInterface::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79308 | { | ||||
| 79309 | return mImpl->PassOptionalUnionByteStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79310 | } | ||||
| 79311 | |||||
| 79312 | void | ||||
| 79313 | TestJSImplInterface::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79314 | { | ||||
| 79315 | return mImpl->PassUTF8String(arg, aRv, aRealm); | ||||
| 79316 | } | ||||
| 79317 | |||||
| 79318 | void | ||||
| 79319 | TestJSImplInterface::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79320 | { | ||||
| 79321 | return mImpl->PassNullableUTF8String(arg, aRv, aRealm); | ||||
| 79322 | } | ||||
| 79323 | |||||
| 79324 | void | ||||
| 79325 | TestJSImplInterface::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79326 | { | ||||
| 79327 | return mImpl->PassOptionalUTF8String(arg, aRv, aRealm); | ||||
| 79328 | } | ||||
| 79329 | |||||
| 79330 | void | ||||
| 79331 | TestJSImplInterface::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79332 | { | ||||
| 79333 | return mImpl->PassOptionalUTF8StringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79334 | } | ||||
| 79335 | |||||
| 79336 | void | ||||
| 79337 | TestJSImplInterface::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79338 | { | ||||
| 79339 | return mImpl->PassOptionalNullableUTF8String(arg, aRv, aRealm); | ||||
| 79340 | } | ||||
| 79341 | |||||
| 79342 | void | ||||
| 79343 | TestJSImplInterface::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79344 | { | ||||
| 79345 | return mImpl->PassOptionalNullableUTF8StringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79346 | } | ||||
| 79347 | |||||
| 79348 | void | ||||
| 79349 | TestJSImplInterface::PassVariadicUTF8String(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79350 | { | ||||
| 79351 | return mImpl->PassVariadicUTF8String(arg, aRv, aRealm); | ||||
| 79352 | } | ||||
| 79353 | |||||
| 79354 | void | ||||
| 79355 | TestJSImplInterface::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79356 | { | ||||
| 79357 | return mImpl->PassUnionUTF8String(arg, aRv, aRealm); | ||||
| 79358 | } | ||||
| 79359 | |||||
| 79360 | void | ||||
| 79361 | TestJSImplInterface::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79362 | { | ||||
| 79363 | return mImpl->PassOptionalUnionUTF8String(arg, aRv, aRealm); | ||||
| 79364 | } | ||||
| 79365 | |||||
| 79366 | void | ||||
| 79367 | TestJSImplInterface::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79368 | { | ||||
| 79369 | return mImpl->PassOptionalUnionUTF8StringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79370 | } | ||||
| 79371 | |||||
| 79372 | void | ||||
| 79373 | TestJSImplInterface::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79374 | { | ||||
| 79375 | return mImpl->PassSVS(arg, aRv, aRealm); | ||||
| 79376 | } | ||||
| 79377 | |||||
| 79378 | void | ||||
| 79379 | TestJSImplInterface::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79380 | { | ||||
| 79381 | return mImpl->PassNullableSVS(arg, aRv, aRealm); | ||||
| 79382 | } | ||||
| 79383 | |||||
| 79384 | void | ||||
| 79385 | TestJSImplInterface::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79386 | { | ||||
| 79387 | return mImpl->PassOptionalSVS(arg, aRv, aRealm); | ||||
| 79388 | } | ||||
| 79389 | |||||
| 79390 | void | ||||
| 79391 | TestJSImplInterface::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79392 | { | ||||
| 79393 | return mImpl->PassOptionalSVSWithDefaultValue(arg, aRv, aRealm); | ||||
| 79394 | } | ||||
| 79395 | |||||
| 79396 | void | ||||
| 79397 | TestJSImplInterface::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79398 | { | ||||
| 79399 | return mImpl->PassOptionalNullableSVS(arg, aRv, aRealm); | ||||
| 79400 | } | ||||
| 79401 | |||||
| 79402 | void | ||||
| 79403 | TestJSImplInterface::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79404 | { | ||||
| 79405 | return mImpl->PassOptionalNullableSVSWithDefaultValue(arg, aRv, aRealm); | ||||
| 79406 | } | ||||
| 79407 | |||||
| 79408 | void | ||||
| 79409 | TestJSImplInterface::PassVariadicSVS(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79410 | { | ||||
| 79411 | return mImpl->PassVariadicSVS(arg, aRv, aRealm); | ||||
| 79412 | } | ||||
| 79413 | |||||
| 79414 | void | ||||
| 79415 | TestJSImplInterface::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79416 | { | ||||
| 79417 | return mImpl->ReceiveSVS(aRetVal, aRv, aRealm); | ||||
| 79418 | } | ||||
| 79419 | |||||
| 79420 | void | ||||
| 79421 | TestJSImplInterface::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79422 | { | ||||
| 79423 | return mImpl->PassJSString(arg, aRv, aRealm); | ||||
| 79424 | } | ||||
| 79425 | |||||
| 79426 | void | ||||
| 79427 | TestJSImplInterface::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79428 | { | ||||
| 79429 | return mImpl->PassOptionalJSStringWithDefaultValue(arg, aRv, aRealm); | ||||
| 79430 | } | ||||
| 79431 | |||||
| 79432 | void | ||||
| 79433 | TestJSImplInterface::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79434 | { | ||||
| 79435 | return mImpl->ReceiveJSString(aRetVal, aRv, aRealm); | ||||
| 79436 | } | ||||
| 79437 | |||||
| 79438 | void | ||||
| 79439 | TestJSImplInterface::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 79440 | { | ||||
| 79441 | return mImpl->GetReadonlyJSStringAttr(aRetVal, aRv, aRealm); | ||||
| 79442 | } | ||||
| 79443 | |||||
| 79444 | void | ||||
| 79445 | TestJSImplInterface::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 79446 | { | ||||
| 79447 | return mImpl->GetJsStringAttr(aRetVal, aRv, aRealm); | ||||
| 79448 | } | ||||
| 79449 | |||||
| 79450 | void | ||||
| 79451 | TestJSImplInterface::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79452 | { | ||||
| 79453 | mImpl->SetJsStringAttr(arg, aRv, aRealm); | ||||
| 79454 | } | ||||
| 79455 | |||||
| 79456 | void | ||||
| 79457 | TestJSImplInterface::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79458 | { | ||||
| 79459 | return mImpl->PassEnum(arg, aRv, aRealm); | ||||
| 79460 | } | ||||
| 79461 | |||||
| 79462 | void | ||||
| 79463 | TestJSImplInterface::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79464 | { | ||||
| 79465 | return mImpl->PassNullableEnum(arg, aRv, aRealm); | ||||
| 79466 | } | ||||
| 79467 | |||||
| 79468 | void | ||||
| 79469 | TestJSImplInterface::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79470 | { | ||||
| 79471 | return mImpl->PassOptionalEnum(arg, aRv, aRealm); | ||||
| 79472 | } | ||||
| 79473 | |||||
| 79474 | void | ||||
| 79475 | TestJSImplInterface::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79476 | { | ||||
| 79477 | return mImpl->PassEnumWithDefault(arg, aRv, aRealm); | ||||
| 79478 | } | ||||
| 79479 | |||||
| 79480 | void | ||||
| 79481 | TestJSImplInterface::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79482 | { | ||||
| 79483 | return mImpl->PassOptionalNullableEnum(arg, aRv, aRealm); | ||||
| 79484 | } | ||||
| 79485 | |||||
| 79486 | void | ||||
| 79487 | TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79488 | { | ||||
| 79489 | return mImpl->PassOptionalNullableEnumWithDefaultValue(arg, aRv, aRealm); | ||||
| 79490 | } | ||||
| 79491 | |||||
| 79492 | void | ||||
| 79493 | TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79494 | { | ||||
| 79495 | return mImpl->PassOptionalNullableEnumWithDefaultValue2(arg, aRv, aRealm); | ||||
| 79496 | } | ||||
| 79497 | |||||
| 79498 | MyTestEnum | ||||
| 79499 | TestJSImplInterface::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79500 | { | ||||
| 79501 | return mImpl->ReceiveEnum(aRv, aRealm); | ||||
| 79502 | } | ||||
| 79503 | |||||
| 79504 | Nullable<MyTestEnum> | ||||
| 79505 | TestJSImplInterface::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79506 | { | ||||
| 79507 | return mImpl->ReceiveNullableEnum(aRv, aRealm); | ||||
| 79508 | } | ||||
| 79509 | |||||
| 79510 | MyTestEnum | ||||
| 79511 | TestJSImplInterface::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 79512 | { | ||||
| 79513 | return mImpl->GetEnumAttribute(aRv, aRealm); | ||||
| 79514 | } | ||||
| 79515 | |||||
| 79516 | void | ||||
| 79517 | TestJSImplInterface::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79518 | { | ||||
| 79519 | mImpl->SetEnumAttribute(arg, aRv, aRealm); | ||||
| 79520 | } | ||||
| 79521 | |||||
| 79522 | MyTestEnum | ||||
| 79523 | TestJSImplInterface::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 79524 | { | ||||
| 79525 | return mImpl->GetReadonlyEnumAttribute(aRv, aRealm); | ||||
| 79526 | } | ||||
| 79527 | |||||
| 79528 | void | ||||
| 79529 | TestJSImplInterface::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79530 | { | ||||
| 79531 | return mImpl->PassCallback(arg, aRv, aRealm); | ||||
| 79532 | } | ||||
| 79533 | |||||
| 79534 | void | ||||
| 79535 | TestJSImplInterface::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79536 | { | ||||
| 79537 | return mImpl->PassNullableCallback(arg, aRv, aRealm); | ||||
| 79538 | } | ||||
| 79539 | |||||
| 79540 | void | ||||
| 79541 | TestJSImplInterface::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79542 | { | ||||
| 79543 | return mImpl->PassOptionalCallback(arg, aRv, aRealm); | ||||
| 79544 | } | ||||
| 79545 | |||||
| 79546 | void | ||||
| 79547 | TestJSImplInterface::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79548 | { | ||||
| 79549 | return mImpl->PassOptionalNullableCallback(arg, aRv, aRealm); | ||||
| 79550 | } | ||||
| 79551 | |||||
| 79552 | void | ||||
| 79553 | TestJSImplInterface::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79554 | { | ||||
| 79555 | return mImpl->PassOptionalNullableCallbackWithDefaultValue(arg, aRv, aRealm); | ||||
| 79556 | } | ||||
| 79557 | |||||
| 79558 | already_AddRefed<MyTestCallback> | ||||
| 79559 | TestJSImplInterface::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79560 | { | ||||
| 79561 | return mImpl->ReceiveCallback(aRv, aRealm); | ||||
| 79562 | } | ||||
| 79563 | |||||
| 79564 | already_AddRefed<MyTestCallback> | ||||
| 79565 | TestJSImplInterface::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79566 | { | ||||
| 79567 | return mImpl->ReceiveNullableCallback(aRv, aRealm); | ||||
| 79568 | } | ||||
| 79569 | |||||
| 79570 | void | ||||
| 79571 | TestJSImplInterface::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79572 | { | ||||
| 79573 | return mImpl->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(arg, aRv, aRealm); | ||||
| 79574 | } | ||||
| 79575 | |||||
| 79576 | void | ||||
| 79577 | TestJSImplInterface::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79578 | { | ||||
| 79579 | return mImpl->PassAny(arg, aRv, aRealm); | ||||
| 79580 | } | ||||
| 79581 | |||||
| 79582 | void | ||||
| 79583 | TestJSImplInterface::PassVariadicAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79584 | { | ||||
| 79585 | return mImpl->PassVariadicAny(arg, aRv, aRealm); | ||||
| 79586 | } | ||||
| 79587 | |||||
| 79588 | void | ||||
| 79589 | TestJSImplInterface::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79590 | { | ||||
| 79591 | return mImpl->PassOptionalAny(arg, aRv, aRealm); | ||||
| 79592 | } | ||||
| 79593 | |||||
| 79594 | void | ||||
| 79595 | TestJSImplInterface::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79596 | { | ||||
| 79597 | return mImpl->PassAnyDefaultNull(arg, aRv, aRealm); | ||||
| 79598 | } | ||||
| 79599 | |||||
| 79600 | void | ||||
| 79601 | TestJSImplInterface::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79602 | { | ||||
| 79603 | return mImpl->PassSequenceOfAny(arg, aRv, aRealm); | ||||
| 79604 | } | ||||
| 79605 | |||||
| 79606 | void | ||||
| 79607 | TestJSImplInterface::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79608 | { | ||||
| 79609 | return mImpl->PassNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79610 | } | ||||
| 79611 | |||||
| 79612 | void | ||||
| 79613 | TestJSImplInterface::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79614 | { | ||||
| 79615 | return mImpl->PassOptionalSequenceOfAny(arg, aRv, aRealm); | ||||
| 79616 | } | ||||
| 79617 | |||||
| 79618 | void | ||||
| 79619 | TestJSImplInterface::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79620 | { | ||||
| 79621 | return mImpl->PassOptionalNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79622 | } | ||||
| 79623 | |||||
| 79624 | void | ||||
| 79625 | TestJSImplInterface::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79626 | { | ||||
| 79627 | return mImpl->PassOptionalSequenceOfAnyWithDefaultValue(arg, aRv, aRealm); | ||||
| 79628 | } | ||||
| 79629 | |||||
| 79630 | void | ||||
| 79631 | TestJSImplInterface::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79632 | { | ||||
| 79633 | return mImpl->PassSequenceOfSequenceOfAny(arg, aRv, aRealm); | ||||
| 79634 | } | ||||
| 79635 | |||||
| 79636 | void | ||||
| 79637 | TestJSImplInterface::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79638 | { | ||||
| 79639 | return mImpl->PassSequenceOfNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79640 | } | ||||
| 79641 | |||||
| 79642 | void | ||||
| 79643 | TestJSImplInterface::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79644 | { | ||||
| 79645 | return mImpl->PassNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79646 | } | ||||
| 79647 | |||||
| 79648 | void | ||||
| 79649 | TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79650 | { | ||||
| 79651 | return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79652 | } | ||||
| 79653 | |||||
| 79654 | void | ||||
| 79655 | TestJSImplInterface::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79656 | { | ||||
| 79657 | return mImpl->PassRecordOfAny(arg, aRv, aRealm); | ||||
| 79658 | } | ||||
| 79659 | |||||
| 79660 | void | ||||
| 79661 | TestJSImplInterface::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79662 | { | ||||
| 79663 | return mImpl->PassNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79664 | } | ||||
| 79665 | |||||
| 79666 | void | ||||
| 79667 | TestJSImplInterface::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79668 | { | ||||
| 79669 | return mImpl->PassOptionalRecordOfAny(arg, aRv, aRealm); | ||||
| 79670 | } | ||||
| 79671 | |||||
| 79672 | void | ||||
| 79673 | TestJSImplInterface::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79674 | { | ||||
| 79675 | return mImpl->PassOptionalNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79676 | } | ||||
| 79677 | |||||
| 79678 | void | ||||
| 79679 | TestJSImplInterface::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79680 | { | ||||
| 79681 | return mImpl->PassOptionalRecordOfAnyWithDefaultValue(arg, aRv, aRealm); | ||||
| 79682 | } | ||||
| 79683 | |||||
| 79684 | void | ||||
| 79685 | TestJSImplInterface::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79686 | { | ||||
| 79687 | return mImpl->PassRecordOfRecordOfAny(arg, aRv, aRealm); | ||||
| 79688 | } | ||||
| 79689 | |||||
| 79690 | void | ||||
| 79691 | TestJSImplInterface::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79692 | { | ||||
| 79693 | return mImpl->PassRecordOfNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79694 | } | ||||
| 79695 | |||||
| 79696 | void | ||||
| 79697 | TestJSImplInterface::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79698 | { | ||||
| 79699 | return mImpl->PassNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79700 | } | ||||
| 79701 | |||||
| 79702 | void | ||||
| 79703 | TestJSImplInterface::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79704 | { | ||||
| 79705 | return mImpl->PassOptionalNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79706 | } | ||||
| 79707 | |||||
| 79708 | void | ||||
| 79709 | TestJSImplInterface::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79710 | { | ||||
| 79711 | return mImpl->PassOptionalNullableRecordOfNullableSequenceOfAny(arg, aRv, aRealm); | ||||
| 79712 | } | ||||
| 79713 | |||||
| 79714 | void | ||||
| 79715 | TestJSImplInterface::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79716 | { | ||||
| 79717 | return mImpl->PassOptionalNullableSequenceOfNullableRecordOfAny(arg, aRv, aRealm); | ||||
| 79718 | } | ||||
| 79719 | |||||
| 79720 | void | ||||
| 79721 | TestJSImplInterface::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79722 | { | ||||
| 79723 | return mImpl->ReceiveAny(aRetVal, aRv, aRealm); | ||||
| 79724 | } | ||||
| 79725 | |||||
| 79726 | void | ||||
| 79727 | TestJSImplInterface::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79728 | { | ||||
| 79729 | return mImpl->PassObject(arg, aRv, aRealm); | ||||
| 79730 | } | ||||
| 79731 | |||||
| 79732 | void | ||||
| 79733 | TestJSImplInterface::PassVariadicObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79734 | { | ||||
| 79735 | return mImpl->PassVariadicObject(arg, aRv, aRealm); | ||||
| 79736 | } | ||||
| 79737 | |||||
| 79738 | void | ||||
| 79739 | TestJSImplInterface::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79740 | { | ||||
| 79741 | return mImpl->PassNullableObject(arg, aRv, aRealm); | ||||
| 79742 | } | ||||
| 79743 | |||||
| 79744 | void | ||||
| 79745 | TestJSImplInterface::PassVariadicNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79746 | { | ||||
| 79747 | return mImpl->PassVariadicNullableObject(arg, aRv, aRealm); | ||||
| 79748 | } | ||||
| 79749 | |||||
| 79750 | void | ||||
| 79751 | TestJSImplInterface::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79752 | { | ||||
| 79753 | return mImpl->PassOptionalObject(arg, aRv, aRealm); | ||||
| 79754 | } | ||||
| 79755 | |||||
| 79756 | void | ||||
| 79757 | TestJSImplInterface::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79758 | { | ||||
| 79759 | return mImpl->PassOptionalNullableObject(arg, aRv, aRealm); | ||||
| 79760 | } | ||||
| 79761 | |||||
| 79762 | void | ||||
| 79763 | TestJSImplInterface::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79764 | { | ||||
| 79765 | return mImpl->PassOptionalNullableObjectWithDefaultValue(arg, aRv, aRealm); | ||||
| 79766 | } | ||||
| 79767 | |||||
| 79768 | void | ||||
| 79769 | TestJSImplInterface::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79770 | { | ||||
| 79771 | return mImpl->PassSequenceOfObject(arg, aRv, aRealm); | ||||
| 79772 | } | ||||
| 79773 | |||||
| 79774 | void | ||||
| 79775 | TestJSImplInterface::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79776 | { | ||||
| 79777 | return mImpl->PassSequenceOfNullableObject(arg, aRv, aRealm); | ||||
| 79778 | } | ||||
| 79779 | |||||
| 79780 | void | ||||
| 79781 | TestJSImplInterface::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79782 | { | ||||
| 79783 | return mImpl->PassNullableSequenceOfObject(arg, aRv, aRealm); | ||||
| 79784 | } | ||||
| 79785 | |||||
| 79786 | void | ||||
| 79787 | TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79788 | { | ||||
| 79789 | return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfObject(arg, aRv, aRealm); | ||||
| 79790 | } | ||||
| 79791 | |||||
| 79792 | void | ||||
| 79793 | TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79794 | { | ||||
| 79795 | return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(arg, aRv, aRealm); | ||||
| 79796 | } | ||||
| 79797 | |||||
| 79798 | void | ||||
| 79799 | TestJSImplInterface::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79800 | { | ||||
| 79801 | return mImpl->PassRecordOfObject(arg, aRv, aRealm); | ||||
| 79802 | } | ||||
| 79803 | |||||
| 79804 | void | ||||
| 79805 | TestJSImplInterface::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79806 | { | ||||
| 79807 | return mImpl->ReceiveObject(aRetVal, aRv, aRealm); | ||||
| 79808 | } | ||||
| 79809 | |||||
| 79810 | void | ||||
| 79811 | TestJSImplInterface::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79812 | { | ||||
| 79813 | return mImpl->ReceiveNullableObject(aRetVal, aRv, aRealm); | ||||
| 79814 | } | ||||
| 79815 | |||||
| 79816 | void | ||||
| 79817 | TestJSImplInterface::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79818 | { | ||||
| 79819 | return mImpl->PassUnion(arg, aRv, aRealm); | ||||
| 79820 | } | ||||
| 79821 | |||||
| 79822 | void | ||||
| 79823 | TestJSImplInterface::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79824 | { | ||||
| 79825 | return mImpl->PassUnion2(arg, aRv, aRealm); | ||||
| 79826 | } | ||||
| 79827 | |||||
| 79828 | void | ||||
| 79829 | TestJSImplInterface::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79830 | { | ||||
| 79831 | return mImpl->PassUnion3(arg, aRv, aRealm); | ||||
| 79832 | } | ||||
| 79833 | |||||
| 79834 | void | ||||
| 79835 | TestJSImplInterface::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79836 | { | ||||
| 79837 | return mImpl->PassUnion4(arg, aRv, aRealm); | ||||
| 79838 | } | ||||
| 79839 | |||||
| 79840 | void | ||||
| 79841 | TestJSImplInterface::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79842 | { | ||||
| 79843 | return mImpl->PassUnion5(arg, aRv, aRealm); | ||||
| 79844 | } | ||||
| 79845 | |||||
| 79846 | void | ||||
| 79847 | TestJSImplInterface::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79848 | { | ||||
| 79849 | return mImpl->PassUnion6(arg, aRv, aRealm); | ||||
| 79850 | } | ||||
| 79851 | |||||
| 79852 | void | ||||
| 79853 | TestJSImplInterface::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79854 | { | ||||
| 79855 | return mImpl->PassUnion7(arg, aRv, aRealm); | ||||
| 79856 | } | ||||
| 79857 | |||||
| 79858 | void | ||||
| 79859 | TestJSImplInterface::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79860 | { | ||||
| 79861 | return mImpl->PassUnion8(arg, aRv, aRealm); | ||||
| 79862 | } | ||||
| 79863 | |||||
| 79864 | void | ||||
| 79865 | TestJSImplInterface::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79866 | { | ||||
| 79867 | return mImpl->PassUnion9(arg, aRv, aRealm); | ||||
| 79868 | } | ||||
| 79869 | |||||
| 79870 | void | ||||
| 79871 | TestJSImplInterface::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79872 | { | ||||
| 79873 | return mImpl->PassUnion10(arg, aRv, aRealm); | ||||
| 79874 | } | ||||
| 79875 | |||||
| 79876 | void | ||||
| 79877 | TestJSImplInterface::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79878 | { | ||||
| 79879 | return mImpl->PassUnion11(arg, aRv, aRealm); | ||||
| 79880 | } | ||||
| 79881 | |||||
| 79882 | void | ||||
| 79883 | TestJSImplInterface::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79884 | { | ||||
| 79885 | return mImpl->PassUnion12(arg, aRv, aRealm); | ||||
| 79886 | } | ||||
| 79887 | |||||
| 79888 | void | ||||
| 79889 | TestJSImplInterface::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79890 | { | ||||
| 79891 | return mImpl->PassUnion13(arg, aRv, aRealm); | ||||
| 79892 | } | ||||
| 79893 | |||||
| 79894 | void | ||||
| 79895 | TestJSImplInterface::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79896 | { | ||||
| 79897 | return mImpl->PassUnion14(arg, aRv, aRealm); | ||||
| 79898 | } | ||||
| 79899 | |||||
| 79900 | void | ||||
| 79901 | TestJSImplInterface::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79902 | { | ||||
| 79903 | return mImpl->PassUnion15(arg, aRv, aRealm); | ||||
| 79904 | } | ||||
| 79905 | |||||
| 79906 | void | ||||
| 79907 | TestJSImplInterface::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79908 | { | ||||
| 79909 | return mImpl->PassUnion16(arg, aRv, aRealm); | ||||
| 79910 | } | ||||
| 79911 | |||||
| 79912 | void | ||||
| 79913 | TestJSImplInterface::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79914 | { | ||||
| 79915 | return mImpl->PassUnion17(arg, aRv, aRealm); | ||||
| 79916 | } | ||||
| 79917 | |||||
| 79918 | void | ||||
| 79919 | TestJSImplInterface::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79920 | { | ||||
| 79921 | return mImpl->PassUnion18(arg, aRv, aRealm); | ||||
| 79922 | } | ||||
| 79923 | |||||
| 79924 | void | ||||
| 79925 | TestJSImplInterface::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79926 | { | ||||
| 79927 | return mImpl->PassUnion19(arg, aRv, aRealm); | ||||
| 79928 | } | ||||
| 79929 | |||||
| 79930 | void | ||||
| 79931 | TestJSImplInterface::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79932 | { | ||||
| 79933 | return mImpl->PassUnion20(arg, aRv, aRealm); | ||||
| 79934 | } | ||||
| 79935 | |||||
| 79936 | void | ||||
| 79937 | TestJSImplInterface::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79938 | { | ||||
| 79939 | return mImpl->PassUnion21(arg, aRv, aRealm); | ||||
| 79940 | } | ||||
| 79941 | |||||
| 79942 | void | ||||
| 79943 | TestJSImplInterface::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79944 | { | ||||
| 79945 | return mImpl->PassUnion22(arg, aRv, aRealm); | ||||
| 79946 | } | ||||
| 79947 | |||||
| 79948 | void | ||||
| 79949 | TestJSImplInterface::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79950 | { | ||||
| 79951 | return mImpl->PassUnion23(arg, aRv, aRealm); | ||||
| 79952 | } | ||||
| 79953 | |||||
| 79954 | void | ||||
| 79955 | TestJSImplInterface::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79956 | { | ||||
| 79957 | return mImpl->PassUnion24(arg, aRv, aRealm); | ||||
| 79958 | } | ||||
| 79959 | |||||
| 79960 | void | ||||
| 79961 | TestJSImplInterface::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79962 | { | ||||
| 79963 | return mImpl->PassUnion25(arg, aRv, aRealm); | ||||
| 79964 | } | ||||
| 79965 | |||||
| 79966 | void | ||||
| 79967 | TestJSImplInterface::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79968 | { | ||||
| 79969 | return mImpl->PassUnion26(arg, aRv, aRealm); | ||||
| 79970 | } | ||||
| 79971 | |||||
| 79972 | void | ||||
| 79973 | TestJSImplInterface::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79974 | { | ||||
| 79975 | return mImpl->PassUnion27(arg, aRv, aRealm); | ||||
| 79976 | } | ||||
| 79977 | |||||
| 79978 | void | ||||
| 79979 | TestJSImplInterface::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79980 | { | ||||
| 79981 | return mImpl->PassUnion28(arg, aRv, aRealm); | ||||
| 79982 | } | ||||
| 79983 | |||||
| 79984 | void | ||||
| 79985 | TestJSImplInterface::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79986 | { | ||||
| 79987 | return mImpl->PassUnionWithCallback(arg, aRv, aRealm); | ||||
| 79988 | } | ||||
| 79989 | |||||
| 79990 | void | ||||
| 79991 | TestJSImplInterface::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79992 | { | ||||
| 79993 | return mImpl->PassUnionWithByteString(arg, aRv, aRealm); | ||||
| 79994 | } | ||||
| 79995 | |||||
| 79996 | void | ||||
| 79997 | TestJSImplInterface::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 79998 | { | ||||
| 79999 | return mImpl->PassUnionWithUTF8String(arg, aRv, aRealm); | ||||
| 80000 | } | ||||
| 80001 | |||||
| 80002 | void | ||||
| 80003 | TestJSImplInterface::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80004 | { | ||||
| 80005 | return mImpl->PassUnionWithRecord(arg, aRv, aRealm); | ||||
| 80006 | } | ||||
| 80007 | |||||
| 80008 | void | ||||
| 80009 | TestJSImplInterface::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80010 | { | ||||
| 80011 | return mImpl->PassUnionWithRecordAndSequence(arg, aRv, aRealm); | ||||
| 80012 | } | ||||
| 80013 | |||||
| 80014 | void | ||||
| 80015 | TestJSImplInterface::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80016 | { | ||||
| 80017 | return mImpl->PassUnionWithSequenceAndRecord(arg, aRv, aRealm); | ||||
| 80018 | } | ||||
| 80019 | |||||
| 80020 | void | ||||
| 80021 | TestJSImplInterface::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80022 | { | ||||
| 80023 | return mImpl->PassUnionWithSVS(arg, aRv, aRealm); | ||||
| 80024 | } | ||||
| 80025 | |||||
| 80026 | void | ||||
| 80027 | TestJSImplInterface::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80028 | { | ||||
| 80029 | return mImpl->PassUnionWithNullable(arg, aRv, aRealm); | ||||
| 80030 | } | ||||
| 80031 | |||||
| 80032 | void | ||||
| 80033 | TestJSImplInterface::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80034 | { | ||||
| 80035 | return mImpl->PassNullableUnion(arg, aRv, aRealm); | ||||
| 80036 | } | ||||
| 80037 | |||||
| 80038 | void | ||||
| 80039 | TestJSImplInterface::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80040 | { | ||||
| 80041 | return mImpl->PassOptionalUnion(arg, aRv, aRealm); | ||||
| 80042 | } | ||||
| 80043 | |||||
| 80044 | void | ||||
| 80045 | TestJSImplInterface::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80046 | { | ||||
| 80047 | return mImpl->PassOptionalNullableUnion(arg, aRv, aRealm); | ||||
| 80048 | } | ||||
| 80049 | |||||
| 80050 | void | ||||
| 80051 | TestJSImplInterface::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80052 | { | ||||
| 80053 | return mImpl->PassOptionalNullableUnionWithDefaultValue(arg, aRv, aRealm); | ||||
| 80054 | } | ||||
| 80055 | |||||
| 80056 | void | ||||
| 80057 | TestJSImplInterface::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80058 | { | ||||
| 80059 | return mImpl->PassUnionWithArrayBuffer(arg, aRv, aRealm); | ||||
| 80060 | } | ||||
| 80061 | |||||
| 80062 | void | ||||
| 80063 | TestJSImplInterface::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80064 | { | ||||
| 80065 | return mImpl->PassUnionWithArrayBufferOrNull(arg, aRv, aRealm); | ||||
| 80066 | } | ||||
| 80067 | |||||
| 80068 | void | ||||
| 80069 | TestJSImplInterface::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80070 | { | ||||
| 80071 | return mImpl->PassUnionWithTypedArrays(arg, aRv, aRealm); | ||||
| 80072 | } | ||||
| 80073 | |||||
| 80074 | void | ||||
| 80075 | TestJSImplInterface::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80076 | { | ||||
| 80077 | return mImpl->PassUnionWithTypedArraysOrNull(arg, aRv, aRealm); | ||||
| 80078 | } | ||||
| 80079 | |||||
| 80080 | void | ||||
| 80081 | TestJSImplInterface::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80082 | { | ||||
| 80083 | return mImpl->PassUnionWithString(arg, aRv, aRealm); | ||||
| 80084 | } | ||||
| 80085 | |||||
| 80086 | void | ||||
| 80087 | TestJSImplInterface::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80088 | { | ||||
| 80089 | return mImpl->PassUnionWithEnum(arg, aRv, aRealm); | ||||
| 80090 | } | ||||
| 80091 | |||||
| 80092 | void | ||||
| 80093 | TestJSImplInterface::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80094 | { | ||||
| 80095 | return mImpl->PassUnionWithObject(arg, aRv, aRealm); | ||||
| 80096 | } | ||||
| 80097 | |||||
| 80098 | void | ||||
| 80099 | TestJSImplInterface::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80100 | { | ||||
| 80101 | return mImpl->PassUnionWithDefaultValue1(arg, aRv, aRealm); | ||||
| 80102 | } | ||||
| 80103 | |||||
| 80104 | void | ||||
| 80105 | TestJSImplInterface::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80106 | { | ||||
| 80107 | return mImpl->PassUnionWithDefaultValue2(arg, aRv, aRealm); | ||||
| 80108 | } | ||||
| 80109 | |||||
| 80110 | void | ||||
| 80111 | TestJSImplInterface::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80112 | { | ||||
| 80113 | return mImpl->PassUnionWithDefaultValue3(arg, aRv, aRealm); | ||||
| 80114 | } | ||||
| 80115 | |||||
| 80116 | void | ||||
| 80117 | TestJSImplInterface::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80118 | { | ||||
| 80119 | return mImpl->PassUnionWithDefaultValue4(arg, aRv, aRealm); | ||||
| 80120 | } | ||||
| 80121 | |||||
| 80122 | void | ||||
| 80123 | TestJSImplInterface::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80124 | { | ||||
| 80125 | return mImpl->PassUnionWithDefaultValue5(arg, aRv, aRealm); | ||||
| 80126 | } | ||||
| 80127 | |||||
| 80128 | void | ||||
| 80129 | TestJSImplInterface::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80130 | { | ||||
| 80131 | return mImpl->PassUnionWithDefaultValue6(arg, aRv, aRealm); | ||||
| 80132 | } | ||||
| 80133 | |||||
| 80134 | void | ||||
| 80135 | TestJSImplInterface::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80136 | { | ||||
| 80137 | return mImpl->PassUnionWithDefaultValue7(arg, aRv, aRealm); | ||||
| 80138 | } | ||||
| 80139 | |||||
| 80140 | void | ||||
| 80141 | TestJSImplInterface::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80142 | { | ||||
| 80143 | return mImpl->PassUnionWithDefaultValue8(arg, aRv, aRealm); | ||||
| 80144 | } | ||||
| 80145 | |||||
| 80146 | void | ||||
| 80147 | TestJSImplInterface::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80148 | { | ||||
| 80149 | return mImpl->PassUnionWithDefaultValue9(arg, aRv, aRealm); | ||||
| 80150 | } | ||||
| 80151 | |||||
| 80152 | void | ||||
| 80153 | TestJSImplInterface::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80154 | { | ||||
| 80155 | return mImpl->PassUnionWithDefaultValue10(arg, aRv, aRealm); | ||||
| 80156 | } | ||||
| 80157 | |||||
| 80158 | void | ||||
| 80159 | TestJSImplInterface::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80160 | { | ||||
| 80161 | return mImpl->PassUnionWithDefaultValue11(arg, aRv, aRealm); | ||||
| 80162 | } | ||||
| 80163 | |||||
| 80164 | void | ||||
| 80165 | TestJSImplInterface::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80166 | { | ||||
| 80167 | return mImpl->PassUnionWithDefaultValue12(arg, aRv, aRealm); | ||||
| 80168 | } | ||||
| 80169 | |||||
| 80170 | void | ||||
| 80171 | TestJSImplInterface::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80172 | { | ||||
| 80173 | return mImpl->PassUnionWithDefaultValue13(arg, aRv, aRealm); | ||||
| 80174 | } | ||||
| 80175 | |||||
| 80176 | void | ||||
| 80177 | TestJSImplInterface::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80178 | { | ||||
| 80179 | return mImpl->PassUnionWithDefaultValue14(arg, aRv, aRealm); | ||||
| 80180 | } | ||||
| 80181 | |||||
| 80182 | void | ||||
| 80183 | TestJSImplInterface::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80184 | { | ||||
| 80185 | return mImpl->PassUnionWithDefaultValue15(arg, aRv, aRealm); | ||||
| 80186 | } | ||||
| 80187 | |||||
| 80188 | void | ||||
| 80189 | TestJSImplInterface::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80190 | { | ||||
| 80191 | return mImpl->PassUnionWithDefaultValue16(arg, aRv, aRealm); | ||||
| 80192 | } | ||||
| 80193 | |||||
| 80194 | void | ||||
| 80195 | TestJSImplInterface::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80196 | { | ||||
| 80197 | return mImpl->PassUnionWithDefaultValue17(arg, aRv, aRealm); | ||||
| 80198 | } | ||||
| 80199 | |||||
| 80200 | void | ||||
| 80201 | TestJSImplInterface::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80202 | { | ||||
| 80203 | return mImpl->PassUnionWithDefaultValue18(arg, aRv, aRealm); | ||||
| 80204 | } | ||||
| 80205 | |||||
| 80206 | void | ||||
| 80207 | TestJSImplInterface::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80208 | { | ||||
| 80209 | return mImpl->PassUnionWithDefaultValue19(arg, aRv, aRealm); | ||||
| 80210 | } | ||||
| 80211 | |||||
| 80212 | void | ||||
| 80213 | TestJSImplInterface::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80214 | { | ||||
| 80215 | return mImpl->PassUnionWithDefaultValue20(arg, aRv, aRealm); | ||||
| 80216 | } | ||||
| 80217 | |||||
| 80218 | void | ||||
| 80219 | TestJSImplInterface::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80220 | { | ||||
| 80221 | return mImpl->PassUnionWithDefaultValue21(arg, aRv, aRealm); | ||||
| 80222 | } | ||||
| 80223 | |||||
| 80224 | void | ||||
| 80225 | TestJSImplInterface::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80226 | { | ||||
| 80227 | return mImpl->PassUnionWithDefaultValue22(arg, aRv, aRealm); | ||||
| 80228 | } | ||||
| 80229 | |||||
| 80230 | void | ||||
| 80231 | TestJSImplInterface::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80232 | { | ||||
| 80233 | return mImpl->PassUnionWithDefaultValue23(arg, aRv, aRealm); | ||||
| 80234 | } | ||||
| 80235 | |||||
| 80236 | void | ||||
| 80237 | TestJSImplInterface::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80238 | { | ||||
| 80239 | return mImpl->PassUnionWithDefaultValue24(arg, aRv, aRealm); | ||||
| 80240 | } | ||||
| 80241 | |||||
| 80242 | void | ||||
| 80243 | TestJSImplInterface::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80244 | { | ||||
| 80245 | return mImpl->PassUnionWithDefaultValue25(arg, aRv, aRealm); | ||||
| 80246 | } | ||||
| 80247 | |||||
| 80248 | void | ||||
| 80249 | TestJSImplInterface::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80250 | { | ||||
| 80251 | return mImpl->PassNullableUnionWithDefaultValue1(arg, aRv, aRealm); | ||||
| 80252 | } | ||||
| 80253 | |||||
| 80254 | void | ||||
| 80255 | TestJSImplInterface::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80256 | { | ||||
| 80257 | return mImpl->PassNullableUnionWithDefaultValue2(arg, aRv, aRealm); | ||||
| 80258 | } | ||||
| 80259 | |||||
| 80260 | void | ||||
| 80261 | TestJSImplInterface::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80262 | { | ||||
| 80263 | return mImpl->PassNullableUnionWithDefaultValue3(arg, aRv, aRealm); | ||||
| 80264 | } | ||||
| 80265 | |||||
| 80266 | void | ||||
| 80267 | TestJSImplInterface::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80268 | { | ||||
| 80269 | return mImpl->PassNullableUnionWithDefaultValue4(arg, aRv, aRealm); | ||||
| 80270 | } | ||||
| 80271 | |||||
| 80272 | void | ||||
| 80273 | TestJSImplInterface::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80274 | { | ||||
| 80275 | return mImpl->PassNullableUnionWithDefaultValue5(arg, aRv, aRealm); | ||||
| 80276 | } | ||||
| 80277 | |||||
| 80278 | void | ||||
| 80279 | TestJSImplInterface::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80280 | { | ||||
| 80281 | return mImpl->PassNullableUnionWithDefaultValue6(arg, aRv, aRealm); | ||||
| 80282 | } | ||||
| 80283 | |||||
| 80284 | void | ||||
| 80285 | TestJSImplInterface::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80286 | { | ||||
| 80287 | return mImpl->PassNullableUnionWithDefaultValue7(arg, aRv, aRealm); | ||||
| 80288 | } | ||||
| 80289 | |||||
| 80290 | void | ||||
| 80291 | TestJSImplInterface::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80292 | { | ||||
| 80293 | return mImpl->PassNullableUnionWithDefaultValue8(arg, aRv, aRealm); | ||||
| 80294 | } | ||||
| 80295 | |||||
| 80296 | void | ||||
| 80297 | TestJSImplInterface::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80298 | { | ||||
| 80299 | return mImpl->PassNullableUnionWithDefaultValue9(arg, aRv, aRealm); | ||||
| 80300 | } | ||||
| 80301 | |||||
| 80302 | void | ||||
| 80303 | TestJSImplInterface::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80304 | { | ||||
| 80305 | return mImpl->PassNullableUnionWithDefaultValue10(arg, aRv, aRealm); | ||||
| 80306 | } | ||||
| 80307 | |||||
| 80308 | void | ||||
| 80309 | TestJSImplInterface::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80310 | { | ||||
| 80311 | return mImpl->PassNullableUnionWithDefaultValue11(arg, aRv, aRealm); | ||||
| 80312 | } | ||||
| 80313 | |||||
| 80314 | void | ||||
| 80315 | TestJSImplInterface::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80316 | { | ||||
| 80317 | return mImpl->PassNullableUnionWithDefaultValue12(arg, aRv, aRealm); | ||||
| 80318 | } | ||||
| 80319 | |||||
| 80320 | void | ||||
| 80321 | TestJSImplInterface::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80322 | { | ||||
| 80323 | return mImpl->PassNullableUnionWithDefaultValue13(arg, aRv, aRealm); | ||||
| 80324 | } | ||||
| 80325 | |||||
| 80326 | void | ||||
| 80327 | TestJSImplInterface::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80328 | { | ||||
| 80329 | return mImpl->PassNullableUnionWithDefaultValue14(arg, aRv, aRealm); | ||||
| 80330 | } | ||||
| 80331 | |||||
| 80332 | void | ||||
| 80333 | TestJSImplInterface::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80334 | { | ||||
| 80335 | return mImpl->PassNullableUnionWithDefaultValue15(arg, aRv, aRealm); | ||||
| 80336 | } | ||||
| 80337 | |||||
| 80338 | void | ||||
| 80339 | TestJSImplInterface::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80340 | { | ||||
| 80341 | return mImpl->PassNullableUnionWithDefaultValue16(arg, aRv, aRealm); | ||||
| 80342 | } | ||||
| 80343 | |||||
| 80344 | void | ||||
| 80345 | TestJSImplInterface::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80346 | { | ||||
| 80347 | return mImpl->PassNullableUnionWithDefaultValue17(arg, aRv, aRealm); | ||||
| 80348 | } | ||||
| 80349 | |||||
| 80350 | void | ||||
| 80351 | TestJSImplInterface::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80352 | { | ||||
| 80353 | return mImpl->PassNullableUnionWithDefaultValue18(arg, aRv, aRealm); | ||||
| 80354 | } | ||||
| 80355 | |||||
| 80356 | void | ||||
| 80357 | TestJSImplInterface::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80358 | { | ||||
| 80359 | return mImpl->PassNullableUnionWithDefaultValue19(arg, aRv, aRealm); | ||||
| 80360 | } | ||||
| 80361 | |||||
| 80362 | void | ||||
| 80363 | TestJSImplInterface::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80364 | { | ||||
| 80365 | return mImpl->PassNullableUnionWithDefaultValue20(arg, aRv, aRealm); | ||||
| 80366 | } | ||||
| 80367 | |||||
| 80368 | void | ||||
| 80369 | TestJSImplInterface::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80370 | { | ||||
| 80371 | return mImpl->PassNullableUnionWithDefaultValue21(arg, aRv, aRealm); | ||||
| 80372 | } | ||||
| 80373 | |||||
| 80374 | void | ||||
| 80375 | TestJSImplInterface::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80376 | { | ||||
| 80377 | return mImpl->PassNullableUnionWithDefaultValue22(arg, aRv, aRealm); | ||||
| 80378 | } | ||||
| 80379 | |||||
| 80380 | void | ||||
| 80381 | TestJSImplInterface::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80382 | { | ||||
| 80383 | return mImpl->PassNullableUnionWithDefaultValue23(arg, aRv, aRealm); | ||||
| 80384 | } | ||||
| 80385 | |||||
| 80386 | void | ||||
| 80387 | TestJSImplInterface::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80388 | { | ||||
| 80389 | return mImpl->PassNullableUnionWithDefaultValue24(arg, aRv, aRealm); | ||||
| 80390 | } | ||||
| 80391 | |||||
| 80392 | void | ||||
| 80393 | TestJSImplInterface::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80394 | { | ||||
| 80395 | return mImpl->PassNullableUnionWithDefaultValue25(arg, aRv, aRealm); | ||||
| 80396 | } | ||||
| 80397 | |||||
| 80398 | void | ||||
| 80399 | TestJSImplInterface::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80400 | { | ||||
| 80401 | return mImpl->PassNullableUnionWithDefaultValue26(arg, aRv, aRealm); | ||||
| 80402 | } | ||||
| 80403 | |||||
| 80404 | void | ||||
| 80405 | TestJSImplInterface::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80406 | { | ||||
| 80407 | return mImpl->PassNullableUnionWithDefaultValue27(arg, aRv, aRealm); | ||||
| 80408 | } | ||||
| 80409 | |||||
| 80410 | void | ||||
| 80411 | TestJSImplInterface::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80412 | { | ||||
| 80413 | return mImpl->PassNullableUnionWithDefaultValue28(arg, aRv, aRealm); | ||||
| 80414 | } | ||||
| 80415 | |||||
| 80416 | void | ||||
| 80417 | TestJSImplInterface::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80418 | { | ||||
| 80419 | return mImpl->PassSequenceOfUnions(arg, aRv, aRealm); | ||||
| 80420 | } | ||||
| 80421 | |||||
| 80422 | void | ||||
| 80423 | TestJSImplInterface::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80424 | { | ||||
| 80425 | return mImpl->PassSequenceOfUnions2(arg, aRv, aRealm); | ||||
| 80426 | } | ||||
| 80427 | |||||
| 80428 | void | ||||
| 80429 | TestJSImplInterface::PassVariadicUnion(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80430 | { | ||||
| 80431 | return mImpl->PassVariadicUnion(arg, aRv, aRealm); | ||||
| 80432 | } | ||||
| 80433 | |||||
| 80434 | void | ||||
| 80435 | TestJSImplInterface::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80436 | { | ||||
| 80437 | return mImpl->PassSequenceOfNullableUnions(arg, aRv, aRealm); | ||||
| 80438 | } | ||||
| 80439 | |||||
| 80440 | void | ||||
| 80441 | TestJSImplInterface::PassVariadicNullableUnion(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80442 | { | ||||
| 80443 | return mImpl->PassVariadicNullableUnion(arg, aRv, aRealm); | ||||
| 80444 | } | ||||
| 80445 | |||||
| 80446 | void | ||||
| 80447 | TestJSImplInterface::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80448 | { | ||||
| 80449 | return mImpl->PassRecordOfUnions(arg, aRv, aRealm); | ||||
| 80450 | } | ||||
| 80451 | |||||
| 80452 | void | ||||
| 80453 | TestJSImplInterface::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80454 | { | ||||
| 80455 | return mImpl->ReceiveUnion(aRetVal, aRv, aRealm); | ||||
| 80456 | } | ||||
| 80457 | |||||
| 80458 | void | ||||
| 80459 | TestJSImplInterface::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80460 | { | ||||
| 80461 | return mImpl->ReceiveUnion2(aRetVal, aRv, aRealm); | ||||
| 80462 | } | ||||
| 80463 | |||||
| 80464 | void | ||||
| 80465 | TestJSImplInterface::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80466 | { | ||||
| 80467 | return mImpl->ReceiveUnionContainingNull(aRetVal, aRv, aRealm); | ||||
| 80468 | } | ||||
| 80469 | |||||
| 80470 | void | ||||
| 80471 | TestJSImplInterface::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80472 | { | ||||
| 80473 | return mImpl->ReceiveNullableUnion(aRetVal, aRv, aRealm); | ||||
| 80474 | } | ||||
| 80475 | |||||
| 80476 | void | ||||
| 80477 | TestJSImplInterface::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80478 | { | ||||
| 80479 | return mImpl->ReceiveNullableUnion2(aRetVal, aRv, aRealm); | ||||
| 80480 | } | ||||
| 80481 | |||||
| 80482 | void | ||||
| 80483 | TestJSImplInterface::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80484 | { | ||||
| 80485 | return mImpl->GetWritableUnion(aRetVal, aRv, aRealm); | ||||
| 80486 | } | ||||
| 80487 | |||||
| 80488 | void | ||||
| 80489 | TestJSImplInterface::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80490 | { | ||||
| 80491 | mImpl->SetWritableUnion(arg, aRv, aRealm); | ||||
| 80492 | } | ||||
| 80493 | |||||
| 80494 | void | ||||
| 80495 | TestJSImplInterface::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80496 | { | ||||
| 80497 | return mImpl->GetWritableUnionContainingNull(aRetVal, aRv, aRealm); | ||||
| 80498 | } | ||||
| 80499 | |||||
| 80500 | void | ||||
| 80501 | TestJSImplInterface::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80502 | { | ||||
| 80503 | mImpl->SetWritableUnionContainingNull(arg, aRv, aRealm); | ||||
| 80504 | } | ||||
| 80505 | |||||
| 80506 | void | ||||
| 80507 | TestJSImplInterface::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80508 | { | ||||
| 80509 | return mImpl->GetWritableNullableUnion(aRetVal, aRv, aRealm); | ||||
| 80510 | } | ||||
| 80511 | |||||
| 80512 | void | ||||
| 80513 | TestJSImplInterface::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80514 | { | ||||
| 80515 | mImpl->SetWritableNullableUnion(arg, aRv, aRealm); | ||||
| 80516 | } | ||||
| 80517 | |||||
| 80518 | void | ||||
| 80519 | TestJSImplInterface::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80520 | { | ||||
| 80521 | return mImpl->PassPromise(arg, aRv, aRealm); | ||||
| 80522 | } | ||||
| 80523 | |||||
| 80524 | void | ||||
| 80525 | TestJSImplInterface::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80526 | { | ||||
| 80527 | return mImpl->PassOptionalPromise(arg, aRv, aRealm); | ||||
| 80528 | } | ||||
| 80529 | |||||
| 80530 | void | ||||
| 80531 | TestJSImplInterface::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80532 | { | ||||
| 80533 | return mImpl->PassPromiseSequence(arg, aRv, aRealm); | ||||
| 80534 | } | ||||
| 80535 | |||||
| 80536 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 80537 | already_AddRefed<Promise> | ||||
| 80538 | TestJSImplInterface::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80539 | { | ||||
| 80540 | return mImpl->ReceivePromise(aRv, aRealm); | ||||
| 80541 | } | ||||
| 80542 | |||||
| 80543 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 80544 | already_AddRefed<Promise> | ||||
| 80545 | TestJSImplInterface::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80546 | { | ||||
| 80547 | return mImpl->ReceiveAddrefedPromise(aRv, aRealm); | ||||
| 80548 | } | ||||
| 80549 | |||||
| 80550 | void | ||||
| 80551 | TestJSImplInterface::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80552 | { | ||||
| 80553 | return mImpl->MethodRenamedTo(aRv, aRealm); | ||||
| 80554 | } | ||||
| 80555 | |||||
| 80556 | void | ||||
| 80557 | TestJSImplInterface::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80558 | { | ||||
| 80559 | return mImpl->MethodRenamedTo(argument, aRv, aRealm); | ||||
| 80560 | } | ||||
| 80561 | |||||
| 80562 | int8_t | ||||
| 80563 | TestJSImplInterface::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80564 | { | ||||
| 80565 | return mImpl->GetAttributeGetterRenamedTo(aRv, aRealm); | ||||
| 80566 | } | ||||
| 80567 | |||||
| 80568 | int8_t | ||||
| 80569 | TestJSImplInterface::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80570 | { | ||||
| 80571 | return mImpl->GetAttributeRenamedTo(aRv, aRealm); | ||||
| 80572 | } | ||||
| 80573 | |||||
| 80574 | void | ||||
| 80575 | TestJSImplInterface::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80576 | { | ||||
| 80577 | mImpl->SetAttributeRenamedTo(arg, aRv, aRealm); | ||||
| 80578 | } | ||||
| 80579 | |||||
| 80580 | void | ||||
| 80581 | TestJSImplInterface::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80582 | { | ||||
| 80583 | return mImpl->PassDictionary(x, aRv, aRealm); | ||||
| 80584 | } | ||||
| 80585 | |||||
| 80586 | void | ||||
| 80587 | TestJSImplInterface::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80588 | { | ||||
| 80589 | return mImpl->PassDictionary2(x, aRv, aRealm); | ||||
| 80590 | } | ||||
| 80591 | |||||
| 80592 | void | ||||
| 80593 | TestJSImplInterface::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80594 | { | ||||
| 80595 | return mImpl->ReceiveDictionary(aRetVal, aRv, aRealm); | ||||
| 80596 | } | ||||
| 80597 | |||||
| 80598 | void | ||||
| 80599 | TestJSImplInterface::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80600 | { | ||||
| 80601 | return mImpl->ReceiveNullableDictionary(aRetVal, aRv, aRealm); | ||||
| 80602 | } | ||||
| 80603 | |||||
| 80604 | void | ||||
| 80605 | TestJSImplInterface::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80606 | { | ||||
| 80607 | return mImpl->PassOtherDictionary(x, aRv, aRealm); | ||||
| 80608 | } | ||||
| 80609 | |||||
| 80610 | void | ||||
| 80611 | TestJSImplInterface::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80612 | { | ||||
| 80613 | return mImpl->PassSequenceOfDictionaries(x, aRv, aRealm); | ||||
| 80614 | } | ||||
| 80615 | |||||
| 80616 | void | ||||
| 80617 | TestJSImplInterface::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80618 | { | ||||
| 80619 | return mImpl->PassRecordOfDictionaries(x, aRv, aRealm); | ||||
| 80620 | } | ||||
| 80621 | |||||
| 80622 | void | ||||
| 80623 | TestJSImplInterface::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80624 | { | ||||
| 80625 | return mImpl->PassDictionaryOrLong(x, aRv, aRealm); | ||||
| 80626 | } | ||||
| 80627 | |||||
| 80628 | void | ||||
| 80629 | TestJSImplInterface::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80630 | { | ||||
| 80631 | return mImpl->PassDictionaryOrLong(x, aRv, aRealm); | ||||
| 80632 | } | ||||
| 80633 | |||||
| 80634 | void | ||||
| 80635 | TestJSImplInterface::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80636 | { | ||||
| 80637 | return mImpl->PassDictContainingDict(arg, aRv, aRealm); | ||||
| 80638 | } | ||||
| 80639 | |||||
| 80640 | void | ||||
| 80641 | TestJSImplInterface::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80642 | { | ||||
| 80643 | return mImpl->PassDictContainingSequence(arg, aRv, aRealm); | ||||
| 80644 | } | ||||
| 80645 | |||||
| 80646 | void | ||||
| 80647 | TestJSImplInterface::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80648 | { | ||||
| 80649 | return mImpl->ReceiveDictContainingSequence(aRetVal, aRv, aRealm); | ||||
| 80650 | } | ||||
| 80651 | |||||
| 80652 | void | ||||
| 80653 | TestJSImplInterface::PassVariadicDictionary(const Sequence<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80654 | { | ||||
| 80655 | return mImpl->PassVariadicDictionary(arg, aRv, aRealm); | ||||
| 80656 | } | ||||
| 80657 | |||||
| 80658 | void | ||||
| 80659 | TestJSImplInterface::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80660 | { | ||||
| 80661 | return mImpl->DontEnforceRangeOrClamp(arg, aRv, aRealm); | ||||
| 80662 | } | ||||
| 80663 | |||||
| 80664 | void | ||||
| 80665 | TestJSImplInterface::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80666 | { | ||||
| 80667 | return mImpl->DoEnforceRange(arg, aRv, aRealm); | ||||
| 80668 | } | ||||
| 80669 | |||||
| 80670 | void | ||||
| 80671 | TestJSImplInterface::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80672 | { | ||||
| 80673 | return mImpl->DoEnforceRangeNullable(arg, aRv, aRealm); | ||||
| 80674 | } | ||||
| 80675 | |||||
| 80676 | void | ||||
| 80677 | TestJSImplInterface::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80678 | { | ||||
| 80679 | return mImpl->DoClamp(arg, aRv, aRealm); | ||||
| 80680 | } | ||||
| 80681 | |||||
| 80682 | void | ||||
| 80683 | TestJSImplInterface::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80684 | { | ||||
| 80685 | return mImpl->DoClampNullable(arg, aRv, aRealm); | ||||
| 80686 | } | ||||
| 80687 | |||||
| 80688 | int8_t | ||||
| 80689 | TestJSImplInterface::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80690 | { | ||||
| 80691 | return mImpl->GetEnforcedByte(aRv, aRealm); | ||||
| 80692 | } | ||||
| 80693 | |||||
| 80694 | void | ||||
| 80695 | TestJSImplInterface::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80696 | { | ||||
| 80697 | mImpl->SetEnforcedByte(arg, aRv, aRealm); | ||||
| 80698 | } | ||||
| 80699 | |||||
| 80700 | Nullable<int8_t> | ||||
| 80701 | TestJSImplInterface::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80702 | { | ||||
| 80703 | return mImpl->GetEnforcedByteNullable(aRv, aRealm); | ||||
| 80704 | } | ||||
| 80705 | |||||
| 80706 | void | ||||
| 80707 | TestJSImplInterface::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80708 | { | ||||
| 80709 | mImpl->SetEnforcedByteNullable(arg, aRv, aRealm); | ||||
| 80710 | } | ||||
| 80711 | |||||
| 80712 | int8_t | ||||
| 80713 | TestJSImplInterface::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80714 | { | ||||
| 80715 | return mImpl->GetClampedByte(aRv, aRealm); | ||||
| 80716 | } | ||||
| 80717 | |||||
| 80718 | void | ||||
| 80719 | TestJSImplInterface::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80720 | { | ||||
| 80721 | mImpl->SetClampedByte(arg, aRv, aRealm); | ||||
| 80722 | } | ||||
| 80723 | |||||
| 80724 | Nullable<int8_t> | ||||
| 80725 | TestJSImplInterface::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80726 | { | ||||
| 80727 | return mImpl->GetClampedByteNullable(aRv, aRealm); | ||||
| 80728 | } | ||||
| 80729 | |||||
| 80730 | void | ||||
| 80731 | TestJSImplInterface::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80732 | { | ||||
| 80733 | mImpl->SetClampedByteNullable(arg, aRv, aRealm); | ||||
| 80734 | } | ||||
| 80735 | |||||
| 80736 | void | ||||
| 80737 | TestJSImplInterface::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80738 | { | ||||
| 80739 | return mImpl->ExerciseTypedefInterfaces1(arg, aRv, aRealm); | ||||
| 80740 | } | ||||
| 80741 | |||||
| 80742 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 80743 | already_AddRefed<TestJSImplInterface> | ||||
| 80744 | TestJSImplInterface::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80745 | { | ||||
| 80746 | return mImpl->ExerciseTypedefInterfaces2(arg, aRv, aRealm); | ||||
| 80747 | } | ||||
| 80748 | |||||
| 80749 | void | ||||
| 80750 | TestJSImplInterface::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80751 | { | ||||
| 80752 | return mImpl->ExerciseTypedefInterfaces3(arg, aRv, aRealm); | ||||
| 80753 | } | ||||
| 80754 | |||||
| 80755 | int8_t | ||||
| 80756 | TestJSImplInterface::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 80757 | { | ||||
| 80758 | return mImpl->GetDeprecatedAttribute(aRv, aRealm); | ||||
| 80759 | } | ||||
| 80760 | |||||
| 80761 | void | ||||
| 80762 | TestJSImplInterface::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80763 | { | ||||
| 80764 | mImpl->SetDeprecatedAttribute(arg, aRv, aRealm); | ||||
| 80765 | } | ||||
| 80766 | |||||
| 80767 | int8_t | ||||
| 80768 | TestJSImplInterface::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80769 | { | ||||
| 80770 | return mImpl->DeprecatedMethod(aRv, aRealm); | ||||
| 80771 | } | ||||
| 80772 | |||||
| 80773 | void | ||||
| 80774 | TestJSImplInterface::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80775 | { | ||||
| 80776 | return mImpl->DeprecatedMethodWithContext(arg, aRv, aRealm); | ||||
| 80777 | } | ||||
| 80778 | |||||
| 80779 | bool | ||||
| 80780 | TestJSImplInterface::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80781 | { | ||||
| 80782 | return mImpl->Overload1(arg, aRv, aRealm); | ||||
| 80783 | } | ||||
| 80784 | |||||
| 80785 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 80786 | already_AddRefed<TestJSImplInterface> | ||||
| 80787 | TestJSImplInterface::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80788 | { | ||||
| 80789 | return mImpl->Overload1(strs, arg, aRv, aRealm); | ||||
| 80790 | } | ||||
| 80791 | |||||
| 80792 | void | ||||
| 80793 | TestJSImplInterface::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80794 | { | ||||
| 80795 | return mImpl->Overload2(arg, aRv, aRealm); | ||||
| 80796 | } | ||||
| 80797 | |||||
| 80798 | void | ||||
| 80799 | TestJSImplInterface::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80800 | { | ||||
| 80801 | return mImpl->Overload2(arg, aRv, aRealm); | ||||
| 80802 | } | ||||
| 80803 | |||||
| 80804 | void | ||||
| 80805 | TestJSImplInterface::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80806 | { | ||||
| 80807 | return mImpl->Overload2(arg, aRv, aRealm); | ||||
| 80808 | } | ||||
| 80809 | |||||
| 80810 | void | ||||
| 80811 | TestJSImplInterface::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80812 | { | ||||
| 80813 | return mImpl->Overload2(arg, aRv, aRealm); | ||||
| 80814 | } | ||||
| 80815 | |||||
| 80816 | void | ||||
| 80817 | TestJSImplInterface::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80818 | { | ||||
| 80819 | return mImpl->Overload3(arg, aRv, aRealm); | ||||
| 80820 | } | ||||
| 80821 | |||||
| 80822 | void | ||||
| 80823 | TestJSImplInterface::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80824 | { | ||||
| 80825 | return mImpl->Overload3(arg, aRv, aRealm); | ||||
| 80826 | } | ||||
| 80827 | |||||
| 80828 | void | ||||
| 80829 | TestJSImplInterface::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80830 | { | ||||
| 80831 | return mImpl->Overload3(arg, aRv, aRealm); | ||||
| 80832 | } | ||||
| 80833 | |||||
| 80834 | void | ||||
| 80835 | TestJSImplInterface::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80836 | { | ||||
| 80837 | return mImpl->Overload4(arg, aRv, aRealm); | ||||
| 80838 | } | ||||
| 80839 | |||||
| 80840 | void | ||||
| 80841 | TestJSImplInterface::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80842 | { | ||||
| 80843 | return mImpl->Overload4(arg, aRv, aRealm); | ||||
| 80844 | } | ||||
| 80845 | |||||
| 80846 | void | ||||
| 80847 | TestJSImplInterface::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80848 | { | ||||
| 80849 | return mImpl->Overload4(arg, aRv, aRealm); | ||||
| 80850 | } | ||||
| 80851 | |||||
| 80852 | void | ||||
| 80853 | TestJSImplInterface::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80854 | { | ||||
| 80855 | return mImpl->Overload5(arg, aRv, aRealm); | ||||
| 80856 | } | ||||
| 80857 | |||||
| 80858 | void | ||||
| 80859 | TestJSImplInterface::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80860 | { | ||||
| 80861 | return mImpl->Overload5(arg, aRv, aRealm); | ||||
| 80862 | } | ||||
| 80863 | |||||
| 80864 | void | ||||
| 80865 | TestJSImplInterface::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80866 | { | ||||
| 80867 | return mImpl->Overload6(arg, aRv, aRealm); | ||||
| 80868 | } | ||||
| 80869 | |||||
| 80870 | void | ||||
| 80871 | TestJSImplInterface::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80872 | { | ||||
| 80873 | return mImpl->Overload6(arg, aRv, aRealm); | ||||
| 80874 | } | ||||
| 80875 | |||||
| 80876 | void | ||||
| 80877 | TestJSImplInterface::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80878 | { | ||||
| 80879 | return mImpl->Overload7(arg, aRv, aRealm); | ||||
| 80880 | } | ||||
| 80881 | |||||
| 80882 | void | ||||
| 80883 | TestJSImplInterface::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80884 | { | ||||
| 80885 | return mImpl->Overload7(arg, aRv, aRealm); | ||||
| 80886 | } | ||||
| 80887 | |||||
| 80888 | void | ||||
| 80889 | TestJSImplInterface::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80890 | { | ||||
| 80891 | return mImpl->Overload7(arg, aRv, aRealm); | ||||
| 80892 | } | ||||
| 80893 | |||||
| 80894 | void | ||||
| 80895 | TestJSImplInterface::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80896 | { | ||||
| 80897 | return mImpl->Overload8(arg, aRv, aRealm); | ||||
| 80898 | } | ||||
| 80899 | |||||
| 80900 | void | ||||
| 80901 | TestJSImplInterface::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80902 | { | ||||
| 80903 | return mImpl->Overload8(arg, aRv, aRealm); | ||||
| 80904 | } | ||||
| 80905 | |||||
| 80906 | void | ||||
| 80907 | TestJSImplInterface::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80908 | { | ||||
| 80909 | return mImpl->Overload9(arg, aRv, aRealm); | ||||
| 80910 | } | ||||
| 80911 | |||||
| 80912 | void | ||||
| 80913 | TestJSImplInterface::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80914 | { | ||||
| 80915 | return mImpl->Overload9(arg, aRv, aRealm); | ||||
| 80916 | } | ||||
| 80917 | |||||
| 80918 | void | ||||
| 80919 | TestJSImplInterface::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80920 | { | ||||
| 80921 | return mImpl->Overload10(arg, aRv, aRealm); | ||||
| 80922 | } | ||||
| 80923 | |||||
| 80924 | void | ||||
| 80925 | TestJSImplInterface::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80926 | { | ||||
| 80927 | return mImpl->Overload10(arg, aRv, aRealm); | ||||
| 80928 | } | ||||
| 80929 | |||||
| 80930 | void | ||||
| 80931 | TestJSImplInterface::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80932 | { | ||||
| 80933 | return mImpl->Overload11(arg, aRv, aRealm); | ||||
| 80934 | } | ||||
| 80935 | |||||
| 80936 | void | ||||
| 80937 | TestJSImplInterface::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80938 | { | ||||
| 80939 | return mImpl->Overload11(arg, aRv, aRealm); | ||||
| 80940 | } | ||||
| 80941 | |||||
| 80942 | void | ||||
| 80943 | TestJSImplInterface::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80944 | { | ||||
| 80945 | return mImpl->Overload12(arg, aRv, aRealm); | ||||
| 80946 | } | ||||
| 80947 | |||||
| 80948 | void | ||||
| 80949 | TestJSImplInterface::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80950 | { | ||||
| 80951 | return mImpl->Overload12(arg, aRv, aRealm); | ||||
| 80952 | } | ||||
| 80953 | |||||
| 80954 | void | ||||
| 80955 | TestJSImplInterface::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80956 | { | ||||
| 80957 | return mImpl->Overload13(arg, aRv, aRealm); | ||||
| 80958 | } | ||||
| 80959 | |||||
| 80960 | void | ||||
| 80961 | TestJSImplInterface::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80962 | { | ||||
| 80963 | return mImpl->Overload13(arg, aRv, aRealm); | ||||
| 80964 | } | ||||
| 80965 | |||||
| 80966 | void | ||||
| 80967 | TestJSImplInterface::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80968 | { | ||||
| 80969 | return mImpl->Overload14(arg, aRv, aRealm); | ||||
| 80970 | } | ||||
| 80971 | |||||
| 80972 | void | ||||
| 80973 | TestJSImplInterface::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80974 | { | ||||
| 80975 | return mImpl->Overload14(arg, aRv, aRealm); | ||||
| 80976 | } | ||||
| 80977 | |||||
| 80978 | void | ||||
| 80979 | TestJSImplInterface::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80980 | { | ||||
| 80981 | return mImpl->Overload15(arg, aRv, aRealm); | ||||
| 80982 | } | ||||
| 80983 | |||||
| 80984 | void | ||||
| 80985 | TestJSImplInterface::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80986 | { | ||||
| 80987 | return mImpl->Overload15(arg, aRv, aRealm); | ||||
| 80988 | } | ||||
| 80989 | |||||
| 80990 | void | ||||
| 80991 | TestJSImplInterface::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80992 | { | ||||
| 80993 | return mImpl->Overload16(arg, aRv, aRealm); | ||||
| 80994 | } | ||||
| 80995 | |||||
| 80996 | void | ||||
| 80997 | TestJSImplInterface::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 80998 | { | ||||
| 80999 | return mImpl->Overload16(arg, aRv, aRealm); | ||||
| 81000 | } | ||||
| 81001 | |||||
| 81002 | void | ||||
| 81003 | TestJSImplInterface::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81004 | { | ||||
| 81005 | return mImpl->Overload17(arg, aRv, aRealm); | ||||
| 81006 | } | ||||
| 81007 | |||||
| 81008 | void | ||||
| 81009 | TestJSImplInterface::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81010 | { | ||||
| 81011 | return mImpl->Overload17(arg, aRv, aRealm); | ||||
| 81012 | } | ||||
| 81013 | |||||
| 81014 | void | ||||
| 81015 | TestJSImplInterface::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81016 | { | ||||
| 81017 | return mImpl->Overload18(arg, aRv, aRealm); | ||||
| 81018 | } | ||||
| 81019 | |||||
| 81020 | void | ||||
| 81021 | TestJSImplInterface::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81022 | { | ||||
| 81023 | return mImpl->Overload18(arg, aRv, aRealm); | ||||
| 81024 | } | ||||
| 81025 | |||||
| 81026 | void | ||||
| 81027 | TestJSImplInterface::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81028 | { | ||||
| 81029 | return mImpl->Overload19(arg, aRv, aRealm); | ||||
| 81030 | } | ||||
| 81031 | |||||
| 81032 | void | ||||
| 81033 | TestJSImplInterface::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81034 | { | ||||
| 81035 | return mImpl->Overload19(arg, aRv, aRealm); | ||||
| 81036 | } | ||||
| 81037 | |||||
| 81038 | void | ||||
| 81039 | TestJSImplInterface::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81040 | { | ||||
| 81041 | return mImpl->Overload20(arg, aRv, aRealm); | ||||
| 81042 | } | ||||
| 81043 | |||||
| 81044 | void | ||||
| 81045 | TestJSImplInterface::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81046 | { | ||||
| 81047 | return mImpl->Overload20(arg, aRv, aRealm); | ||||
| 81048 | } | ||||
| 81049 | |||||
| 81050 | void | ||||
| 81051 | TestJSImplInterface::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const Sequence<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81052 | { | ||||
| 81053 | return mImpl->PassVariadicThirdArg(arg1, arg2, arg3, aRv, aRealm); | ||||
| 81054 | } | ||||
| 81055 | |||||
| 81056 | bool | ||||
| 81057 | TestJSImplInterface::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81058 | { | ||||
| 81059 | return mImpl->GetPrefable1(aRv, aRealm); | ||||
| 81060 | } | ||||
| 81061 | |||||
| 81062 | bool | ||||
| 81063 | TestJSImplInterface::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81064 | { | ||||
| 81065 | return mImpl->GetPrefable2(aRv, aRealm); | ||||
| 81066 | } | ||||
| 81067 | |||||
| 81068 | bool | ||||
| 81069 | TestJSImplInterface::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81070 | { | ||||
| 81071 | return mImpl->GetPrefable3(aRv, aRealm); | ||||
| 81072 | } | ||||
| 81073 | |||||
| 81074 | bool | ||||
| 81075 | TestJSImplInterface::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81076 | { | ||||
| 81077 | return mImpl->GetPrefable4(aRv, aRealm); | ||||
| 81078 | } | ||||
| 81079 | |||||
| 81080 | bool | ||||
| 81081 | TestJSImplInterface::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81082 | { | ||||
| 81083 | return mImpl->GetPrefable5(aRv, aRealm); | ||||
| 81084 | } | ||||
| 81085 | |||||
| 81086 | bool | ||||
| 81087 | TestJSImplInterface::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81088 | { | ||||
| 81089 | return mImpl->GetPrefable6(aRv, aRealm); | ||||
| 81090 | } | ||||
| 81091 | |||||
| 81092 | bool | ||||
| 81093 | TestJSImplInterface::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81094 | { | ||||
| 81095 | return mImpl->GetPrefable7(aRv, aRealm); | ||||
| 81096 | } | ||||
| 81097 | |||||
| 81098 | bool | ||||
| 81099 | TestJSImplInterface::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81100 | { | ||||
| 81101 | return mImpl->GetPrefable8(aRv, aRealm); | ||||
| 81102 | } | ||||
| 81103 | |||||
| 81104 | bool | ||||
| 81105 | TestJSImplInterface::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81106 | { | ||||
| 81107 | return mImpl->GetPrefable9(aRv, aRealm); | ||||
| 81108 | } | ||||
| 81109 | |||||
| 81110 | void | ||||
| 81111 | TestJSImplInterface::Prefable10(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81112 | { | ||||
| 81113 | return mImpl->Prefable10(aRv, aRealm); | ||||
| 81114 | } | ||||
| 81115 | |||||
| 81116 | void | ||||
| 81117 | TestJSImplInterface::Prefable11(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81118 | { | ||||
| 81119 | return mImpl->Prefable11(aRv, aRealm); | ||||
| 81120 | } | ||||
| 81121 | |||||
| 81122 | bool | ||||
| 81123 | TestJSImplInterface::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81124 | { | ||||
| 81125 | return mImpl->GetPrefable12(aRv, aRealm); | ||||
| 81126 | } | ||||
| 81127 | |||||
| 81128 | void | ||||
| 81129 | TestJSImplInterface::Prefable13(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81130 | { | ||||
| 81131 | return mImpl->Prefable13(aRv, aRealm); | ||||
| 81132 | } | ||||
| 81133 | |||||
| 81134 | bool | ||||
| 81135 | TestJSImplInterface::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81136 | { | ||||
| 81137 | return mImpl->GetPrefable14(aRv, aRealm); | ||||
| 81138 | } | ||||
| 81139 | |||||
| 81140 | bool | ||||
| 81141 | TestJSImplInterface::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81142 | { | ||||
| 81143 | return mImpl->GetPrefable15(aRv, aRealm); | ||||
| 81144 | } | ||||
| 81145 | |||||
| 81146 | bool | ||||
| 81147 | TestJSImplInterface::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81148 | { | ||||
| 81149 | return mImpl->GetPrefable16(aRv, aRealm); | ||||
| 81150 | } | ||||
| 81151 | |||||
| 81152 | void | ||||
| 81153 | TestJSImplInterface::Prefable17(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81154 | { | ||||
| 81155 | return mImpl->Prefable17(aRv, aRealm); | ||||
| 81156 | } | ||||
| 81157 | |||||
| 81158 | void | ||||
| 81159 | TestJSImplInterface::Prefable18(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81160 | { | ||||
| 81161 | return mImpl->Prefable18(aRv, aRealm); | ||||
| 81162 | } | ||||
| 81163 | |||||
| 81164 | void | ||||
| 81165 | TestJSImplInterface::Prefable19(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81166 | { | ||||
| 81167 | return mImpl->Prefable19(aRv, aRealm); | ||||
| 81168 | } | ||||
| 81169 | |||||
| 81170 | void | ||||
| 81171 | TestJSImplInterface::Prefable20(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81172 | { | ||||
| 81173 | return mImpl->Prefable20(aRv, aRealm); | ||||
| 81174 | } | ||||
| 81175 | |||||
| 81176 | bool | ||||
| 81177 | TestJSImplInterface::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81178 | { | ||||
| 81179 | return mImpl->GetConditionalOnSecureContext1(aRv, aRealm); | ||||
| 81180 | } | ||||
| 81181 | |||||
| 81182 | bool | ||||
| 81183 | TestJSImplInterface::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81184 | { | ||||
| 81185 | return mImpl->GetConditionalOnSecureContext2(aRv, aRealm); | ||||
| 81186 | } | ||||
| 81187 | |||||
| 81188 | bool | ||||
| 81189 | TestJSImplInterface::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81190 | { | ||||
| 81191 | return mImpl->GetConditionalOnSecureContext3(aRv, aRealm); | ||||
| 81192 | } | ||||
| 81193 | |||||
| 81194 | bool | ||||
| 81195 | TestJSImplInterface::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81196 | { | ||||
| 81197 | return mImpl->GetConditionalOnSecureContext4(aRv, aRealm); | ||||
| 81198 | } | ||||
| 81199 | |||||
| 81200 | void | ||||
| 81201 | TestJSImplInterface::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81202 | { | ||||
| 81203 | return mImpl->ConditionalOnSecureContext5(aRv, aRealm); | ||||
| 81204 | } | ||||
| 81205 | |||||
| 81206 | void | ||||
| 81207 | TestJSImplInterface::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81208 | { | ||||
| 81209 | return mImpl->ConditionalOnSecureContext6(aRv, aRealm); | ||||
| 81210 | } | ||||
| 81211 | |||||
| 81212 | void | ||||
| 81213 | TestJSImplInterface::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81214 | { | ||||
| 81215 | return mImpl->ConditionalOnSecureContext7(aRv, aRealm); | ||||
| 81216 | } | ||||
| 81217 | |||||
| 81218 | void | ||||
| 81219 | TestJSImplInterface::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81220 | { | ||||
| 81221 | return mImpl->ConditionalOnSecureContext8(aRv, aRealm); | ||||
| 81222 | } | ||||
| 81223 | |||||
| 81224 | int32_t | ||||
| 81225 | TestJSImplInterface::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81226 | { | ||||
| 81227 | return mImpl->GetAttrWithLenientThis(aRv, aRealm); | ||||
| 81228 | } | ||||
| 81229 | |||||
| 81230 | void | ||||
| 81231 | TestJSImplInterface::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81232 | { | ||||
| 81233 | mImpl->SetAttrWithLenientThis(arg, aRv, aRealm); | ||||
| 81234 | } | ||||
| 81235 | |||||
| 81236 | void | ||||
| 81237 | TestJSImplInterface::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81238 | { | ||||
| 81239 | return mImpl->PassRenamedInterface(arg, aRv, aRealm); | ||||
| 81240 | } | ||||
| 81241 | |||||
| 81242 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 81243 | already_AddRefed<TestJSImplInterface> | ||||
| 81244 | TestJSImplInterface::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81245 | { | ||||
| 81246 | return mImpl->GetPutForwardsAttr(aRv, aRealm); | ||||
| 81247 | } | ||||
| 81248 | |||||
| 81249 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 81250 | already_AddRefed<TestJSImplInterface> | ||||
| 81251 | TestJSImplInterface::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81252 | { | ||||
| 81253 | return mImpl->GetPutForwardsAttr2(aRv, aRealm); | ||||
| 81254 | } | ||||
| 81255 | |||||
| 81256 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 81257 | already_AddRefed<TestJSImplInterface> | ||||
| 81258 | TestJSImplInterface::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81259 | { | ||||
| 81260 | return mImpl->GetPutForwardsAttr3(aRv, aRealm); | ||||
| 81261 | } | ||||
| 81262 | |||||
| 81263 | void | ||||
| 81264 | TestJSImplInterface::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81265 | { | ||||
| 81266 | return mImpl->ThrowingMethod(aRv, aRealm); | ||||
| 81267 | } | ||||
| 81268 | |||||
| 81269 | bool | ||||
| 81270 | TestJSImplInterface::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81271 | { | ||||
| 81272 | return mImpl->GetThrowingAttr(aRv, aRealm); | ||||
| 81273 | } | ||||
| 81274 | |||||
| 81275 | void | ||||
| 81276 | TestJSImplInterface::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81277 | { | ||||
| 81278 | mImpl->SetThrowingAttr(arg, aRv, aRealm); | ||||
| 81279 | } | ||||
| 81280 | |||||
| 81281 | bool | ||||
| 81282 | TestJSImplInterface::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81283 | { | ||||
| 81284 | return mImpl->GetThrowingGetterAttr(aRv, aRealm); | ||||
| 81285 | } | ||||
| 81286 | |||||
| 81287 | void | ||||
| 81288 | TestJSImplInterface::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81289 | { | ||||
| 81290 | mImpl->SetThrowingGetterAttr(arg, aRv, aRealm); | ||||
| 81291 | } | ||||
| 81292 | |||||
| 81293 | bool | ||||
| 81294 | TestJSImplInterface::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81295 | { | ||||
| 81296 | return mImpl->GetThrowingSetterAttr(aRv, aRealm); | ||||
| 81297 | } | ||||
| 81298 | |||||
| 81299 | void | ||||
| 81300 | TestJSImplInterface::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81301 | { | ||||
| 81302 | mImpl->SetThrowingSetterAttr(arg, aRv, aRealm); | ||||
| 81303 | } | ||||
| 81304 | |||||
| 81305 | void | ||||
| 81306 | TestJSImplInterface::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81307 | { | ||||
| 81308 | return mImpl->CanOOMMethod(aRv, aRealm); | ||||
| 81309 | } | ||||
| 81310 | |||||
| 81311 | bool | ||||
| 81312 | TestJSImplInterface::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81313 | { | ||||
| 81314 | return mImpl->GetCanOOMAttr(aRv, aRealm); | ||||
| 81315 | } | ||||
| 81316 | |||||
| 81317 | void | ||||
| 81318 | TestJSImplInterface::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81319 | { | ||||
| 81320 | mImpl->SetCanOOMAttr(arg, aRv, aRealm); | ||||
| 81321 | } | ||||
| 81322 | |||||
| 81323 | bool | ||||
| 81324 | TestJSImplInterface::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81325 | { | ||||
| 81326 | return mImpl->GetCanOOMGetterAttr(aRv, aRealm); | ||||
| 81327 | } | ||||
| 81328 | |||||
| 81329 | void | ||||
| 81330 | TestJSImplInterface::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81331 | { | ||||
| 81332 | mImpl->SetCanOOMGetterAttr(arg, aRv, aRealm); | ||||
| 81333 | } | ||||
| 81334 | |||||
| 81335 | bool | ||||
| 81336 | TestJSImplInterface::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81337 | { | ||||
| 81338 | return mImpl->GetCanOOMSetterAttr(aRv, aRealm); | ||||
| 81339 | } | ||||
| 81340 | |||||
| 81341 | void | ||||
| 81342 | TestJSImplInterface::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81343 | { | ||||
| 81344 | mImpl->SetCanOOMSetterAttr(arg, aRv, aRealm); | ||||
| 81345 | } | ||||
| 81346 | |||||
| 81347 | void | ||||
| 81348 | TestJSImplInterface::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81349 | { | ||||
| 81350 | return mImpl->CeReactionsMethod(aRv, aRealm); | ||||
| 81351 | } | ||||
| 81352 | |||||
| 81353 | void | ||||
| 81354 | TestJSImplInterface::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81355 | { | ||||
| 81356 | return mImpl->CeReactionsMethodOverload(aRv, aRealm); | ||||
| 81357 | } | ||||
| 81358 | |||||
| 81359 | void | ||||
| 81360 | TestJSImplInterface::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81361 | { | ||||
| 81362 | return mImpl->CeReactionsMethodOverload(bar, aRv, aRealm); | ||||
| 81363 | } | ||||
| 81364 | |||||
| 81365 | bool | ||||
| 81366 | TestJSImplInterface::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81367 | { | ||||
| 81368 | return mImpl->GetCeReactionsAttr(aRv, aRealm); | ||||
| 81369 | } | ||||
| 81370 | |||||
| 81371 | void | ||||
| 81372 | TestJSImplInterface::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81373 | { | ||||
| 81374 | mImpl->SetCeReactionsAttr(arg, aRv, aRealm); | ||||
| 81375 | } | ||||
| 81376 | |||||
| 81377 | void | ||||
| 81378 | TestJSImplInterface::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81379 | { | ||||
| 81380 | return mImpl->PassArgsWithDefaults(arg1, arg2, arg3, arg4, arg5, aRv, aRealm); | ||||
| 81381 | } | ||||
| 81382 | |||||
| 81383 | void | ||||
| 81384 | TestJSImplInterface::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81385 | { | ||||
| 81386 | return mImpl->GetToJSONShouldSkipThis(aRetVal, aRv, aRealm); | ||||
| 81387 | } | ||||
| 81388 | |||||
| 81389 | void | ||||
| 81390 | TestJSImplInterface::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81391 | { | ||||
| 81392 | mImpl->SetToJSONShouldSkipThis(arg, aRv, aRealm); | ||||
| 81393 | } | ||||
| 81394 | |||||
| 81395 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 81396 | already_AddRefed<TestParentInterface> | ||||
| 81397 | TestJSImplInterface::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81398 | { | ||||
| 81399 | return mImpl->GetToJSONShouldSkipThis2(aRv, aRealm); | ||||
| 81400 | } | ||||
| 81401 | |||||
| 81402 | void | ||||
| 81403 | TestJSImplInterface::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81404 | { | ||||
| 81405 | mImpl->SetToJSONShouldSkipThis2(arg, aRv, aRealm); | ||||
| 81406 | } | ||||
| 81407 | |||||
| 81408 | // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee). | ||||
| 81409 | already_AddRefed<TestCallbackInterface> | ||||
| 81410 | TestJSImplInterface::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81411 | { | ||||
| 81412 | return mImpl->GetToJSONShouldSkipThis3(aRv, aRealm); | ||||
| 81413 | } | ||||
| 81414 | |||||
| 81415 | void | ||||
| 81416 | TestJSImplInterface::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81417 | { | ||||
| 81418 | mImpl->SetToJSONShouldSkipThis3(arg, aRv, aRealm); | ||||
| 81419 | } | ||||
| 81420 | |||||
| 81421 | void | ||||
| 81422 | TestJSImplInterface::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81423 | { | ||||
| 81424 | return mImpl->ToJSON(aRetVal, aRv, aRealm); | ||||
| 81425 | } | ||||
| 81426 | |||||
| 81427 | int8_t | ||||
| 81428 | TestJSImplInterface::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81429 | { | ||||
| 81430 | return mImpl->GetDashed_attribute(aRv, aRealm); | ||||
| 81431 | } | ||||
| 81432 | |||||
| 81433 | void | ||||
| 81434 | TestJSImplInterface::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81435 | { | ||||
| 81436 | mImpl->SetDashed_attribute(arg, aRv, aRealm); | ||||
| 81437 | } | ||||
| 81438 | |||||
| 81439 | void | ||||
| 81440 | TestJSImplInterface::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81441 | { | ||||
| 81442 | return mImpl->Dashed_method(aRv, aRealm); | ||||
| 81443 | } | ||||
| 81444 | |||||
| 81445 | bool | ||||
| 81446 | TestJSImplInterface::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81447 | { | ||||
| 81448 | return mImpl->GetNonEnumerableAttr(aRv, aRealm); | ||||
| 81449 | } | ||||
| 81450 | |||||
| 81451 | void | ||||
| 81452 | TestJSImplInterface::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81453 | { | ||||
| 81454 | mImpl->SetNonEnumerableAttr(arg, aRv, aRealm); | ||||
| 81455 | } | ||||
| 81456 | |||||
| 81457 | void | ||||
| 81458 | TestJSImplInterface::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81459 | { | ||||
| 81460 | return mImpl->NonEnumerableMethod(aRv, aRealm); | ||||
| 81461 | } | ||||
| 81462 | |||||
| 81463 | void | ||||
| 81464 | TestJSImplInterface::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81465 | { | ||||
| 81466 | return mImpl->GetAllowSharedArrayBufferViewTypedef(aRetVal, aRv, aRealm); | ||||
| 81467 | } | ||||
| 81468 | |||||
| 81469 | void | ||||
| 81470 | TestJSImplInterface::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81471 | { | ||||
| 81472 | mImpl->SetAllowSharedArrayBufferViewTypedef(arg, aRv, aRealm); | ||||
| 81473 | } | ||||
| 81474 | |||||
| 81475 | void | ||||
| 81476 | TestJSImplInterface::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81477 | { | ||||
| 81478 | return mImpl->GetAllowSharedArrayBufferView(aRetVal, aRv, aRealm); | ||||
| 81479 | } | ||||
| 81480 | |||||
| 81481 | void | ||||
| 81482 | TestJSImplInterface::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81483 | { | ||||
| 81484 | mImpl->SetAllowSharedArrayBufferView(arg, aRv, aRealm); | ||||
| 81485 | } | ||||
| 81486 | |||||
| 81487 | void | ||||
| 81488 | TestJSImplInterface::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81489 | { | ||||
| 81490 | return mImpl->GetAllowSharedNullableArrayBufferView(aRetVal, aRv, aRealm); | ||||
| 81491 | } | ||||
| 81492 | |||||
| 81493 | void | ||||
| 81494 | TestJSImplInterface::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81495 | { | ||||
| 81496 | mImpl->SetAllowSharedNullableArrayBufferView(arg, aRv, aRealm); | ||||
| 81497 | } | ||||
| 81498 | |||||
| 81499 | void | ||||
| 81500 | TestJSImplInterface::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81501 | { | ||||
| 81502 | return mImpl->GetAllowSharedArrayBuffer(aRetVal, aRv, aRealm); | ||||
| 81503 | } | ||||
| 81504 | |||||
| 81505 | void | ||||
| 81506 | TestJSImplInterface::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81507 | { | ||||
| 81508 | mImpl->SetAllowSharedArrayBuffer(arg, aRv, aRealm); | ||||
| 81509 | } | ||||
| 81510 | |||||
| 81511 | void | ||||
| 81512 | TestJSImplInterface::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const | ||||
| 81513 | { | ||||
| 81514 | return mImpl->GetAllowSharedNullableArrayBuffer(aRetVal, aRv, aRealm); | ||||
| 81515 | } | ||||
| 81516 | |||||
| 81517 | void | ||||
| 81518 | TestJSImplInterface::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81519 | { | ||||
| 81520 | mImpl->SetAllowSharedNullableArrayBuffer(arg, aRv, aRealm); | ||||
| 81521 | } | ||||
| 81522 | |||||
| 81523 | void | ||||
| 81524 | TestJSImplInterface::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81525 | { | ||||
| 81526 | return mImpl->PassAllowSharedArrayBufferViewTypedef(foo, aRv, aRealm); | ||||
| 81527 | } | ||||
| 81528 | |||||
| 81529 | void | ||||
| 81530 | TestJSImplInterface::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81531 | { | ||||
| 81532 | return mImpl->PassAllowSharedArrayBufferView(foo, aRv, aRealm); | ||||
| 81533 | } | ||||
| 81534 | |||||
| 81535 | void | ||||
| 81536 | TestJSImplInterface::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81537 | { | ||||
| 81538 | return mImpl->PassAllowSharedNullableArrayBufferView(foo, aRv, aRealm); | ||||
| 81539 | } | ||||
| 81540 | |||||
| 81541 | void | ||||
| 81542 | TestJSImplInterface::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81543 | { | ||||
| 81544 | return mImpl->PassAllowSharedArrayBuffer(foo, aRv, aRealm); | ||||
| 81545 | } | ||||
| 81546 | |||||
| 81547 | void | ||||
| 81548 | TestJSImplInterface::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81549 | { | ||||
| 81550 | return mImpl->PassAllowSharedNullableArrayBuffer(foo, aRv, aRealm); | ||||
| 81551 | } | ||||
| 81552 | |||||
| 81553 | void | ||||
| 81554 | TestJSImplInterface::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81555 | { | ||||
| 81556 | return mImpl->PassUnionArrayBuffer(foo, aRv, aRealm); | ||||
| 81557 | } | ||||
| 81558 | |||||
| 81559 | void | ||||
| 81560 | TestJSImplInterface::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm) | ||||
| 81561 | { | ||||
| 81562 | return mImpl->PassUnionAllowSharedArrayBuffer(foo, aRv, aRealm); | ||||
| 81563 | } | ||||
| 81564 | |||||
| 81565 | bool | ||||
| 81566 | TestJSImplInterface::_Create(JSContext* cx, unsigned argc, JS::Value* vp) | ||||
| 81567 | { | ||||
| 81568 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | ||||
| 81569 | if (!args.requireAtLeast(cx, "TestJSImplInterface._create", 2)) { | ||||
| 81570 | return false; | ||||
| 81571 | } | ||||
| 81572 | BindingCallContext callCx(cx, "TestJSImplInterface._create"); | ||||
| 81573 | if (!args[0].isObject()) { | ||||
| 81574 | return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 81575 | } | ||||
| 81576 | if (!args[1].isObject()) { | ||||
| 81577 | return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2"); | ||||
| 81578 | } | ||||
| 81579 | |||||
| 81580 | // GlobalObject will go through wrappers as needed for us, and | ||||
| 81581 | // is simpler than the right UnwrapArg incantation. | ||||
| 81582 | GlobalObject global(cx, &args[0].toObject()); | ||||
| 81583 | if (global.Failed()) { | ||||
| 81584 | return false; | ||||
| 81585 | } | ||||
| 81586 | nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports()); | ||||
| 81587 | 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" , 81587); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder" ")"); do { *((volatile int*)__null) = 81587; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 81588 | JS::Rooted<JSObject*> arg(cx, &args[1].toObject()); | ||||
| 81589 | JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 81590 | RefPtr<TestJSImplInterface> impl = new TestJSImplInterface(arg, argGlobal, globalHolder); | ||||
| 81591 | 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", 81591); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)" ")"); do { *((volatile int*)__null) = 81591; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 81592 | return GetOrCreateDOMReflector(cx, impl, args.rval()); | ||||
| 81593 | } | ||||
| 81594 | |||||
| 81595 | |||||
| 81596 | NS_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); } | ||||
| 81597 | NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplNoInterfaceObject)void TestJSImplNoInterfaceObject::cycleCollection::Unlink(void * p) { TestJSImplNoInterfaceObject* tmp = DowncastCCParticipant <TestJSImplNoInterfaceObject>(p); | ||||
| 81598 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl); | ||||
| 81599 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent); | ||||
| 81600 | NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p); | ||||
| 81601 | tmp->ClearWeakReferences(); | ||||
| 81602 | NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; } | ||||
| 81603 | NS_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" ); | ||||
| 81604 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0); | ||||
| 81605 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0 ); | ||||
| 81606 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; } | ||||
| 81607 | NS_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", 81607 ); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0" ") (" "illegal refcnt" ")"); do { *((volatile int*)__null) = 81607; __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; } | ||||
| 81608 | NS_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", 81608 ); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0" ") (" "dup release" ")"); do { *((volatile int*)__null) = 81608 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); _mOwningThread.AssertOwnership("TestJSImplNoInterfaceObject" " not thread-safe"); nsISupports* base = TestJSImplNoInterfaceObject ::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr (base); NS_LogRelease((this), (count), ("TestJSImplNoInterfaceObject" )); return count; } void TestJSImplNoInterfaceObject::DeleteCycleCollectable (void) { delete (this); } | ||||
| 81609 | NS_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", 81609); MOZ_PretendNoReturn (); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals ( aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant , void>::kIID), (nsCycleCollectionISupports::COMTypeInfo< nsCycleCollectionISupports, void>::kIID)) && (LowWordEquals (aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant , void>::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports ::COMTypeInfo<nsCycleCollectionISupports, void>::kIID)) )) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant ::COMTypeInfo<nsXPCOMCycleCollectionParticipant, void>:: kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject::cycleCollection ::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, ( nsCycleCollectionISupports::COMTypeInfo<nsCycleCollectionISupports , void>::kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject ::cycleCollection::Upcast(this); return NS_OK; } foundInterface = nullptr; } else | ||||
| 81610 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::COMTypeInfo<nsWrapperCache , void>::kIID))) { *aInstancePtr = static_cast<nsWrapperCache *>(this); return NS_OK; } else | ||||
| 81611 | NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t <decltype(*this)>, nsISupports>)) foundInterface = static_cast <nsISupports*>(this); else | ||||
| 81612 | NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t <decltype(*this)>, nsISupportsWeakReference>)) foundInterface = static_cast<nsISupportsWeakReference*>(this); else | ||||
| 81613 | NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aIID.Equals((nsISupports::COMTypeInfo<nsISupports , void>::kIID)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::COMTypeInfo <nsISupports, void>::kIID))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))" , "../TestJSImplGenBinding.cpp", 81613); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))" ")"); do { *((volatile int*)__null) = 81613; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); status = NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status = NS_OK; } *aInstancePtr = foundInterface; return status; } | ||||
| 81614 | |||||
| 81615 | TestJSImplNoInterfaceObject::TestJSImplNoInterfaceObject(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent) | ||||
| 81616 | : mImpl(new TestJSImplNoInterfaceObjectJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)), | ||||
| 81617 | mParent(aParent) | ||||
| 81618 | { | ||||
| 81619 | } | ||||
| 81620 | |||||
| 81621 | |||||
| 81622 | TestJSImplNoInterfaceObject::~TestJSImplNoInterfaceObject() | ||||
| 81623 | { | ||||
| 81624 | } | ||||
| 81625 | |||||
| 81626 | nsISupports* | ||||
| 81627 | TestJSImplNoInterfaceObject::GetParentObject() const | ||||
| 81628 | { | ||||
| 81629 | return mParent; | ||||
| 81630 | } | ||||
| 81631 | |||||
| 81632 | JSObject* | ||||
| 81633 | TestJSImplNoInterfaceObject::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) | ||||
| 81634 | { | ||||
| 81635 | JS::Rooted<JSObject*> obj(aCx, TestJSImplNoInterfaceObject_Binding::Wrap(aCx, this, aGivenProto)); | ||||
| 81636 | if (!obj) { | ||||
| 81637 | return nullptr; | ||||
| 81638 | } | ||||
| 81639 | |||||
| 81640 | // Now define it on our chrome object | ||||
| 81641 | JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull()); | ||||
| 81642 | if (!JS_WrapObject(aCx, &obj)) { | ||||
| 81643 | return nullptr; | ||||
| 81644 | } | ||||
| 81645 | JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull()); | ||||
| 81646 | if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) { | ||||
| 81647 | return nullptr; | ||||
| 81648 | } | ||||
| 81649 | return obj; | ||||
| 81650 | } | ||||
| 81651 | |||||
| 81652 | bool | ||||
| 81653 | TestJSImplNoInterfaceObject::_Create(JSContext* cx, unsigned argc, JS::Value* vp) | ||||
| 81654 | { | ||||
| 81655 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | ||||
| 81656 | if (!args.requireAtLeast(cx, "TestJSImplNoInterfaceObject._create", 2)) { | ||||
| 81657 | return false; | ||||
| 81658 | } | ||||
| 81659 | BindingCallContext callCx(cx, "TestJSImplNoInterfaceObject._create"); | ||||
| 81660 | if (!args[0].isObject()) { | ||||
| 81661 | return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | ||||
| 81662 | } | ||||
| 81663 | if (!args[1].isObject()) { | ||||
| 81664 | return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2"); | ||||
| 81665 | } | ||||
| 81666 | |||||
| 81667 | // GlobalObject will go through wrappers as needed for us, and | ||||
| 81668 | // is simpler than the right UnwrapArg incantation. | ||||
| 81669 | GlobalObject global(cx, &args[0].toObject()); | ||||
| 81670 | if (global.Failed()) { | ||||
| 81671 | return false; | ||||
| 81672 | } | ||||
| 81673 | nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports()); | ||||
| 81674 | 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" , 81674); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder" ")"); do { *((volatile int*)__null) = 81674; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 81675 | JS::Rooted<JSObject*> arg(cx, &args[1].toObject()); | ||||
| 81676 | JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx)); | ||||
| 81677 | RefPtr<TestJSImplNoInterfaceObject> impl = new TestJSImplNoInterfaceObject(arg, argGlobal, globalHolder); | ||||
| 81678 | 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", 81678); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)" ")"); do { *((volatile int*)__null) = 81678; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | ||||
| 81679 | return GetOrCreateDOMReflector(cx, impl, args.rval()); | ||||
| 81680 | } | ||||
| 81681 | |||||
| 81682 | |||||
| 81683 | } // namespace dom | ||||
| 81684 | |||||
| 81685 | |||||
| 81686 | } // namespace mozilla |
| 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 | ||||
| 24 | namespace mozilla::dom { | |||
| 25 | ||||
| 26 | template <typename T> | |||
| 27 | struct TypeName {}; | |||
| 28 | ||||
| 29 | template <> | |||
| 30 | struct TypeName<int8_t> { | |||
| 31 | static const char* value() { return "byte"; } | |||
| 32 | }; | |||
| 33 | template <> | |||
| 34 | struct TypeName<uint8_t> { | |||
| 35 | static const char* value() { return "octet"; } | |||
| 36 | }; | |||
| 37 | template <> | |||
| 38 | struct TypeName<int16_t> { | |||
| 39 | static const char* value() { return "short"; } | |||
| 40 | }; | |||
| 41 | template <> | |||
| 42 | struct TypeName<uint16_t> { | |||
| 43 | static const char* value() { return "unsigned short"; } | |||
| 44 | }; | |||
| 45 | template <> | |||
| 46 | struct TypeName<int32_t> { | |||
| 47 | static const char* value() { return "long"; } | |||
| 48 | }; | |||
| 49 | template <> | |||
| 50 | struct TypeName<uint32_t> { | |||
| 51 | static const char* value() { return "unsigned long"; } | |||
| 52 | }; | |||
| 53 | template <> | |||
| 54 | struct TypeName<int64_t> { | |||
| 55 | static const char* value() { return "long long"; } | |||
| 56 | }; | |||
| 57 | template <> | |||
| 58 | struct TypeName<uint64_t> { | |||
| 59 | static const char* value() { return "unsigned long long"; } | |||
| 60 | }; | |||
| 61 | ||||
| 62 | enum ConversionBehavior { eDefault, eEnforceRange, eClamp }; | |||
| 63 | ||||
| 64 | template <typename T, ConversionBehavior B> | |||
| 65 | struct PrimitiveConversionTraits {}; | |||
| 66 | ||||
| 67 | template <typename T> | |||
| 68 | struct DisallowedConversion { | |||
| 69 | typedef int jstype; | |||
| 70 | typedef int intermediateType; | |||
| 71 | ||||
| 72 | private: | |||
| 73 | static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v, | |||
| 74 | const char* sourceDescription, jstype* retval) { | |||
| 75 | MOZ_CRASH("This should never be instantiated!")do { do { } while (false); MOZ_ReportCrash("" "This should never be instantiated!" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h" , 75); AnnotateMozCrashReason("MOZ_CRASH(" "This should never be instantiated!" ")"); do { *((volatile int*)__null) = 75; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | |||
| 76 | } | |||
| 77 | }; | |||
| 78 | ||||
| 79 | struct 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 | }; | |||
| 115 | template <> | |||
| 116 | struct PrimitiveConversionTraits<int8_t, eDefault> | |||
| 117 | : PrimitiveConversionTraits_smallInt { | |||
| 118 | typedef uint8_t intermediateType; | |||
| 119 | }; | |||
| 120 | template <> | |||
| 121 | struct PrimitiveConversionTraits<uint8_t, eDefault> | |||
| 122 | : PrimitiveConversionTraits_smallInt {}; | |||
| 123 | template <> | |||
| 124 | struct PrimitiveConversionTraits<int16_t, eDefault> | |||
| 125 | : PrimitiveConversionTraits_smallInt { | |||
| 126 | typedef uint16_t intermediateType; | |||
| 127 | }; | |||
| 128 | template <> | |||
| 129 | struct PrimitiveConversionTraits<uint16_t, eDefault> | |||
| 130 | : PrimitiveConversionTraits_smallInt {}; | |||
| 131 | template <> | |||
| 132 | struct PrimitiveConversionTraits<int32_t, eDefault> | |||
| 133 | : PrimitiveConversionTraits_smallInt {}; | |||
| 134 | template <> | |||
| 135 | struct PrimitiveConversionTraits<uint32_t, eDefault> | |||
| 136 | : PrimitiveConversionTraits_smallInt {}; | |||
| 137 | ||||
| 138 | template <> | |||
| 139 | struct 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 | ||||
| 148 | template <> | |||
| 149 | struct 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 | ||||
| 158 | template <typename T> | |||
| 159 | struct 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 | ||||
| 164 | template <> | |||
| 165 | struct 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 | ||||
| 170 | template <> | |||
| 171 | struct PrimitiveConversionTraits_Limits<uint64_t> { | |||
| 172 | static inline uint64_t min() { return 0; } | |||
| 173 | static inline uint64_t max() { return (1LL << 53) - 1; } | |||
| 174 | }; | |||
| 175 | ||||
| 176 | template <typename T, typename U, | |||
| 177 | bool (*Enforce)(U cx, const char* sourceDescription, const double& d, | |||
| 178 | T* retval)> | |||
| 179 | struct 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)) { | |||
| 187 | return false; | |||
| 188 | } | |||
| 189 | ||||
| 190 | return Enforce(cx, sourceDescription, intermediate, retval); | |||
| 191 | } | |||
| 192 | }; | |||
| 193 | ||||
| 194 | template <typename T> | |||
| 195 | inline 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)) { | |||
| 202 | return cx.ThrowErrorMessage<MSG_ENFORCE_RANGE_NON_FINITE>( | |||
| 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 | ||||
| 219 | template <typename T> | |||
| 220 | struct PrimitiveConversionTraits<T, eEnforceRange> | |||
| 221 | : public PrimitiveConversionTraits_ToCheckedIntHelper< | |||
| 222 | T, BindingCallContext&, PrimitiveConversionTraits_EnforceRange<T> > { | |||
| 223 | }; | |||
| 224 | ||||
| 225 | template <typename T> | |||
| 226 | inline bool PrimitiveConversionTraits_Clamp(JSContext* cx, | |||
| 227 | const char* sourceDescription, | |||
| 228 | const double& d, T* retval) { | |||
| 229 | static_assert(std::numeric_limits<T>::is_integer, | |||
| 230 | "This can only be applied to integers!"); | |||
| 231 | ||||
| 232 | if (std::isnan(d)) { | |||
| 233 | *retval = 0; | |||
| 234 | return true; | |||
| 235 | } | |||
| 236 | if (d >= PrimitiveConversionTraits_Limits<T>::max()) { | |||
| 237 | *retval = PrimitiveConversionTraits_Limits<T>::max(); | |||
| 238 | return true; | |||
| 239 | } | |||
| 240 | if (d <= PrimitiveConversionTraits_Limits<T>::min()) { | |||
| 241 | *retval = PrimitiveConversionTraits_Limits<T>::min(); | |||
| 242 | return true; | |||
| 243 | } | |||
| 244 | ||||
| 245 | MOZ_ASSERT(std::isfinite(d))do { static_assert( mozilla::detail::AssertionConditionType< decltype(std::isfinite(d))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(std::isfinite(d)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("std::isfinite(d)" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h" , 245); AnnotateMozCrashReason("MOZ_ASSERT" "(" "std::isfinite(d)" ")"); do { *((volatile int*)__null) = 245; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
| 246 | ||||
| 247 | // Banker's rounding (round ties towards even). | |||
| 248 | // We move away from 0 by 0.5f and then truncate. That gets us the right | |||
| 249 | // answer for any starting value except plus or minus N.5. With a starting | |||
| 250 | // value of that form, we now have plus or minus N+1. If N is odd, this is | |||
| 251 | // the correct result. If N is even, plus or minus N is the correct result. | |||
| 252 | double toTruncate = (d < 0) ? d - 0.5 : d + 0.5; | |||
| 253 | ||||
| 254 | T truncated = static_cast<T>(toTruncate); | |||
| 255 | ||||
| 256 | if (truncated == toTruncate) { | |||
| 257 | /* | |||
| 258 | * It was a tie (since moving away from 0 by 0.5 gave us the exact integer | |||
| 259 | * we want). Since we rounded away from 0, we either already have an even | |||
| 260 | * number or we have an odd number but the number we want is one closer to | |||
| 261 | * 0. So just unconditionally masking out the ones bit should do the trick | |||
| 262 | * to get us the value we want. | |||
| 263 | */ | |||
| 264 | truncated &= ~1; | |||
| 265 | } | |||
| 266 | ||||
| 267 | *retval = truncated; | |||
| 268 | return true; | |||
| 269 | } | |||
| 270 | ||||
| 271 | template <typename T> | |||
| 272 | struct PrimitiveConversionTraits<T, eClamp> | |||
| 273 | : public PrimitiveConversionTraits_ToCheckedIntHelper< | |||
| 274 | T, JSContext*, PrimitiveConversionTraits_Clamp<T> > {}; | |||
| 275 | ||||
| 276 | template <ConversionBehavior B> | |||
| 277 | struct PrimitiveConversionTraits<bool, B> : public DisallowedConversion<bool> { | |||
| 278 | }; | |||
| 279 | ||||
| 280 | template <> | |||
| 281 | struct 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 | ||||
| 291 | template <ConversionBehavior B> | |||
| 292 | struct PrimitiveConversionTraits<float, B> | |||
| 293 | : public DisallowedConversion<float> {}; | |||
| 294 | ||||
| 295 | template <ConversionBehavior B> | |||
| 296 | struct PrimitiveConversionTraits<double, B> | |||
| 297 | : public DisallowedConversion<double> {}; | |||
| 298 | ||||
| 299 | struct 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 | ||||
| 308 | template <> | |||
| 309 | struct PrimitiveConversionTraits<float, eDefault> | |||
| 310 | : PrimitiveConversionTraits_float {}; | |||
| 311 | template <> | |||
| 312 | struct PrimitiveConversionTraits<double, eDefault> | |||
| 313 | : PrimitiveConversionTraits_float {}; | |||
| 314 | ||||
| 315 | template <typename T, ConversionBehavior B, typename U> | |||
| 316 | bool ValueToPrimitive(U& cx, JS::Handle<JS::Value> v, | |||
| 317 | const char* sourceDescription, T* retval) { | |||
| 318 | typename PrimitiveConversionTraits<T, B>::jstype t; | |||
| 319 | if (!PrimitiveConversionTraits<T, B>::converter(cx, v, sourceDescription, &t)) | |||
| 320 | return false; | |||
| 321 | ||||
| 322 | *retval = static_cast<T>( | |||
| ||||
| 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 */ |