class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CodingConvention"
variable_declarator
identifier "codingConvention"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "removeGlobals"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "preserveFunctionExpressionNames"
; ";"
block_comment "/**\n * Keep track of variables that we've referenced.\n *"...
field_declaration (+21 nodes collapsed)
block_comment "/**\n * Keep track of variables that might be unreferenced."...
field_declaration (+21 nodes collapsed)
block_comment "/**\n * Keep track of scopes that we've traversed.\n */"
field_declaration (+21 nodes collapsed)
block_comment "/**\n * Keep track of assigns to variables that we haven't "...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * The assigns, indexed by the NAME node that they ass"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * Subclass name -> class-defining call EXPR node. (li"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * Keep track of continuations that are finished iff t"...
field_declaration (+23 nodes collapsed)
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "modifyCallSites"
; ";"
field_declaration
modifiers
private "private"
type_identifier "CallSiteOptimizer"
variable_declarator
identifier "callSiteOptimizer"
; ";"
constructor_declaration (+74 nodes collapsed)
block_comment "/**\n * Traverses the root, removing all unused variables. "...
method_declaration (+96 nodes collapsed)
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Traverses a node recursively. Call this once per pa"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * Traverses everything in the current scope and marks"...
method_declaration (+847 nodes collapsed)
method_declaration (+91 nodes collapsed)
block_comment "/**\n * Traverses a function, which creates a new scope in "...
method_declaration (+148 nodes collapsed)
block_comment "/**\n * For each variable in this scope that we haven't fou"...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Removes unreferenced arguments from a function decl"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "removeUnreferencedFunctionArgs"
formal_parameters
( "("
formal_parameter
type_identifier "Scope"
identifier "fnScope"
) ")"
block
{ "{"
line_comment "// Notice that removing unreferenced function args breaks"
line_comment "// Function.prototype.length. In advanced mode, we don't rea"...
line_comment "// about this: we consider \"length\" the equivalent of reflec"...
line_comment "// the function's lexical source."
line_comment "//"
line_comment "// Rather than create a new option for this, we assume that "...
line_comment "// is removing globals, then it's OK to remove unused functi"...
line_comment "//"
line_comment "// See http://code.google.com/p/closure-compiler/issues/deta"...
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "function"
= "="
method_invocation
identifier "fnScope"
. "."
identifier "getRootNode"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
method_invocation
identifier "function"
. "."
identifier "isFunction"
argument_list
( "("
) ")"
) ")"
; ";"
if_statement (+26 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "argList"
= "="
method_invocation
identifier "getFunctionArgList"
argument_list
( "("
identifier "function"
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "modifyCallers"
= "="
binary_expression
identifier "modifyCallSites"
&& "&&"
method_invocation
identifier "callSiteOptimizer"
. "."
identifier "canModifyCallers"
argument_list
( "("
identifier "function"
) ")"
; ";"
if_statement (+121 nodes collapsed)
} "}"
block_comment "/**\n * @return the LP node containing the function paramet"...
method_declaration (+31 nodes collapsed)
class_declaration (+1650 nodes collapsed)
block_comment "/**\n * Look at all the property assigns to all variables.\n"...
method_declaration (+367 nodes collapsed)
block_comment "/**\n * Remove all assigns to a var.\n */"
method_declaration (+50 nodes collapsed)
block_comment "/**\n * Marks a var as referenced, recursing into any value"...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Removes any vars in the scope that were not referen"...
method_declaration (+523 nodes collapsed)
block_comment "/**\n * Our progress in a traversal can be expressed comple"...
class_declaration (+143 nodes collapsed)
class_declaration (+580 nodes collapsed)
} "}"