Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/WorkletBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM Worklet.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "AtomList.h"
4
#include "WorkletBinding.h"
5
#include "WrapperFactory.h"
6
#include "mozilla/OwningNonNull.h"
7
#include "mozilla/Preferences.h"
8
#include "mozilla/dom/BindingUtils.h"
9
#include "mozilla/dom/DOMJSClass.h"
10
#include "mozilla/dom/NonRefcountedDOMObject.h"
11
#include "mozilla/dom/Promise.h"
12
#include "mozilla/dom/ScriptSettings.h"
13
#include "mozilla/dom/SimpleGlobalObject.h"
14
#include "mozilla/dom/ToJSValue.h"
15
#include "mozilla/dom/Worklet.h"
16
#include "mozilla/dom/XrayExpandoClass.h"
17
#include "nsContentUtils.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
namespace binding_detail {}; // Just to make sure it's known as a namespace
23
using namespace mozilla::dom::binding_detail;
24
25
26
27
WorkletOptions::WorkletOptions()
28
0
{
29
0
  // Safe to pass a null context if we pass a null value
30
0
  Init(nullptr, JS::NullHandleValue);
31
0
}
32
33
34
35
bool
36
WorkletOptions::InitIds(JSContext* cx, WorkletOptionsAtoms* atomsCache)
37
0
{
38
0
  MOZ_ASSERT(!*reinterpret_cast<jsid**>(atomsCache));
39
0
40
0
  // Initialize these in reverse order so that any failure leaves the first one
41
0
  // uninitialized.
42
0
  if (!atomsCache->credentials_id.init(cx, "credentials")) {
43
0
    return false;
44
0
  }
45
0
  return true;
46
0
}
47
48
bool
49
WorkletOptions::Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
50
0
{
51
0
  // Passing a null JSContext is OK only if we're initing from null,
52
0
  // Since in that case we will not have to do any property gets
53
0
  // Also evaluate isNullOrUndefined in order to avoid false-positive
54
0
  // checkers by static analysis tools
55
0
  MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
56
0
  WorkletOptionsAtoms* atomsCache = nullptr;
57
0
  if (cx) {
58
0
    atomsCache = GetAtomCache<WorkletOptionsAtoms>(cx);
59
0
    if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
60
0
      return false;
61
0
    }
62
0
  }
63
0
64
0
  if (!IsConvertibleToDictionary(val)) {
65
0
    return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
66
0
  }
67
0
68
0
  bool isNull = val.isNullOrUndefined();
69
0
  // We only need these if !isNull, in which case we have |cx|.
70
0
  Maybe<JS::Rooted<JSObject *> > object;
71
0
  Maybe<JS::Rooted<JS::Value> > temp;
72
0
  if (!isNull) {
73
0
    MOZ_ASSERT(cx);
74
0
    object.emplace(cx, &val.toObject());
75
0
    temp.emplace(cx);
76
0
  }
77
0
  if (!isNull) {
78
0
    if (!JS_GetPropertyById(cx, *object, atomsCache->credentials_id, temp.ptr())) {
79
0
      return false;
80
0
    }
81
0
  }
82
0
  if (!isNull && !temp->isUndefined()) {
83
0
    {
84
0
      int index;
85
0
      if (!FindEnumStringIndex<true>(cx, temp.ref(), RequestCredentialsValues::strings, "RequestCredentials", "'credentials' member of WorkletOptions", &index)) {
86
0
        return false;
87
0
      }
88
0
      MOZ_ASSERT(index >= 0);
89
0
      mCredentials = static_cast<RequestCredentials>(index);
90
0
    }
91
0
  } else {
92
0
    mCredentials = RequestCredentials::Same_origin;
93
0
  }
94
0
  mIsAnyMemberPresent = true;
95
0
  return true;
96
0
}
97
98
bool
99
WorkletOptions::Init(const nsAString& aJSON)
100
0
{
101
0
  AutoJSAPI jsapi;
102
0
  JSObject* cleanGlobal = SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail);
