Bug 959334 - Invoking js_InitTypedObjectModuleObject or js_InitSIMDClass in GlobalObject::initStandardClasses causes mochitest-plain to fail. r=Waldo

This commit is contained in:
Niko Matsakis 2014-01-31 14:51:41 -08:00
parent 015263fe87
commit d2eaa5a6b6
2 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -510,6 +510,9 @@ GlobalObject::initStandardClasses(JSContext *cx, Handle<GlobalObject*> global)
GlobalObject::initSetIteratorProto(cx, global) &&
#if EXPOSE_INTL_API
js_InitIntlClass(cx, global) &&
#endif
#ifdef ENABLE_BINARYDATA
js_InitTypedObjectModuleObject(cx, global) &&
#endif
true;
}