Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/MIDIOutputMapBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM MIDIOutputMap.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "MIDIOutputMapBinding.h"
4
#include "WrapperFactory.h"
5
#include "XrayWrapper.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/MIDIOutput.h"
11
#include "mozilla/dom/MIDIOutputMap.h"
12
#include "mozilla/dom/NonRefcountedDOMObject.h"
13
#include "mozilla/dom/PrimitiveConversions.h"
14
#include "mozilla/dom/ToJSValue.h"
15
#include "mozilla/dom/XrayExpandoClass.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
namespace binding_detail {}; // Just to make sure it's known as a namespace
21
using namespace mozilla::dom::binding_detail;
22
23
24
namespace MIDIOutputMap_Binding {
25
26
namespace MaplikeHelpers {
27
void
28
Clear(mozilla::dom::MIDIOutputMap* self, ErrorResult& aRv)
29
0
{
30
0
  MOZ_ASSERT(self);
31
0
  AutoJSAPI jsapi;
32
0
  jsapi.Init();
33
0
  JSContext* cx = jsapi.cx();
34
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
35
0
  // all we want is to wrap into _some_ scope and then unwrap to find
36
0
  // the reflector, and wrapping has no side-effects.
37
0
  JSAutoRealm tempRealm(cx, UnprivilegedJunkScopeOrWorkerGlobal());
38
0
  JS::Rooted<JS::Value> v(cx);
39
0
  if(!ToJSValue(cx, self, &v)) {
40
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
41
0
    return;
42
0
  }
43
0
  // This is a reflector, but due to trying to name things
44
0
  // similarly across method generators, it's called obj here.
45
0
  JS::Rooted<JSObject*> obj(cx);
46
0
  obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
47
0
  JSAutoRealm reflectorRealm(cx, obj);
48
0
49
0
  JS::Rooted<JSObject*> backingObj(cx);
50
0
  bool created = false;
51
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
52
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
53
0
    return;
54
0
  }
55
0
  if (created) {
56
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
57
0
  }
58
0
  if (!JS::MapClear(cx, backingObj)) {
59
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
60
0
    return;
61
0
  }
62
0
  return;
63
0
}
64
bool
65
Delete(mozilla::dom::MIDIOutputMap* self, const nsAString& aKey, ErrorResult& aRv)
66
0
{
67
0
  MOZ_ASSERT(self);
68
0
  AutoJSAPI jsapi;
69
0
  jsapi.Init();
70
0
  JSContext* cx = jsapi.cx();
71
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
72
0
  // all we want is to wrap into _some_ scope and then unwrap to find
73
0
  // the reflector, and wrapping has no side-effects.
74
0
  JSAutoRealm tempRealm(cx, UnprivilegedJunkScopeOrWorkerGlobal());
75
0
  JS::Rooted<JS::Value> v(cx);
76
0
  if(!ToJSValue(cx, self, &v)) {
77
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
78
0
    return false;
79
0
  }
80
0
  // This is a reflector, but due to trying to name things
81
0
  // similarly across method generators, it's called obj here.
82
0
  JS::Rooted<JSObject*> obj(cx);
83
0
  obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
84
0
  JSAutoRealm reflectorRealm(cx, obj);
85
0
  bool aRetVal;
86
0
  JS::AutoValueVector argv(cx);
87
0
  if (!argv.resize(1)) {
88
0
    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
89
0
    return false;
90
0
  }
91
0
  do {
92
0
    nsString mutableStr(aKey);
93
0
    if (!xpc::NonVoidStringToJsval(cx, mutableStr, argv[0])) {
94
0
      aRv.Throw(NS_ERROR_UNEXPECTED);
95
0
      return false;
96
0
    }
97
0
    break;
98
0
  } while (false);
99
0
100
0
  JS::Rooted<JSObject*> backingObj(cx);
101
0
  bool created = false;
102
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
103
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
104
0
    return false;
105
0
  }
106
0
  if (created) {
107
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
108
0
  }
109
0
  if (!JS::MapDelete(cx, backingObj, argv[0], &aRetVal)) {
110
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
111
0
    return false;
112
0
  }
113
0
  return aRetVal;
114
0
}
115
bool
116
Has(mozilla::dom::MIDIOutputMap* self, const nsAString& aKey, ErrorResult& aRv)
117
0
{
118
0
  MOZ_ASSERT(self);
119
0
  AutoJSAPI jsapi;
120
0
  jsapi.Init();
121
0
  JSContext* cx = jsapi.cx();
122
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
123
0
  // all we want is to wrap into _some_ scope and then unwrap to find
124
0
  // the reflector, and wrapping has no side-effects.
125
0
  JSAutoRealm tempRealm(cx, UnprivilegedJunkScopeOrWorkerGlobal());
126
0
  JS::Rooted<JS::Value> v(cx);
127
0
  if(!ToJSValue(cx, self, &v)) {
128
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
129
0
    return false;
130
0
  }
131
0
  // This is a reflector, but due to trying to name things
132
0
  // similarly across method generators, it's called obj here.
133
0
  JS::Rooted<JSObject*> obj(cx);
134
0
  obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
135
0
  JSAutoRealm reflectorRealm(cx, obj);
136
0
  bool aRetVal;
137
0
  JS::AutoValueVector argv(cx);
138
0
  if (!argv.resize(1)) {
139
0
    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
140
0
    return false;
141
0
  }
142
0
  do {
143
0
    nsString mutableStr(aKey);
144
0
    if (!xpc::NonVoidStringToJsval(cx, mutableStr, argv[0])) {
145
0
      aRv.Throw(NS_ERROR_UNEXPECTED);
146
0
      return false;
147
0
    }
148
0
    break;
149
0
  } while (false);
150
0
151
0
  JS::Rooted<JSObject*> backingObj(cx);
152
0
  bool created = false;
153
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
154
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
155
0
    return false;
156
0
  }
