Skip to content

Commit

Permalink
Don't do anything risky to "object" scopes either
Browse files Browse the repository at this point in the history
  • Loading branch information
simonlindholm committed Jan 4, 2013
1 parent 2f6ff47 commit 12d303a
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions extension/content/firebug/console/closureInspector.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,19 +65,17 @@ var ClosureInspector =
if (ret !== undefined) if (ret !== undefined)
return ret; return ret;


// With scopes are based on real objects - don't try anything fancy. if (scope.type === "declarative")
// (Object properties probably don't get optimized away anyway, and {
// "with" tends to inhibit optimizations). // The variable is either optimized away or actually set to
if (scope.type === "with") // undefined. Optimized-away ones are apparently not settable,
return undefined; // so try to detect them by that (it seems rather safe).

scope.setVariable(name, 0);
// The variable is either optimized away or actually set to undefined. if (scope.getVariable(name) === undefined)
// Optimized-away ones are apparently not settable, so try to detect return OptimizedAway;
// them by that (it seems rather safe). scope.setVariable(name, undefined);
scope.setVariable(name, 0); }
if (scope.getVariable(name) === undefined)
return OptimizedAway;
scope.setVariable(name, undefined);
return undefined; return undefined;
} }
catch (exc) catch (exc)
Expand Down

0 comments on commit 12d303a

Please sign in to comment.