From d2eaa5a6b6b679cff70058107bc93a0b15ffa403 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 31 Jan 2014 14:51:41 -0800 Subject: [PATCH] Bug 959334 - Invoking js_InitTypedObjectModuleObject or js_InitSIMDClass in GlobalObject::initStandardClasses causes mochitest-plain to fail. r=Waldo --- js/src/builtin/TypeRepresentation.cpp | 11 +++++++---- js/src/vm/GlobalObject.cpp | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) 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; }