157
0
  if (created) {
158
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
159
0
  }
160
0
  if (!JS::MapHas(cx, backingObj, argv[0], &aRetVal)) {
161
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
162
0
    return false;
163
0
  }
164
0
  return aRetVal;
165
0
}
166
void
167
Set(mozilla::dom::MIDIOutputMap* self, const nsAString& aKey, MIDIOutput& aValue, ErrorResult& aRv)
168
0
{
169
0
  MOZ_ASSERT(self);
170
0
  AutoJSAPI jsapi;
171
0
  jsapi.Init();
172
0
  JSContext* cx = jsapi.cx();
173
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
174
0
  // all we want is to wrap into _some_ scope and then unwrap to find
175
0
  // the reflector, and wrapping has no side-effects.
176
0
  JSAutoRealm tempRealm(cx, UnprivilegedJunkScopeOrWorkerGlobal());
177
0
  JS::Rooted<JS::Value> v(cx);
178
0
  if(!ToJSValue(cx, self, &v)) {
179
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
180
0
    return;
181
0
  }
182
0
  // This is a reflector, but due to trying to name things
183
0
  // similarly across method generators, it's called obj here.
184
0
  JS::Rooted<JSObject*> obj(cx);
185
0
  obj = js::UncheckedUnwrap(&v.toObject(), /* stopAtWindowProxy = */ false);
186
0
  JSAutoRealm reflectorRealm(cx, obj);
187
0
  JS::AutoValueVector argv(cx);
188
0
  if (!argv.resize(2)) {
189
0
    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
190
0
    return;
191
0
  }
192
0
  do {
193
0
    if (!GetOrCreateDOMReflector(cx, aValue, argv[1])) {
194
0
      MOZ_ASSERT(JS_IsExceptionPending(cx));
195
0
      aRv.Throw(NS_ERROR_UNEXPECTED);
196
0
      return;
197
0
    }
198
0
    break;
199
0
  } while (false);
200
0
201
0
  do {
202
0
    nsString mutableStr(aKey);
203
0
    if (!xpc::NonVoidStringToJsval(cx, mutableStr, argv[0])) {
204
0
      aRv.Throw(NS_ERROR_UNEXPECTED);
205
0
      return;
206
0
    }
207
0
    break;
208
0
  } while (false);
209
0
210
0
  JS::Rooted<JSObject*> backingObj(cx);
211
0
  bool created = false;
212
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
213
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
214
0
    return;
215
0
  }
216
0
  if (created) {
217
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
218
0
  }
219
0
  if (!JS::MapSet(cx, backingObj, argv[0], argv[1])) {
220
0
    aRv.Throw(NS_ERROR_UNEXPECTED);
221
0
    return;
222
0
  }
223
0
  return;
224
0
}
225
} // namespace MaplikeHelpers
226
227
MOZ_CAN_RUN_SCRIPT static bool
228
get_size(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, JSJitGetterCallArgs args)
229
0
{
230
0
  AUTO_PROFILER_LABEL_FAST("get MIDIOutputMap.size", DOM, cx);
231
0
232
0
  JS::Rooted<JSObject*> backingObj(cx);
233
0
  bool created = false;
234
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
235
0
    return false;
236
0
  }
