Bug 480856 - PurgeScopeChain should deep-bail. r=brendan.

This commit is contained in:
Jason Orendorff
2009-03-02 14:01:30 -06:00
parent 7680bad523
commit c42bca7a77

View File

@@ -3338,6 +3338,13 @@ PurgeScopeChain(JSContext *cx, JSObject *obj, jsid id)
if (!OBJ_IS_DELEGATE(cx, obj))
return;
/*
* All scope chains end in a global object, so this will change the global
* shape. jstracer.cpp assumes that the global shape never changes on
* trace, so we must deep-bail here.
*/
js_LeaveTrace(cx);
PurgeProtoChain(cx, OBJ_GET_PROTO(cx, obj), id);
while ((obj = OBJ_GET_PARENT(cx, obj)) != NULL) {
if (PurgeProtoChain(cx, obj, id))