Fix 'if' in DebugObject_trace: the scope of a declaration includes its initializer.
authorJim Blandy <jimb@mozilla.com>
Fri, 24 Jun 2011 14:02:23 -0700
changeset 74482 7a78b176e018fee1a5899a5902b2c266925dd488
parent 74481 2d2654fc31b2eff7e5ac6ac2573969567c6c6c40
child 74483 0a728f8555057f892902873ee4be96abbcc58023
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone7.0a1
Fix 'if' in DebugObject_trace: the scope of a declaration includes its initializer.
js/src/jsdbg.cpp
--- a/js/src/jsdbg.cpp
+++ b/js/src/jsdbg.cpp
@@ -1708,18 +1708,18 @@ static JSFunctionSpec DebugFrame_methods
 
 
 // === Debug.Object
 
 static void
 DebugObject_trace(JSTracer *trc, JSObject *obj)
 {
     if (!trc->context->runtime->gcCurrentCompartment) {
-        if (JSObject *obj = (JSObject *) obj->getPrivate())
-            MarkObject(trc, *obj, "Debug.Object referent");
+        if (JSObject *referent = (JSObject *) obj->getPrivate())
+            MarkObject(trc, *referent, "Debug.Object referent");
     }
 }
 
 Class DebugObject_class = {
     "Object", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGOBJECT_COUNT),
     PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
     EnumerateStub, ResolveStub, ConvertStub, NULL,
     NULL,                 /* reserved0   */