237
0
  if (created) {
238
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
239
0
  }
240
0
  uint32_t result = JS::MapSize(cx, backingObj);
241
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
242
0
  args.rval().setNumber(result);
243
0
  return true;
244
0
}
245
246
static const JSJitInfo size_getterinfo = {
247
  { (JSJitGetterOp)get_size },
248
  { prototypes::id::MIDIOutputMap },
249
  { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
250
  JSJitInfo::Getter,
251
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
252
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
253
  true,  /* isInfallible. False in setters. */
254
  false,  /* isMovable.  Not relevant for setters. */
255
  false, /* isEliminatable.  Not relevant for setters. */
256
  false, /* isAlwaysInSlot.  Only relevant for getters. */
257
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
258
  false,  /* isTypedMethod.  Only relevant for methods. */
259
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
260
};
261
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
262
static_assert(0 < 2, "There is no slot for us");
263
264
MOZ_CAN_RUN_SCRIPT static bool
265
entries(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
266
0
{
267
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.entries", DOM, cx);
268
0
269
0
  JS::Rooted<JSObject*> backingObj(cx);
270
0
  bool created = false;
271
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
272
0
    return false;
273
0
  }
274
0
  if (created) {
275
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
276
0
  }
277
0
  // TODO (Bug 1173651): Xrays currently cannot wrap iterators. Change
278
0
  // after bug 1023984 is fixed.
279
0
  if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
280
0
    JS_ReportErrorASCII(cx, "Xray wrapping of iterators not supported.");
281
0
    return false;
282
0
  }
283
0
  JS::Rooted<JSObject*> result(cx);
284
0
  JS::Rooted<JS::Value> v(cx);
285
0
  if (!JS::MapEntries(cx, backingObj, &v)) {
286
0
    return false;
287
0
  }
288
0
  result = &v.toObject();
289
0
  JS::ExposeObjectToActiveJS(result);
290
0
  args.rval().setObject(*result);
291
0
  if (!MaybeWrapObjectValue(cx, args.rval())) {
292
0
    return false;
293
0
  }
294
0
  return true;
295
0
}
296
297
static const JSJitInfo::ArgType entries_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
298
static const JSTypedMethodJitInfo entries_methodinfo = {
299
  {
300
    { (JSJitGetterOp)entries },
301
    { prototypes::id::MIDIOutputMap },
302
    { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
303
    JSJitInfo::Method,
304
    JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
305
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
306
    false,  /* isInfallible. False in setters. */
307
    false,  /* isMovable.  Not relevant for setters. */
308
    false, /* isEliminatable.  Not relevant for setters. */
309
    false, /* isAlwaysInSlot.  Only relevant for getters. */
310
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
311
    true,  /* isTypedMethod.  Only relevant for methods. */
312
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
313
  },
314
  entries_methodinfo_argTypes
315
};
316
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
317
static_assert(0 < 2, "There is no slot for us");
318
319
MOZ_CAN_RUN_SCRIPT static bool
320
keys(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
321
0
{
322
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.keys", DOM, cx);
323
0
324
0
  JS::Rooted<JSObject*> backingObj(cx);
325
0
  bool created = false;
326
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
327
0
    return false;
328
0
  }
329
0
  if (created) {
330
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
331
0
  }
332
0
  // TODO (Bug 1173651): Xrays currently cannot wrap iterators. Change
333
0
  // after bug 1023984 is fixed.
334
0
  if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
335
0
    JS_ReportErrorASCII(cx, "Xray wrapping of iterators not supported.");
336
0
    return false;
337
0
  }
338
0
  JS::Rooted<JSObject*> result(cx);
339
0
  JS::Rooted<JS::Value> v(cx);
340
0
  if (!JS::MapKeys(cx, backingObj, &v)) {
341
0
    return false;
342
0
  }
343
0
  result = &v.toObject();
344
0
  JS::ExposeObjectToActiveJS(result);
345
0
  args.rval().setObject(*result);
346
0
  if (!MaybeWrapObjectValue(cx, args.rval())) {
347
0
    return false;
348
0
  }
349
0
  return true;
350
0
}
351
352
static const JSJitInfo::ArgType keys_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
353
static const JSTypedMethodJitInfo keys_methodinfo = {
354
  {
355
    { (JSJitGetterOp)keys },
356
    { prototypes::id::MIDIOutputMap },
357
    { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
358
    JSJitInfo::Method,
359
    JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
360
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
361
    false,  /* isInfallible. False in setters. */
362
    false,  /* isMovable.  Not relevant for setters. */
363
    false, /* isEliminatable.  Not relevant for setters. */
364
    false, /* isAlwaysInSlot.  Only relevant for getters. */
365
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
366
    true,  /* isTypedMethod.  Only relevant for methods. */
367
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
368
  },
369
  keys_methodinfo_argTypes
370
};
371
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
372
static_assert(0 < 2, "There is no slot for us");
373
374
MOZ_CAN_RUN_SCRIPT static bool
375
values(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
376
0
{
377
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.values", DOM, cx);
378
0
379
0
  JS::Rooted<JSObject*> backingObj(cx);
380
0
  bool created = false;
381
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
382
0
    return false;
383
0
  }
384
0
  if (created) {
385
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
386
0
  }
387
0
  // TODO (Bug 1173651): Xrays currently cannot wrap iterators. Change
388
0
  // after bug 1023984 is fixed.
389
0
  if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
390
0
    JS_ReportErrorASCII(cx, "Xray wrapping of iterators not supported.");
391
0
    return false;
392
0
  }
393
0
  JS::Rooted<JSObject*> result(cx);
394
0
  JS::Rooted<JS::Value> v(cx);
395
0
  if (!JS::MapValues(cx, backingObj, &v)) {
396
0
    return false;
397
0
  }
398
0
  result = &v.toObject();
399
0
  JS::ExposeObjectToActiveJS(result);
400
0
  args.rval().setObject(*result);
401
0
  if (!MaybeWrapObjectValue(cx, args.rval())) {
402
0
    return false;
403
0
  }
404
0
  return true;
405
0
}
406
407
static const JSJitInfo::ArgType values_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
408
static const JSTypedMethodJitInfo values_methodinfo = {
409
  {
410
    { (JSJitGetterOp)values },
411
    { prototypes::id::MIDIOutputMap },
412
    { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
413
    JSJitInfo::Method,
414
    JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
415
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
416
    false,  /* isInfallible. False in setters. */
417
    false,  /* isMovable.  Not relevant for setters. */
418
    false, /* isEliminatable.  Not relevant for setters. */
419
    false, /* isAlwaysInSlot.  Only relevant for getters. */
420
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
421
    true,  /* isTypedMethod.  Only relevant for methods. */
422
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
423
  },
424
  values_methodinfo_argTypes
425
};
426
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
427
static_assert(0 < 2, "There is no slot for us");
428
429
MOZ_CAN_RUN_SCRIPT static bool
430
forEach(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
431
0
{
432
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.forEach", DOM, cx);
433
0
434
0
  JS::Rooted<JSObject*> arg0(cx);
435
0
  if (args.get(0).isObject()) {
436
0
    arg0 = &args.get(0).toObject();
437
0
  } else {
438
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of MIDIOutputMap.forEach");
439
0
    return false;
440
0
  }
441
0
  JS::Rooted<JS::Value> arg1(cx);
442
0
  if (args.hasDefined(1)) {
443
0
    arg1 = args.get(1);
444
0
  } else {
445
0
    arg1 = JS::UndefinedValue();
446
0
  }
447
0
  JS::Rooted<JSObject*> backingObj(cx);
448
0
  bool created = false;
449
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
450
0
    return false;
451
0
  }
452
0
  if (created) {
453
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
454
0
  }
455
0
  // Create a wrapper function.
456
0
  JSFunction* func = js::NewFunctionWithReserved(cx, ForEachHandler, 3, 0, nullptr);
457
0
  if (!func) {
458
0
    return false;
459
0
  }
460
0
  JS::Rooted<JSObject*> funcObj(cx, JS_GetFunctionObject(func));
461
0
  JS::Rooted<JS::Value> funcVal(cx, JS::ObjectValue(*funcObj));
462
0
  js::SetFunctionNativeReserved(funcObj, FOREACH_CALLBACK_SLOT,
463
0
                                JS::ObjectValue(*arg0));
464
0
  js::SetFunctionNativeReserved(funcObj, FOREACH_MAPLIKEORSETLIKEOBJ_SLOT,
465
0
                                JS::ObjectValue(*obj));
466
0
  if (!JS::MapForEach(cx, backingObj, funcVal, arg1)) {
467
0
    return false;
468
0
  }
469
0
  args.rval().setUndefined();
470
0
  return true;
471
0
}
472
473
static const JSJitInfo forEach_methodinfo = {
474
  { (JSJitGetterOp)forEach },
475
  { prototypes::id::MIDIOutputMap },
476
  { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
477
  JSJitInfo::Method,
478
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
479
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
480
  false,  /* isInfallible. False in setters. */
481
  false,  /* isMovable.  Not relevant for setters. */
482
  false, /* isEliminatable.  Not relevant for setters. */
483
  false, /* isAlwaysInSlot.  Only relevant for getters. */
484
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
485
  false,  /* isTypedMethod.  Only relevant for methods. */
486
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
487
};
488
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
489
static_assert(0 < 2, "There is no slot for us");
490
491
MOZ_CAN_RUN_SCRIPT static bool
492
has(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
493
0
{
494
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.has", DOM, cx);
495
0
496
0
  binding_detail::FakeString arg0;
497
0
  if (!ConvertJSValueToString(cx, args.get(0), eStringify, eStringify, arg0)) {
498
0
    return false;
499
0
  }
500
0
  JS::Rooted<JSObject*> backingObj(cx);
501
0
  bool created = false;
502
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
503
0
    return false;
504
0
  }
505
0
  if (created) {
506
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
507
0
  }
508
0
  JS::Rooted<JS::Value> arg0Val(cx);
509
0
  if (!ToJSValue(cx, arg0, &arg0Val)) {
510
0
    return false;
511
0
  }
512
0
  bool result;
513
0
  if (!JS::MapHas(cx, backingObj, arg0Val, &result)) {
514
0
    return false;
515
0
  }
516
0
  args.rval().setBoolean(result);
517
0
  return true;
518
0
}
519
520
static const JSJitInfo::ArgType has_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
521
static const JSTypedMethodJitInfo has_methodinfo = {
522
  {
523
    { (JSJitGetterOp)has },
524
    { prototypes::id::MIDIOutputMap },
525
    { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
526
    JSJitInfo::Method,
527
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
528
    JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
529
    false,  /* isInfallible. False in setters. */
530
    false,  /* isMovable.  Not relevant for setters. */
531
    false, /* isEliminatable.  Not relevant for setters. */
532
    false, /* isAlwaysInSlot.  Only relevant for getters. */
533
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
534
    true,  /* isTypedMethod.  Only relevant for methods. */
535
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
536
  },
537
  has_methodinfo_argTypes
538
};
539
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
540
static_assert(0 < 2, "There is no slot for us");
541
542
MOZ_CAN_RUN_SCRIPT static bool
543
get(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::MIDIOutputMap* self, const JSJitMethodCallArgs& args)
544
0
{
545
0
  AUTO_PROFILER_LABEL_FAST("MIDIOutputMap.get", DOM, cx);
546
0
547
0
  binding_detail::FakeString arg0;
548
0
  if (!ConvertJSValueToString(cx, args.get(0), eStringify, eStringify, arg0)) {
549
0
    return false;
550
0
  }
551
0
  JS::Rooted<JSObject*> backingObj(cx);
552
0
  bool created = false;
553
0
  if (!GetMaplikeBackingObject(cx, obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), &backingObj, &created)) {
554
0
    return false;
555
0
  }
556
0
  if (created) {
557
0
    PreserveWrapper<mozilla::dom::MIDIOutputMap>(self);
558
0
  }
559
0
  JS::Rooted<JS::Value> arg0Val(cx);
560
0
  if (!ToJSValue(cx, arg0, &arg0Val)) {
561
0
    return false;
562
0
  }
563
0
  JS::Rooted<JS::Value> result(cx);
564
0
  if (!JS::MapGet(cx, backingObj, arg0Val, &result)) {
565
0
    return false;
566
0
  }
567
0
  JS::ExposeValueToActiveJS(result);
568
0
  args.rval().set(result);
569
0
  if (!MaybeWrapValue(cx, args.rval())) {
570
0
    return false;
571
0
  }
572
0
  return true;
573
0
}
574
575
static const JSJitInfo::ArgType get_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
576
static const JSTypedMethodJitInfo get_methodinfo = {
577
  {
578
    { (JSJitGetterOp)get },
579
    { prototypes::id::MIDIOutputMap },
580
    { PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth },
581
    JSJitInfo::Method,
582
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
583
    JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
584
    false,  /* isInfallible. False in setters. */
585
    false,  /* isMovable.  Not relevant for setters. */
586
    false, /* isEliminatable.  Not relevant for setters. */
587
    false, /* isAlwaysInSlot.  Only relevant for getters. */
588
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
589
    true,  /* isTypedMethod.  Only relevant for methods. */
590
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
591
  },
592
  get_methodinfo_argTypes
593
};
594
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
595
static_assert(0 < 2, "There is no slot for us");
596
597
static bool
598
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
599
0
{
600
0
  mozilla::dom::MIDIOutputMap* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::MIDIOutputMap>(obj);
601
0
  // We don't want to preserve if we don't have a wrapper, and we
602
0
  // obviously can't preserve if we're not initialized.
603
0
  if (self && self->GetWrapperPreserveColor()) {
604
0
    PreserveWrapper(self);
605
0
  }
606
0
  return true;
607
0
}
608
609
static void
610
_finalize(js::FreeOp* fop, JSObject* obj)
611
0
{
612
0
  mozilla::dom::MIDIOutputMap* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::MIDIOutputMap>(obj);
613
0
  if (self) {
614
0
    ClearWrapper(self, self, obj);
615
0
    AddForDeferredFinalization<mozilla::dom::MIDIOutputMap>(self);
616
0
  }
617
0
}
618
619
static size_t
620
_objectMoved(JSObject* obj, JSObject* old)
621
0
{
622
0
  mozilla::dom::MIDIOutputMap* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::MIDIOutputMap>(obj);
623
0
  if (self) {
624
0
    UpdateWrapper(self, self, obj, old);
625
0
  }
626
0
627
0
  return 0;
628
0
}
629
630
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
631
#if defined(__clang__)
632
#pragma clang diagnostic push
633
#pragma clang diagnostic ignored "-Wmissing-braces"
634
#endif
635
static const JSFunctionSpec sMethods_specs[] = {
636
  JS_FNSPEC("entries", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&entries_methodinfo), 0, 0, nullptr),
637
  JS_FNSPEC("keys", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&keys_methodinfo), 0, 0, nullptr),
638
  JS_FNSPEC("values", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&values_methodinfo), 0, 0, nullptr),
