Backout 0d642e4e08cf (bug 707049); requested by evilpie.

This commit is contained in:
Ms2ger
2011-12-31 15:13:01 +01:00
parent 457f0dcf21
commit 4928f1e7af
47 changed files with 594 additions and 1507 deletions

View File

@@ -216,15 +216,10 @@ static bool
EnumerateNativeProperties(JSContext *cx, JSObject *obj, JSObject *pobj, uintN flags, IdSet &ht,
AutoIdVector *props)
{
RootObject objRoot(cx, &obj);
RootObject pobjRoot(cx, &pobj);
size_t initialLength = props->length();
/* Collect all unique properties from this object's scope. */
Shape::Range r = pobj->lastProperty()->all();
Shape::Range::Root root(cx, &r);
for (; !r.empty(); r.popFront()) {
for (Shape::Range r = pobj->lastProperty()->all(); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
if (!JSID_IS_DEFAULT_XML_NAMESPACE(shape.propid()) &&
@@ -299,10 +294,7 @@ Snapshot(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector *props)
if (!ht.init(32))
return NULL;
RootObject objRoot(cx, &obj);
RootedVarObject pobj(cx);
pobj = obj;
JSObject *pobj = obj;
do {
Class *clasp = pobj->getClass();
if (pobj->isNative() &&
@@ -481,14 +473,12 @@ static inline JSObject *
NewIteratorObject(JSContext *cx, uintN flags)
{
if (flags & JSITER_ENUMERATE) {
RootedVarTypeObject type(cx);
type = cx->compartment->getEmptyType(cx);
types::TypeObject *type = cx->compartment->getEmptyType(cx);
if (!type)
return NULL;
RootedVarShape emptyEnumeratorShape(cx);
emptyEnumeratorShape = EmptyShape::getInitialShape(cx, &IteratorClass, NULL, NULL,
ITERATOR_FINALIZE_KIND);
Shape *emptyEnumeratorShape = EmptyShape::getInitialShape(cx, &IteratorClass, NULL, NULL,
ITERATOR_FINALIZE_KIND);
if (!emptyEnumeratorShape)
return NULL;
@@ -938,16 +928,16 @@ SuppressDeletedPropertyHelper(JSContext *cx, JSObject *obj, IdPredicate predicat
* became visible as a result of this deletion.
*/
if (obj->getProto()) {
JSObject *proto = obj->getProto();
JSObject *obj2;
AutoObjectRooter proto(cx, obj->getProto());
AutoObjectRooter obj2(cx);
JSProperty *prop;
if (!proto->lookupGeneric(cx, *idp, &obj2, &prop))
if (!proto.object()->lookupGeneric(cx, *idp, obj2.addr(), &prop))
return false;
if (prop) {
uintN attrs;
if (obj2->isNative())
if (obj2.object()->isNative())
attrs = ((Shape *) prop)->attributes();
else if (!obj2->getGenericAttributes(cx, *idp, &attrs))
else if (!obj2.object()->getGenericAttributes(cx, *idp, &attrs))
return false;
if (attrs & JSPROP_ENUMERATE)