103
0
  if (!cleanGlobal) {
104
0
    return false;
105
0
  }
106
0
  if (!jsapi.Init(cleanGlobal)) {
107
0
    return false;
108
0
  }
109
0
  JSContext* cx = jsapi.cx();
110
0
  JS::Rooted<JS::Value> json(cx);
111
0
  bool ok = ParseJSON(cx, aJSON, &json);
112
0
  NS_ENSURE_TRUE(ok, false);
113
0
  return Init(cx, json);
114
0
}
115
116
bool
117
WorkletOptions::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
118
0
{
119
0
  WorkletOptionsAtoms* atomsCache = GetAtomCache<WorkletOptionsAtoms>(cx);
120
0
  if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
121
0
    return false;
122
0
  }
123
0
124
0
  JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
125
0
  if (!obj) {
126
0
    return false;
127
0
  }
128
0
  rval.set(JS::ObjectValue(*obj));
129
0
130
0
  do {
131
0
    // block for our 'break' successCode and scope for 'temp' and 'currentValue'
132
0
    JS::Rooted<JS::Value> temp(cx);
133
0
    RequestCredentials const & currentValue = mCredentials;
134
0
    if (!ToJSValue(cx, currentValue, &temp)) {
135
0
      return false;
136
0
    }
137
0
    if (!JS_DefinePropertyById(cx, obj, atomsCache->credentials_id, temp, JSPROP_ENUMERATE)) {
138
0
      return false;
139
0
    }
140
0
    break;
141
0
  } while(false);
142
0
143
0
  return true;
144
0
}
145
146
bool
147
WorkletOptions::ToJSON(nsAString& aJSON) const
148
0
{
149
0
  AutoJSAPI jsapi;
150
0
  jsapi.Init();
151
0
  JSContext *cx = jsapi.cx();
152
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here
153
0
  // because we'll only be creating objects, in ways that have no
154
0
  // side-effects, followed by a call to JS::ToJSONMaybeSafely,
155
0
  // which likewise guarantees no side-effects for the sorts of
156
0
  // things we will pass it.
157
0
  JSAutoRealm ar(cx, UnprivilegedJunkScopeOrWorkerGlobal());
158
0
  JS::Rooted<JS::Value> val(cx);
159
0
  if (!ToObjectInternal(cx, &val)) {
160
0
    return false;
161
0
  }
162
0
  JS::Rooted<JSObject*> obj(cx, &val.toObject());
163
0
  return StringifyToJSON(cx, obj, aJSON);
164
0
}
165
166
void
167
WorkletOptions::TraceDictionary(JSTracer* trc)
168
0
{
169
0
}
170
171
WorkletOptions&
172
WorkletOptions::operator=(const WorkletOptions& aOther)
173
0
{
174
0
  DictionaryBase::operator=(aOther);
175
0
  mCredentials = aOther.mCredentials;
176
0
  return *this;
177
0
}
178
179
namespace binding_detail {
180
} // namespace binding_detail
181
182
183
namespace Worklet_Binding {
184
185
MOZ_CAN_RUN_SCRIPT static bool
186
addModule(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::Worklet* self, const JSJitMethodCallArgs& args)
187
0
{
188
0
  AUTO_PROFILER_LABEL_FAST("Worklet.addModule", DOM, cx);
189
0
190
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
191
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Worklet.addModule");
192
0
  }
193
0
  binding_detail::FakeString arg0;
194
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
195
0
    return false;
196
0
  }
197
0
  NormalizeUSVString(arg0);
198
0
  binding_detail::FastWorkletOptions arg1;
199
0
  if (!arg1.Init(cx, (args.hasDefined(1)) ? args[1] : JS::NullHandleValue,  "Argument 2 of Worklet.addModule", false)) {
200
0
    return false;
201
0
  }
202
0
  FastErrorResult rv;
