private static LiveVariablesAnalysis computeLiveness(String src) { Compiler compiler = new Compiler(); CompilerOptions options = new CompilerOptions(); options.setCodingConvention(new GoogleCodingConvention()); compiler.initOptions(options); src = "function _FUNCTION(param1, param2){" + src + "}"; Node n = compiler.parseTestCode(src).removeFirstChild(); Node script = new Node(Token.SCRIPT, n); assertEquals(0, compiler.getErrorCount()); Scope scope = new SyntacticScopeCreator(compiler).createScope(n, new Scope(script, compiler)); ControlFlowAnalysis cfa = new ControlFlowAnalysis(compiler, false, true); cfa.process(null, n); ControlFlowGraph<Node> cfg = cfa.getCfg(); LiveVariablesAnalysis analysis = new LiveVariablesAnalysis(cfg, scope, compiler); analysis.analyze(); return analysis; }