diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-25 16:03:43 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-25 16:03:43 -0800 |
commit | b2fd961d06812c0bfcecc19521a040b8c0a06d24 (patch) | |
tree | a4f6b4da99ceae126b800a5c1b36e29daeb2a345 /src/analyzer.js | |
parent | 8e5c52df194f951187e897e5213849828e41b490 (diff) |
refactor and fix global variables, should they be needed for analysis
Diffstat (limited to 'src/analyzer.js')
-rw-r--r-- | src/analyzer.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 8f4ba95e..0cb89eda 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -217,6 +217,17 @@ function analyzer(data, givenTypes) { // Variable analyzer substrate.addActor('VariableAnalyzer', { processItem: function(item) { + // Globals + + var old = item.globalVariables; + item.globalVariables = {}; + old.forEach(function(variable) { + variable.impl = 'emulated'; // All global variables are emulated, for now. Consider optimizing later if useful + item.globalVariables[variable.ident] = variable; + }); + + // Function locals + item.functions.forEach(function(func) { dprint('vars', 'Analyzing variables in ' + func.ident); |