203
0
  auto result(StrongOrRawPtr<Promise>(self->AddModule(Constify(arg0), Constify(arg1), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
204
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
205
0
    return false;
206
0
  }
207
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
208
0
  static_assert(!IsPointer<decltype(result)>::value,
209
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
210
0
  if (!ToJSValue(cx, result, args.rval())) {
211
0
    return false;
212
0
  }
213
0
  return true;
214
0
}
215
216
MOZ_CAN_RUN_SCRIPT static bool
217
addModule_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::Worklet* self, const JSJitMethodCallArgs& args)
218
0
{
219
0
  bool ok = addModule(cx, obj, self, args);
220
0
  if (ok) {
221
0
    return true;
222
0
  }
223
0
  return ConvertExceptionToPromise(cx, args.rval());
224
0
}
225
226
static const JSJitInfo addModule_methodinfo = {
227
  { (JSJitGetterOp)addModule_promiseWrapper },
228
  { prototypes::id::Worklet },
229
  { PrototypeTraits<prototypes::id::Worklet>::Depth },
230
  JSJitInfo::Method,
231
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
232
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
233
  false,  /* isInfallible. False in setters. */
234
  false,  /* isMovable.  Not relevant for setters. */
235
  false, /* isEliminatable.  Not relevant for setters. */
236
  false, /* isAlwaysInSlot.  Only relevant for getters. */
237
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
238
  false,  /* isTypedMethod.  Only relevant for methods. */
239
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
240
};
241
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
242
static_assert(0 < 1, "There is no slot for us");
243
244
static bool
245
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
246
0
{
247
0
  mozilla::dom::Worklet* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Worklet>(obj);
248
0
  // We don't want to preserve if we don't have a wrapper, and we
249
0
  // obviously can't preserve if we're not initialized.
250
0
  if (self && self->GetWrapperPreserveColor()) {
251
0
    PreserveWrapper(self);
252
0
  }
253
0
  return true;
254
0
}
255
256
static void
257
_finalize(js::FreeOp* fop, JSObject* obj)
258
0
{
259
0
  mozilla::dom::Worklet* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Worklet>(obj);
260
0
  if (self) {
261
0
    ClearWrapper(self, self, obj);
262
0
    AddForDeferredFinalization<mozilla::dom::Worklet>(self);
263
0
  }
264
0
}
265
266
static size_t
267
_objectMoved(JSObject* obj, JSObject* old)
268
0
{
269
0
  mozilla::dom::Worklet* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::Worklet>(obj);
270
0
  if (self) {
271
0
    UpdateWrapper(self, self, obj, old);
272
0
  }
273
0
274
0
  return 0;
275
0
}
276
277
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
278
#if defined(__clang__)
279
#pragma clang diagnostic push
280
#pragma clang diagnostic ignored "-Wmissing-braces"
281
#endif
282
static const JSFunctionSpec sMethods_specs[] = {
283
  JS_FNSPEC("addModule", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&addModule_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
284
  JS_FS_END
285
};
286
#if defined(__clang__)
287
#pragma clang diagnostic pop
288
#endif
289
290
291
static const Prefable<const JSFunctionSpec> sMethods[] = {
292
  { nullptr, &sMethods_specs[0] },
293
  { nullptr, nullptr }
294
};
295
296
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
297
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
298
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
299
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
300
301
302
static uint16_t sNativeProperties_sortedPropertyIndices[1];
303
static PropertyInfo sNativeProperties_propertyInfos[1];
304
305
static const NativePropertiesN<1> sNativeProperties = {
306
  false, 0,
307
  false, 0,
308
  true,  0 /* sMethods */,
309
  false, 0,
310
  false, 0,
311
  false, 0,
312
  false, 0,
313
  -1,
314
  1,
315
  sNativeProperties_sortedPropertyIndices,
316
  {
317
    { sMethods, &sNativeProperties_propertyInfos[0] }
318
  }
319
};
320
static_assert(1 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
321
    "We have a property info count that is oversized");
322
323
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
324
  {
325
    "Function",
326
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
327
    &sBoringInterfaceObjectClassClassOps,
328
    JS_NULL_CLASS_SPEC,
329
    JS_NULL_CLASS_EXT,
330
    &sInterfaceObjectClassObjectOps
331
  },
332
  eInterface,
333
  true,
334
  prototypes::id::Worklet,
335
  PrototypeTraits<prototypes::id::Worklet>::Depth,
336
  sNativePropertyHooks,
337
  "function Worklet() {\n    [native code]\n}",
338
  JS::GetRealmFunctionPrototype
339
};
340
341
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
342
  {
343
    "WorkletPrototype",
344
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
345
    JS_NULL_CLASS_OPS,
346
    JS_NULL_CLASS_SPEC,
347
    JS_NULL_CLASS_EXT,
348
    JS_NULL_OBJECT_OPS
349
  },
350
  eInterfacePrototype,
351
  false,
352
  prototypes::id::Worklet,
353
  PrototypeTraits<prototypes::id::Worklet>::Depth,
354
  sNativePropertyHooks,
355
  "[object WorkletPrototype]",
356
  JS::GetRealmObjectPrototype
357
};
358
359
bool
360
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj)
361
0
{
362
0
  static bool sPrefValue;
363
0
  static bool sPrefCacheSetUp = false;
364
0
  if (!sPrefCacheSetUp) {
365
0
    sPrefCacheSetUp = true;
366
0
    Preferences::AddBoolVarCache(&sPrefValue, "dom.worklet.enabled");
367
0
  }
368
0
369
0
  return sPrefValue;
370
0
}
371
372
static const js::ClassOps sClassOps = {
373
  _addProperty, /* addProperty */
374
  nullptr,               /* delProperty */
375
  nullptr,               /* enumerate */
376
  nullptr, /* newEnumerate */
377
  nullptr, /* resolve */
378
  nullptr, /* mayResolve */
379
  _finalize, /* finalize */
380
  nullptr, /* call */
381
  nullptr,               /* hasInstance */
382
  nullptr,               /* construct */
383
  nullptr, /* trace */
384
};
385
386
static const js::ClassExtension sClassExtension = {
387
  nullptr, /* weakmapKeyDelegateOp */
388
  _objectMoved /* objectMovedOp */
389
};
390
391
static const DOMJSClass sClass = {
392
  { "Worklet",
393
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
394
    &sClassOps,
395
    JS_NULL_CLASS_SPEC,
396
    &sClassExtension,
397
    JS_NULL_OBJECT_OPS
398
  },
399
  { prototypes::id::Worklet, 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 },
400
  IsBaseOf<nsISupports, mozilla::dom::Worklet >::value,
401
  sNativePropertyHooks,
402
  FindAssociatedGlobalForNative<mozilla::dom::Worklet>::Get,
403
  GetProtoObjectHandle,
404
  GetCCParticipant<mozilla::dom::Worklet>::Get()
405
};
406
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
407
              "Must have the right minimal number of reserved slots.");