639
  JS_FNSPEC("forEach", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&forEach_methodinfo), 1, 0, nullptr),
640
  JS_FNSPEC("has", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&has_methodinfo), 1, 0, nullptr),
641
  JS_FNSPEC("get", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&get_methodinfo), 1, 0, nullptr),
642
  JS_FS_END
643
};
644
#if defined(__clang__)
645
#pragma clang diagnostic pop
646
#endif
647
648
649
static const Prefable<const JSFunctionSpec> sMethods[] = {
650
  { nullptr, &sMethods_specs[0] },
651
  { nullptr, nullptr }
652
};
653
654
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
655
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
656
static_assert(6 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
657
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
658
659
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
660
#if defined(__clang__)
661
#pragma clang diagnostic push
662
#pragma clang diagnostic ignored "-Wmissing-braces"
663
#endif
664
static const JSPropertySpec sAttributes_specs[] = {
665
  { "size", 0, GenericGetter<NormalThisPolicy, ThrowExceptions>, &size_getterinfo, nullptr, nullptr },
666
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
667
};
668
#if defined(__clang__)
669
#pragma clang diagnostic pop
670
#endif
671
672
673
static const Prefable<const JSPropertySpec> sAttributes[] = {
674
  { nullptr, &sAttributes_specs[0] },
675
  { nullptr, nullptr }
676
};
677
678
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
679
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
680
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
681
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
682
683
684
static uint16_t sNativeProperties_sortedPropertyIndices[7];
685
static PropertyInfo sNativeProperties_propertyInfos[7];
686
687
static const NativePropertiesN<2> sNativeProperties = {
688
  false, 0,
689
  false, 0,
690
  true,  0 /* sMethods */,
691
  true,  1 /* sAttributes */,
692
  false, 0,
693
  false, 0,
694
  false, 0,
695
  0,
696
  7,
697
  sNativeProperties_sortedPropertyIndices,
698
  {
699
    { sMethods, &sNativeProperties_propertyInfos[0] },
700
    { sAttributes, &sNativeProperties_propertyInfos[6] }
701
  }
702
};
703
static_assert(7 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
704
    "We have a property info count that is oversized");
705
706
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
707
  {
708
    "Function",
709
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
710
    &sBoringInterfaceObjectClassClassOps,
711
    JS_NULL_CLASS_SPEC,
712
    JS_NULL_CLASS_EXT,
713
    &sInterfaceObjectClassObjectOps
714
  },
715
  eInterface,
716
  true,
717
  prototypes::id::MIDIOutputMap,
718
  PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth,
719
  sNativePropertyHooks,
720
  "function MIDIOutputMap() {\n    [native code]\n}",
721
  JS::GetRealmFunctionPrototype
722
};
723
724
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
725
  {
726
    "MIDIOutputMapPrototype",
727
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
728
    JS_NULL_CLASS_OPS,
729
    JS_NULL_CLASS_SPEC,
730
    JS_NULL_CLASS_EXT,
731
    JS_NULL_OBJECT_OPS
732
  },
