Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–115 unchanged (115 lines)
116 }
117
118 @Override
119 public void process(Node externs, Node root) {
120 new NodeTraversal(
121 compiler, new NormalizeStatements(compiler, assertOnChange))
122 .traverse(root);
123 if (MAKE_LOCAL_NAMES_UNIQUE) {
124 MakeDeclaredNamesUnique renamer = new MakeDeclaredNamesUnique();
125 NodeTraversal t = new NodeTraversal(compiler, renamer);
126 t.traverseRoots(externs, root);
127 }
128 // It is important that removeDuplicateDeclarations runs after
…lines 129–780 unchanged (652 lines)

After

…lines 1–115 unchanged (115 lines)
116 }
117
118 @Override
119 public void process(Node externs, Node root) {
120 new NodeTraversal(
121 compiler, new NormalizeStatements(compiler, assertOnChange))
122 .traverseRoots(externs, root);
123 if (MAKE_LOCAL_NAMES_UNIQUE) {
124 MakeDeclaredNamesUnique renamer = new MakeDeclaredNamesUnique();
125 NodeTraversal t = new NodeTraversal(compiler, renamer);
126 t.traverseRoots(externs, root);
127 }
128 // It is important that removeDuplicateDeclarations runs after
…lines 129–780 unchanged (652 lines)

Before

program
block_comment "/*\n * Copyright 2008 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "AbstractCompiler"
. "."
identifier "LifeCycleStage"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "MakeDeclaredNamesUnique"
. "."
identifier "BoilerplateRenamer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "Callback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * The goal with this pass is to simplify the other pass"...
line_comment "// public for ReplaceDebugStringsTest"
class_declaration
class "class"
identifier "Normalize"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assertOnChange"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "CONVERT_WHILE_TO_FOR"
= "="
true "true"
; ";"
field_declaration
modifiers
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "MAKE_LOCAL_NAMES_UNIQUE"
= "="
true "true"
; ";"
field_declaration (+32 nodes collapsed)
constructor_declaration (+35 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+84 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "externs"
, ","
formal_parameter
type_identifier "Node"
identifier "root"
) ")"
block
{ "{"
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "NodeTraversal"
argument_list
( "("
identifier "compiler"
, ","
object_creation_expression
new "new"
type_identifier "NormalizeStatements"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
) ")"
. "."
identifier "traverse"
argument_list
( "("
identifier "root"
) ")"
; ";"
if_statement (+48 nodes collapsed)
line_comment "// It is important that removeDuplicateDeclarations runs aft"...
line_comment "// MakeDeclaredNamesUnique in order for catch block exceptio"...
line_comment "// handled properly. Specifically, catch block exception nam"...
line_comment "// only valid within the catch block, but our currect Scope "...
line_comment "// has no concept of this and includes it in the containing "...
line_comment "// (or global scope). MakeDeclaredNamesUnique makes the catc"...
line_comment "// names unique so that removeDuplicateDeclarations() will p"...
line_comment "// cases where a function scope variable conflict with a exc"...
line_comment "// function f() {"
line_comment "// try {throw 0;} catch(e) {e; /* catch scope 'e'*/}"
line_comment "// var e = 1; // f scope 'e'"
line_comment "// }"
line_comment "// otherwise 'var e = 1' would be rewritten as 'e = 1'."
line_comment "// TODO(johnlenz): Introduce a seperate scope for catch node"...
expression_statement
method_invocation
identifier "removeDuplicateDeclarations"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "PropagateConstantAnnotationsOverVars"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
. "."
identifier "process"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
if_statement (+36 nodes collapsed)
} "}"
block_comment "/**\n * Propagate constant annotations over the Var graph.\n"...
class_declaration (+394 nodes collapsed)
block_comment "/**\n * Walk the AST tree and verify that constant names ar"...
class_declaration (+590 nodes collapsed)
block_comment "/**\n * Simplify the AST:\n * - VAR declarations split, "...
class_declaration (+2176 nodes collapsed)
block_comment "/**\n * Remove duplicate VAR declarations.\n */"
method_declaration (+79 nodes collapsed)
block_comment "/**\n * ScopeCreator duplicate declaration handler.\n */"
class_declaration (+711 nodes collapsed)
block_comment "/**\n * A simple class that causes scope to be created.\n "...
class_declaration (+117 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2008 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "AbstractCompiler"
. "."
identifier "LifeCycleStage"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "MakeDeclaredNamesUnique"
. "."
identifier "BoilerplateRenamer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "Callback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * The goal with this pass is to simplify the other pass"...
line_comment "// public for ReplaceDebugStringsTest"
class_declaration
class "class"
identifier "Normalize"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assertOnChange"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "CONVERT_WHILE_TO_FOR"
= "="
true "true"
; ";"
field_declaration
modifiers
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "MAKE_LOCAL_NAMES_UNIQUE"
= "="
true "true"
; ";"
field_declaration (+32 nodes collapsed)
constructor_declaration (+35 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+84 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "externs"
, ","
formal_parameter
type_identifier "Node"
identifier "root"
) ")"
block
{ "{"
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "NodeTraversal"
argument_list
( "("
identifier "compiler"
, ","
object_creation_expression
new "new"
type_identifier "NormalizeStatements"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
) ")"
. "."
identifier "traverseRoots"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
if_statement (+48 nodes collapsed)
line_comment "// It is important that removeDuplicateDeclarations runs aft"...
line_comment "// MakeDeclaredNamesUnique in order for catch block exceptio"...
line_comment "// handled properly. Specifically, catch block exception nam"...
line_comment "// only valid within the catch block, but our currect Scope "...
line_comment "// has no concept of this and includes it in the containing "...
line_comment "// (or global scope). MakeDeclaredNamesUnique makes the catc"...
line_comment "// names unique so that removeDuplicateDeclarations() will p"...
line_comment "// cases where a function scope variable conflict with a exc"...
line_comment "// function f() {"
line_comment "// try {throw 0;} catch(e) {e; /* catch scope 'e'*/}"
line_comment "// var e = 1; // f scope 'e'"
line_comment "// }"
line_comment "// otherwise 'var e = 1' would be rewritten as 'e = 1'."
line_comment "// TODO(johnlenz): Introduce a seperate scope for catch node"...
expression_statement
method_invocation
identifier "removeDuplicateDeclarations"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "PropagateConstantAnnotationsOverVars"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
. "."
identifier "process"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
if_statement (+36 nodes collapsed)
} "}"
block_comment "/**\n * Propagate constant annotations over the Var graph.\n"...
class_declaration (+394 nodes collapsed)
block_comment "/**\n * Walk the AST tree and verify that constant names ar"...
class_declaration (+590 nodes collapsed)
block_comment "/**\n * Simplify the AST:\n * - VAR declarations split, "...
class_declaration (+2176 nodes collapsed)
block_comment "/**\n * Remove duplicate VAR declarations.\n */"
method_declaration (+79 nodes collapsed)
block_comment "/**\n * ScopeCreator duplicate declaration handler.\n */"
class_declaration (+711 nodes collapsed)
block_comment "/**\n * A simple class that causes scope to be created.\n "...
class_declaration (+117 nodes collapsed)
} "}"