408
static_assert(1 >= 1,
409
              "Must have enough reserved slots.");
410
411
const JSClass*
412
GetJSClass()
413
0
{
414
0
  return sClass.ToJSClass();
415
0
}
416
417
bool
418
Wrap(JSContext* aCx, mozilla::dom::Worklet* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
419
0
{
420
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::Worklet>::value,
421
0
                "Shouldn't have wrappercached things that are not refcounted.");
422
0
  MOZ_ASSERT(static_cast<mozilla::dom::Worklet*>(aObject) ==
423
0
             reinterpret_cast<mozilla::dom::Worklet*>(aObject),
424
0
             "Multiple inheritance for mozilla::dom::Worklet is broken.");
425
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
426
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
427
0
  MOZ_ASSERT(!aCache->GetWrapper(),
428
0
             "You should probably not be using Wrap() directly; use "
429
0
             "GetOrCreateDOMReflector instead");
430
0
431
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
432
0
             "nsISupports must be on our primary inheritance chain");
433
0
434
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
435
0
  if (!global) {
436
0
    return false;
437
0
  }
438
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
439
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
440
0
441
0
  // That might have ended up wrapping us already, due to the wonders
442
0
  // of XBL.  Check for that, and bail out as needed.
443
0
  aReflector.set(aCache->GetWrapper());