733
  eInterfacePrototype,
734
  false,
735
  prototypes::id::MIDIOutputMap,
736
  PrototypeTraits<prototypes::id::MIDIOutputMap>::Depth,
737
  sNativePropertyHooks,
738
  "[object MIDIOutputMapPrototype]",
739
  JS::GetRealmObjectPrototype
740
};
741
742
bool
743
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj)
744
0
{
745
0
  static bool sPrefValue;
746
0
  static bool sPrefCacheSetUp = false;
747
0
  if (!sPrefCacheSetUp) {
748
0
    sPrefCacheSetUp = true;
749
0
    Preferences::AddBoolVarCache(&sPrefValue, "dom.webmidi.enabled");
750
0
  }
751
0
752
0
  return sPrefValue &&
753
0
         mozilla::dom::IsSecureContextOrObjectIsFromSecureContext(aCx, aObj);
754
0
}
755
756
static const js::ClassOps sClassOps = {
757
  _addProperty, /* addProperty */
758
  nullptr,               /* delProperty */
759
  nullptr,               /* enumerate */
760
  nullptr, /* newEnumerate */
761
  nullptr, /* resolve */
762
  nullptr, /* mayResolve */
763
  _finalize, /* finalize */
764
  nullptr, /* call */
765
  nullptr,               /* hasInstance */
766
  nullptr,               /* construct */
767
  nullptr, /* trace */
768
};
769
770
static const js::ClassExtension sClassExtension = {
771
  nullptr, /* weakmapKeyDelegateOp */
772
  _objectMoved /* objectMovedOp */
773
};
774
775
static const DOMJSClass sClass = {
776
  { "MIDIOutputMap",
777
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(2),
778
    &sClassOps,
779
    JS_NULL_CLASS_SPEC,
780
    &sClassExtension,
781
    JS_NULL_OBJECT_OPS
782
  },
783
  { prototypes::id::MIDIOutputMap, 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 },
784
  IsBaseOf<nsISupports, mozilla::dom::MIDIOutputMap >::value,
785
  sNativePropertyHooks,
786
  FindAssociatedGlobalForNative<mozilla::dom::MIDIOutputMap>::Get,
787
  GetProtoObjectHandle,
788
  GetCCParticipant<mozilla::dom::MIDIOutputMap>::Get()
789
};
790
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
791
              "Must have the right minimal number of reserved slots.");
