diff --git a/js/src/builtin/TypeRepresentation.cpp b/js/src/builtin/TypeRepresentation.cpp index 4641dbb3c89..f098ccd9aae 100644 --- a/js/src/builtin/TypeRepresentation.cpp +++ b/js/src/builtin/TypeRepresentation.cpp @@ -386,14 +386,17 @@ TypeRepresentation::addToTableOrFree(JSContext *cx, return nullptr; } + RootedObject objectProto(cx, global->getOrCreateObjectPrototype(cx)); + if (!objectProto) + return nullptr; + // Now that the object is in the table, try to make the owner // object. If this succeeds, then the owner will remove from the // table once it is finalized. Otherwise, if this fails, we must // remove ourselves from the table ourselves and report an error. - RootedObject ownerObject(cx, - NewBuiltinClassInstance(cx, - &class_, - gc::GetGCObjectKind(&class_))); + RootedObject ownerObject(cx); + ownerObject = NewObjectWithGivenProto(cx, &class_, objectProto, + cx->global()); if (!ownerObject) { comp->typeReprs.remove(this); js_free(this); diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index defca523f7a..fa8572a390e 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -510,6 +510,9 @@ GlobalObject::initStandardClasses(JSContext *cx, Handle global) GlobalObject::initSetIteratorProto(cx, global) && #if EXPOSE_INTL_API js_InitIntlClass(cx, global) && +#endif +#ifdef ENABLE_BINARYDATA + js_InitTypedObjectModuleObject(cx, global) && #endif true; }