444
0
  if (aReflector) {
445
#ifdef DEBUG
446
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
447
#endif // DEBUG
448
    return true;
449
0
  }
450
0
451
0
  JSAutoRealm ar(aCx, global);
452
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
453
0
  if (!canonicalProto) {
454
0
    return false;
455
0
  }
456
0
  JS::Rooted<JSObject*> proto(aCx);
457
0
  if (aGivenProto) {
458
0
    proto = aGivenProto;
459
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
460
0
    // coming in, we changed compartments to that of "parent" so may need
461
0
    // to wrap the proto here.
462
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
463
0
      if (!JS_WrapObject(aCx, &proto)) {
464
0
        return false;
465
0
      }
466
0
    }
467
0
  } else {
468
0
    proto = canonicalProto;
469
0
  }
470
0
471
0
  BindingJSObjectCreator<mozilla::dom::Worklet> creator(aCx);
472
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
473
0
  if (!aReflector) {
474
0
    return false;
475
0
  }
476
0
477
0
  aCache->SetWrapper(aReflector);
478
0
  creator.InitializationSucceeded();
479
0
480
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
481
0
             aCache->GetWrapperPreserveColor() == aReflector);
482
0
  // If proto != canonicalProto, we have to preserve our wrapper;
483
0
  // otherwise we won't be able to properly recreate it later, since
484
0
  // we won't know what proto to use.  Note that we don't check
485
0
  // aGivenProto here, since it's entirely possible (and even
486
0
  // somewhat common) to have a non-null aGivenProto which is the
487
0
  // same as canonicalProto.
488
0
  if (proto != canonicalProto) {
489
0
    PreserveWrapper(aObject);
490
0
  }
491
0
492
0
  return true;
493
0
}
494
495
const NativePropertyHooks sNativePropertyHooks[] = { {
496
  nullptr,
497
  nullptr,
498
  nullptr,
499
  { sNativeProperties.Upcast(), nullptr },
500
  prototypes::id::Worklet,
501
  constructors::id::Worklet,
502
  nullptr,
503
  &DefaultXrayExpandoObjectClass
504
} };
505
506
void
507
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
508
0
{
509
0
  JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx));
510
0
  if (!parentProto) {
511
0
    return;
512
0
  }
513
0
514
0
  JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx));
515
0
  if (!constructorProto) {
516
0
    return;
517
0
  }
518
0
519
0
  static bool sIdsInited = false;
520
0
  if (!sIdsInited && NS_IsMainThread()) {
521
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
522
0
      return;
523
0
    }
524
0
    sIdsInited = true;
525
0
  }
526
0
527
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::Worklet);
528
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::Worklet);
529
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
530
0
                              &sPrototypeClass.mBase, protoCache,
531
0
                              nullptr,
532
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
533
0
                              interfaceCache,
534
0
                              sNativeProperties.Upcast(),
535
0
                              nullptr,
536
0
                              "Worklet", aDefineOnGlobal,
537
0
                              nullptr,
538
0
                              false);
539
0
}
540
541
JSObject*
542
GetProtoObject(JSContext* aCx)
543
0
{
544
0
  return GetProtoObjectHandle(aCx);
545
0
}
546
547
JSObject*
548
GetConstructorObject(JSContext* aCx)
549
0
{
550
0
  return GetConstructorObjectHandle(aCx);
551
0
}
552
553
} // namespace Worklet_Binding
554
555
556
557
} // namespace dom
558
} // namespace mozilla