792
static_assert(2 >= 2,
793
              "Must have enough reserved slots.");
794
795
const JSClass*
796
GetJSClass()
797
0
{
798
0
  return sClass.ToJSClass();
799
0
}
800
801
bool
802
Wrap(JSContext* aCx, mozilla::dom::MIDIOutputMap* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
803
0
{
804
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::MIDIOutputMap>::value,
805
0
                "Shouldn't have wrappercached things that are not refcounted.");
806
0
  MOZ_ASSERT(static_cast<mozilla::dom::MIDIOutputMap*>(aObject) ==
807
0
             reinterpret_cast<mozilla::dom::MIDIOutputMap*>(aObject),
808
0
             "Multiple inheritance for mozilla::dom::MIDIOutputMap is broken.");
809
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
810
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
811
0
  MOZ_ASSERT(!aCache->GetWrapper(),
812
0
             "You should probably not be using Wrap() directly; use "
813
0
             "GetOrCreateDOMReflector instead");
814
0
815
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
816
0
             "nsISupports must be on our primary inheritance chain");
817
0
818
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
819
0
  if (!global) {
820
0
    return false;
821
0
  }
822
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
823
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
824
0
825
0
  // That might have ended up wrapping us already, due to the wonders
826
0
  // of XBL.  Check for that, and bail out as needed.
