Skip to content
Browse files

Don't do anything risky to "object" scopes either

  • Loading branch information...
1 parent 2f6ff47 commit 12d303a0e0276de81440aa11c61380bb83624578 @simonlindholm simonlindholm committed
Showing with 11 additions and 13 deletions.
  1. +11 −13 extension/content/firebug/console/closureInspector.js
View
24 extension/content/firebug/console/closureInspector.js
@@ -65,19 +65,17 @@ var ClosureInspector =
if (ret !== undefined)
return ret;
- // With scopes are based on real objects - don't try anything fancy.
- // (Object properties probably don't get optimized away anyway, and
- // "with" tends to inhibit optimizations).
- if (scope.type === "with")
- return undefined;
-
- // The variable is either optimized away or actually set to undefined.
- // Optimized-away ones are apparently not settable, so try to detect
- // them by that (it seems rather safe).
- scope.setVariable(name, 0);
- if (scope.getVariable(name) === undefined)
- return OptimizedAway;
- scope.setVariable(name, undefined);
+ if (scope.type === "declarative")
+ {
+ // The variable is either optimized away or actually set to
+ // undefined. Optimized-away ones are apparently not settable,
+ // so try to detect them by that (it seems rather safe).
+ scope.setVariable(name, 0);
+ if (scope.getVariable(name) === undefined)
+ return OptimizedAway;
+ scope.setVariable(name, undefined);
+ }
+
return undefined;
}
catch (exc)

0 comments on commit 12d303a

Please sign in to comment.
Something went wrong with that request. Please try again.