Bug 1232229 - Ensure generator object prototype is a singleton and tenured. r=jonco

This commit is contained in:
Jan de Mooij 2016-02-24 17:55:05 +01:00
parent f4e4ca445e
commit b3214af7bf

View File

@ -299,7 +299,9 @@ GlobalObject::initStarGenerators(JSContext* cx, Handle<GlobalObject*> global)
if (!iteratorProto)
return false;
RootedPlainObject genObjectProto(cx, NewObjectWithGivenProto<PlainObject>(cx, iteratorProto));
RootedObject genObjectProto(cx, global->createBlankPrototypeInheriting(cx,
&PlainObject::class_,
iteratorProto));
if (!genObjectProto)
return false;
if (!DefinePropertiesAndFunctions(cx, genObjectProto, nullptr, star_generator_methods))