827
0
  aReflector.set(aCache->GetWrapper());
828
0
  if (aReflector) {
829
#ifdef DEBUG
830
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
831
#endif // DEBUG
832
    return true;
833
0
  }
834
0
835
0
  JSAutoRealm ar(aCx, global);
836
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
837
0
  if (!canonicalProto) {
838
0
    return false;
839
0
  }
840
0
  JS::Rooted<JSObject*> proto(aCx);
841
0
  if (aGivenProto) {
842
0
    proto = aGivenProto;
843
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
844
0
    // coming in, we changed compartments to that of "parent" so may need
845
0
    // to wrap the proto here.
846
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
847
0
      if (!JS_WrapObject(aCx, &proto)) {
848
0
        return false;
849
0
      }
850
0
    }
851
0
  } else {
852
0
    proto = canonicalProto;
853
0
  }
854
0
855
0
  BindingJSObjectCreator<mozilla::dom::MIDIOutputMap> creator(aCx);
856
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
857
0
  if (!aReflector) {
858
0
    return false;
859
0
  }
860
0
861
0
  aCache->SetWrapper(aReflector);
862
0
  creator.InitializationSucceeded();
863
0
864
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
865
0
             aCache->GetWrapperPreserveColor() == aReflector);
866
0
  // If proto != canonicalProto, we have to preserve our wrapper;
