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–322 unchanged (322 lines)
323
324 // Requires should be removed before further processing.
325 // Some clients run closure pass multiple times, first with
326 // the checks for broken requires turned off. In these cases, we
327 // allow broken requires to be preserved by the first run to
328 // let them be caught in the subsequent run.
329 if (provided != null) {
330 parent.detachFromParent();
331 compiler.reportCodeChange();
332 }
333 }
334 }
335
…lines 336–1234 unchanged (899 lines)

After

…lines 1–322 unchanged (322 lines)
323
324 // Requires should be removed before further processing.
325 // Some clients run closure pass multiple times, first with
326 // the checks for broken requires turned off. In these cases, we
327 // allow broken requires to be preserved by the first run to
328 // let them be caught in the subsequent run.
329 if (provided != null || requiresLevel.isOn()) {
330 parent.detachFromParent();
331 compiler.reportCodeChange();
332 }
333 }
334 }
335
…lines 336–1234 unchanged (899 lines)

Before

program
block_comment "/*\n * Copyright 2006 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 "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "IR"
; ";"
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 "JSDocInfoBuilder"
; ";"
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 "List"
; ";"
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"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Replaces goog.provide calls, removes goog.require cal"...
class_declaration
class "class"
identifier "ProcessClosurePrimitives"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
super_interfaces
implements "implements"
type_list
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+35 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
block_comment "/** The root Closure namespace */"
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "GOOG"
= "="
string_literal
" "\""
string_fragment "goog"
" "\""
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSModuleGraph"
variable_declarator
identifier "moduleGraph"
; ";"
line_comment "// The goog.provides must be processed in a deterministic or"...
field_declaration (+23 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "requiresLevel"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PreprocessorSymbolTable"
variable_declarator
identifier "preprocessorSymbolTable"
; ";"
field_declaration (+21 nodes collapsed)
constructor_declaration (+91 nodes collapsed)
method_declaration
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "getExportedVariableNames"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "exportedVariables"
; ";"
} "}"
method_declaration (+204 nodes collapsed)
block_comment "/**\n * @param n\n */"
method_declaration (+152 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+828 nodes collapsed)
block_comment "/**\n * Handles a goog.require call.\n */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "processRequireCall"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "left"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "arg"
= "="
method_invocation
identifier "left"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "verifyLastArgumentIsString"
argument_list
( "("
identifier "t"
, ","
identifier "left"
, ","
identifier "arg"
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "ns"
= "="
method_invocation
identifier "arg"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "ProvidedName"
variable_declarator
identifier "provided"
= "="
method_invocation
identifier "providedNames"
. "."
identifier "get"
argument_list
( "("
identifier "ns"
) ")"
; ";"
if_statement (+156 nodes collapsed)
expression_statement
method_invocation
identifier "maybeAddToSymbolTable"
argument_list
( "("
identifier "left"
) ")"
; ";"
expression_statement
method_invocation
identifier "maybeAddStringNodeToSymbolTable"
argument_list
( "("
identifier "arg"
) ")"
; ";"
line_comment "// Requires should be removed before further processing."
line_comment "// Some clients run closure pass multiple times, first with"
line_comment "// the checks for broken requires turned off. In these cases"...
line_comment "// allow broken requires to be preserved by the first run to"
line_comment "// let them be caught in the subsequent run."
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "provided"
!= "!="
null_literal "null"
) ")"
block (+21 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * Handles a goog.provide call.\n */"
method_declaration (+239 nodes collapsed)
block_comment "/**\n * Handles a goog.define call.\n */"
method_declaration (+130 nodes collapsed)
block_comment "/**\n * Handles a typedef definition for a goog.provided na"...
method_declaration (+142 nodes collapsed)
block_comment "/**\n * Handles a candidate definition for a goog.provided "...
method_declaration (+214 nodes collapsed)
block_comment "/**\n * Processes the base class call.\n */"
method_declaration (+666 nodes collapsed)
block_comment "/**\n * Returns the qualified name node of the function who"...
method_declaration (+161 nodes collapsed)
block_comment "/** Reports an incorrect use of super-method calling. */"
method_declaration (+43 nodes collapsed)
block_comment "/**\n * Processes the output of processed-provide from a pr"...
method_declaration (+208 nodes collapsed)
block_comment "/**\n * Processes a call to goog.setCssNameMapping(). Eithe"...
method_declaration (+901 nodes collapsed)
block_comment "/**\n * Verifies that a provide method call has exactly one"...
method_declaration (+121 nodes collapsed)
block_comment "/**\n * Verifies that a provide method call has exactly one"...
method_declaration (+275 nodes collapsed)
block_comment "/**\n * Verifies that a method call has exactly one argumen"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+69 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+80 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Verifies that setCssNameMapping is called with the "...
method_declaration (+198 nodes collapsed)
block_comment "/**\n * Registers ProvidedNames for prefix namespaces if th"...
method_declaration (+152 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Information required to replace a goog.provide call"...
class_declaration (+1587 nodes collapsed)
block_comment "/**\n * @return Whether the node is namespace placeholder.\n"...
method_declaration (+155 nodes collapsed)
block_comment "/**\n * The string in {@code n} is a reference name. Create"...
method_declaration (+316 nodes collapsed)
block_comment "/**\n * Add the given qualified name node to the symbol tab"...
method_declaration (+36 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Information required to create a {@code MISSING_PRO"...
class_declaration (+75 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2006 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 "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "IR"
; ";"
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 "JSDocInfoBuilder"
; ";"
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 "List"
; ";"
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"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Replaces goog.provide calls, removes goog.require cal"...
class_declaration
class "class"
identifier "ProcessClosurePrimitives"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
super_interfaces
implements "implements"
type_list
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+28 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+35 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
block_comment "/** The root Closure namespace */"
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "GOOG"
= "="
string_literal
" "\""
string_fragment "goog"
" "\""
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSModuleGraph"
variable_declarator
identifier "moduleGraph"
; ";"
line_comment "// The goog.provides must be processed in a deterministic or"...
field_declaration (+23 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "requiresLevel"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PreprocessorSymbolTable"
variable_declarator
identifier "preprocessorSymbolTable"
; ";"
field_declaration (+21 nodes collapsed)
constructor_declaration (+91 nodes collapsed)
method_declaration
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "getExportedVariableNames"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "exportedVariables"
; ";"
} "}"
method_declaration (+204 nodes collapsed)
block_comment "/**\n * @param n\n */"
method_declaration (+152 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+828 nodes collapsed)
block_comment "/**\n * Handles a goog.require call.\n */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "processRequireCall"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "left"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "arg"
= "="
method_invocation
identifier "left"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "verifyLastArgumentIsString"
argument_list
( "("
identifier "t"
, ","
identifier "left"
, ","
identifier "arg"
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "ns"
= "="
method_invocation
identifier "arg"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "ProvidedName"
variable_declarator
identifier "provided"
= "="
method_invocation
identifier "providedNames"
. "."
identifier "get"
argument_list
( "("
identifier "ns"
) ")"
; ";"
if_statement (+156 nodes collapsed)
expression_statement
method_invocation
identifier "maybeAddToSymbolTable"
argument_list
( "("
identifier "left"
) ")"
; ";"
expression_statement
method_invocation
identifier "maybeAddStringNodeToSymbolTable"
argument_list
( "("
identifier "arg"
) ")"
; ";"
line_comment "// Requires should be removed before further processing."
line_comment "// Some clients run closure pass multiple times, first with"
line_comment "// the checks for broken requires turned off. In these cases"...
line_comment "// allow broken requires to be preserved by the first run to"
line_comment "// let them be caught in the subsequent run."
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "provided"
!= "!="
null_literal "null"
|| "||"
method_invocation
identifier "requiresLevel"
. "."
identifier "isOn"
argument_list
( "("
) ")"
) ")"
block (+21 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * Handles a goog.provide call.\n */"
method_declaration (+239 nodes collapsed)
block_comment "/**\n * Handles a goog.define call.\n */"
method_declaration (+130 nodes collapsed)
block_comment "/**\n * Handles a typedef definition for a goog.provided na"...
method_declaration (+142 nodes collapsed)
block_comment "/**\n * Handles a candidate definition for a goog.provided "...
method_declaration (+214 nodes collapsed)
block_comment "/**\n * Processes the base class call.\n */"
method_declaration (+666 nodes collapsed)
block_comment "/**\n * Returns the qualified name node of the function who"...
method_declaration (+161 nodes collapsed)
block_comment "/** Reports an incorrect use of super-method calling. */"
method_declaration (+43 nodes collapsed)
block_comment "/**\n * Processes the output of processed-provide from a pr"...
method_declaration (+208 nodes collapsed)
block_comment "/**\n * Processes a call to goog.setCssNameMapping(). Eithe"...
method_declaration (+901 nodes collapsed)
block_comment "/**\n * Verifies that a provide method call has exactly one"...
method_declaration (+121 nodes collapsed)
block_comment "/**\n * Verifies that a provide method call has exactly one"...
method_declaration (+275 nodes collapsed)
block_comment "/**\n * Verifies that a method call has exactly one argumen"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+69 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+80 nodes collapsed)
block_comment "/**\n * @return Whether the argument checked out okay\n */"
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Verifies that setCssNameMapping is called with the "...
method_declaration (+198 nodes collapsed)
block_comment "/**\n * Registers ProvidedNames for prefix namespaces if th"...
method_declaration (+152 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Information required to replace a goog.provide call"...
class_declaration (+1587 nodes collapsed)
block_comment "/**\n * @return Whether the node is namespace placeholder.\n"...
method_declaration (+155 nodes collapsed)
block_comment "/**\n * The string in {@code n} is a reference name. Create"...
method_declaration (+316 nodes collapsed)
block_comment "/**\n * Add the given qualified name node to the symbol tab"...
method_declaration (+36 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Information required to create a {@code MISSING_PRO"...
class_declaration (+75 nodes collapsed)
} "}"