867
0
  // otherwise we won't be able to properly recreate it later, since
868
0
  // we won't know what proto to use.  Note that we don't check
869
0
  // aGivenProto here, since it's entirely possible (and even
870
0
  // somewhat common) to have a non-null aGivenProto which is the
871
0
  // same as canonicalProto.
872
0
  if (proto != canonicalProto) {
873
0
    PreserveWrapper(aObject);
874
0
  }
875
0
876
0
  return true;
877
0
}
878
879
// This may allocate too many slots, because we only really need
880
// slots for our non-interface-typed members that we cache.  But
881
// allocating slots only for those would make the slot index
882
// computations much more complicated, so let's do this the simple
883
// way for now.
884
DEFINE_XRAY_EXPANDO_CLASS(static, sXrayExpandoObjectClass, 1);
885
886
const NativePropertyHooks sNativePropertyHooks[] = { {
887
  nullptr,
888
  nullptr,
889
  nullptr,
890
  { sNativeProperties.Upcast(), nullptr },
891
  prototypes::id::MIDIOutputMap,
892
  constructors::id::MIDIOutputMap,
893
  nullptr,
894
  &sXrayExpandoObjectClass
895
} };
896
897
void
898
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
899
0
{
900
0
  JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx));
901
0
  if (!parentProto) {
902
0
    return;
903
0
  }
904
0
905
0
  JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx));
906
0
  if (!constructorProto) {
907
0
    return;
908
0
  }
909
0
910
0
  static bool sIdsInited = false;
911
0
  if (!sIdsInited && NS_IsMainThread()) {
912
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
913
0
      return;
914
0
    }
915
0
    sIdsInited = true;
916
0
  }
917
0
918
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::MIDIOutputMap);
919
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::MIDIOutputMap);
920
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
921
0
                              &sPrototypeClass.mBase, protoCache,
922
0
                              nullptr,
923
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
924
0
                              interfaceCache,
925
0
                              sNativeProperties.Upcast(),
926
0
                              nullptr,
927
0
                              "MIDIOutputMap", aDefineOnGlobal,
928
0
                              nullptr,
929
0
                              false);
930
0
931
0
  // Set up aliases on the interface prototype object we just created.
932
0
  JS::Handle<JSObject*> proto = GetProtoObjectHandle(aCx);
933
0
  if (!proto) {
934
0
    *protoCache = nullptr;
935
0
    if (interfaceCache) {
936
0
      *interfaceCache = nullptr;
937
0
    }
938
0
    return;
939
0
  }
940
0
941
0
  JS::Rooted<JS::Value> aliasedVal(aCx);
942
0
943
0
  if (!JS_GetProperty(aCx, proto, "entries", &aliasedVal)) {
944
0
    *protoCache = nullptr;
945
0
    if (interfaceCache) {
946
0
      *interfaceCache = nullptr;
947
0
    }
948
0
    return;
949
0
  }
950
0
  JS::Rooted<jsid> iteratorId(aCx, SYMBOL_TO_JSID(JS::GetWellKnownSymbol(aCx, JS::SymbolCode::iterator)));
951
0
  if (!JS_DefinePropertyById(aCx, proto, iteratorId, aliasedVal, 0)) {
952
0
    *protoCache = nullptr;
953
0
    if (interfaceCache) {
954
0
      *interfaceCache = nullptr;
955
0
    }
956
0
    return;
957
0
  }
958
0
}
959
960
JSObject*
961
GetConstructorObject(JSContext* aCx)
962
0
{
963
0
  return GetConstructorObjectHandle(aCx);
964
0
}
965
966
} // namespace MIDIOutputMap_Binding
967
968
969
970
} // namespace dom
971
} // namespace mozilla