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–488 unchanged (488 lines)
489 */
490 private void handleObjectLit(NodeTraversal t, Node n) {
491 for (Node child = n.getFirstChild();
492 child != null;
493 child = child.getNext()) {
494 // Maybe STRING, GET, SET
495
496 // We should never see a mix of numbers and strings.
497 String name = child.getString();
498 T type = typeSystem.getType(getScope(), n, name);
499
500 Property prop = getProperty(name);
501 if (!prop.scheduleRenaming(child,
…lines 502–1134 unchanged (633 lines)

After

…lines 1–488 unchanged (488 lines)
489 */
490 private void handleObjectLit(NodeTraversal t, Node n) {
491 for (Node child = n.getFirstChild();
492 child != null;
493 child = child.getNext()) {
494 // Maybe STRING, GET, SET
495 if (child.isQuotedString()) {
496 continue;
497 }
498
499 // We should never see a mix of numbers and strings.
500 String name = child.getString();
501 T type = typeSystem.getType(getScope(), n, name);
502
503 Property prop = getProperty(name);
…lines 504–1137 unchanged (634 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"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
. "."
identifier "checkState"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Joiner"
; ";"
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 "HashMultimap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "LinkedHashMultimap"
; ";"
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 "Multimap"
; ";"
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 "ConcreteType"
. "."
identifier "ConcreteFunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteInstanceType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteUnionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteUniqueType"
; ";"
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 "ScopedCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeValidator"
. "."
identifier "TypeMismatch"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "graph"
. "."
identifier "StandardUnionFind"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "graph"
. "."
identifier "UnionFind"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "FunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSTypeNative"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSTypeRegistry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "ObjectType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "StaticScope"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
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 "java"
. "."
identifier "util"
. "."
identifier "Stack"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "logging"
. "."
identifier "Logger"
; ";"
block_comment "/**\n * DisambiguateProperties renames properties to disambig"...
class_declaration
class "class"
identifier "DisambiguateProperties"
type_parameters
< "<"
type_parameter
type_identifier "T"
> ">"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
class_body
{ "{"
line_comment "// To prevent the logs from filling up, we cap the number of"...
line_comment "// that we tell the user to fix per-property."
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "MAX_INVALDIATION_WARNINGS_PER_PROPERTY"
= "="
decimal_integer_literal "10"
; ";"
field_declaration (+27 nodes collapsed)
class_declaration (+71 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "TypeSystem"
type_arguments
< "<"
type_identifier "T"
> ">"
variable_declarator
identifier "typeSystem"
; ";"
block_comment "/**\n * Map of a type to all the related errors that invali"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "Object"
, ","
type_identifier "JSError"
> ">"
variable_declarator
identifier "invalidationMap"
; ";"
block_comment "/**\n * In practice any large code base will have thousands"...
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "CheckLevel"
> ">"
variable_declarator
identifier "propertiesToErrorFor"
; ";"
class_declaration (+836 nodes collapsed)
field_declaration (+22 nodes collapsed)
method_declaration (+55 nodes collapsed)
method_declaration (+67 nodes collapsed)
block_comment "/**\n * This constructor should only be called by one of th"...
constructor_declaration (+108 nodes collapsed)
method_declaration (+143 nodes collapsed)
method_declaration (+62 nodes collapsed)
block_comment "/**\n * Invalidates the given type, so that no properties o"...
method_declaration (+210 nodes collapsed)
block_comment "/** Returns the property for the given name, creating it if "...
method_declaration (+61 nodes collapsed)
block_comment "/** Public for testing. */"
method_declaration (+29 nodes collapsed)
block_comment "/** Tracks the current type system scope while traversing. *"...
class_declaration (+205 nodes collapsed)
block_comment "/**\n * Finds all properties defined in the externs file an"...
class_declaration (+207 nodes collapsed)
block_comment "/**\n * Traverses the tree, building a map from field names"...
class_declaration
modifiers
private "private"
class "class"
identifier "FindRenameableProperties"
superclass
extends "extends"
type_identifier "AbstractScopingCallback"
class_body
{ "{"
method_declaration (+76 nodes collapsed)
block_comment "/**\n * Processes a GETPROP node.\n */"
method_declaration (+422 nodes collapsed)
block_comment "/**\n * Processes a OBJECTLIT node.\n */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "handleObjectLit"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
) ")"
block
{ "{"
for_statement
for "for"
( "("
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "child"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
binary_expression
identifier "child"
!= "!="
null_literal "null"
; ";"
assignment_expression
identifier "child"
= "="
method_invocation
identifier "child"
. "."
identifier "getNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
line_comment "// Maybe STRING, GET, SET"
line_comment "// We should never see a mix of numbers and strings."
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "child"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration (+22 nodes collapsed)
local_variable_declaration
type_identifier "Property"
variable_declarator
identifier "prop"
= "="
method_invocation
identifier "getProperty"
argument_list
( "("
identifier "name"
) ")"
; ";"
if_statement (+124 nodes collapsed)
} "}"
} "}"
method_declaration (+182 nodes collapsed)
block_comment "/**\n * Processes a property, adding it to the list of pr"...
method_declaration (+223 nodes collapsed)
} "}"
block_comment "/** Renames all properties with references on more than one "...
method_declaration (+454 nodes collapsed)
block_comment "/**\n * Chooses a name to use for renaming in each equivale"...
method_declaration (+242 nodes collapsed)
block_comment "/** Returns a map from field name to types for which it will"...
method_declaration (+194 nodes collapsed)
block_comment "/** Interface for providing the type information needed by t"...
interface_declaration (+197 nodes collapsed)
block_comment "/** Implementation of TypeSystem using JSTypes. */"
class_declaration (+1739 nodes collapsed)
block_comment "/** Implementation of TypeSystem using concrete types. */"
class_declaration (+1342 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"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
. "."
identifier "checkState"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Joiner"
; ";"
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 "HashMultimap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "LinkedHashMultimap"
; ";"
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 "Multimap"
; ";"
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 "ConcreteType"
. "."
identifier "ConcreteFunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteInstanceType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteUnionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "ConcreteType"
. "."
identifier "ConcreteUniqueType"
; ";"
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 "ScopedCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeValidator"
. "."
identifier "TypeMismatch"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "graph"
. "."
identifier "StandardUnionFind"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "graph"
. "."
identifier "UnionFind"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "FunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSTypeNative"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "JSTypeRegistry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "ObjectType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "StaticScope"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
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 "java"
. "."
identifier "util"
. "."
identifier "Stack"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "logging"
. "."
identifier "Logger"
; ";"
block_comment "/**\n * DisambiguateProperties renames properties to disambig"...
class_declaration
class "class"
identifier "DisambiguateProperties"
type_parameters
< "<"
type_parameter
type_identifier "T"
> ">"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
class_body
{ "{"
line_comment "// To prevent the logs from filling up, we cap the number of"...
line_comment "// that we tell the user to fix per-property."
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "MAX_INVALDIATION_WARNINGS_PER_PROPERTY"
= "="
decimal_integer_literal "10"
; ";"
field_declaration (+27 nodes collapsed)
class_declaration (+71 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "TypeSystem"
type_arguments
< "<"
type_identifier "T"
> ">"
variable_declarator
identifier "typeSystem"
; ";"
block_comment "/**\n * Map of a type to all the related errors that invali"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "Object"
, ","
type_identifier "JSError"
> ">"
variable_declarator
identifier "invalidationMap"
; ";"
block_comment "/**\n * In practice any large code base will have thousands"...
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "CheckLevel"
> ">"
variable_declarator
identifier "propertiesToErrorFor"
; ";"
class_declaration (+836 nodes collapsed)
field_declaration (+22 nodes collapsed)
method_declaration (+55 nodes collapsed)
method_declaration (+67 nodes collapsed)
block_comment "/**\n * This constructor should only be called by one of th"...
constructor_declaration (+108 nodes collapsed)
method_declaration (+143 nodes collapsed)
method_declaration (+62 nodes collapsed)
block_comment "/**\n * Invalidates the given type, so that no properties o"...
method_declaration (+210 nodes collapsed)
block_comment "/** Returns the property for the given name, creating it if "...
method_declaration (+61 nodes collapsed)
block_comment "/** Public for testing. */"
method_declaration (+29 nodes collapsed)
block_comment "/** Tracks the current type system scope while traversing. *"...
class_declaration (+205 nodes collapsed)
block_comment "/**\n * Finds all properties defined in the externs file an"...
class_declaration (+207 nodes collapsed)
block_comment "/**\n * Traverses the tree, building a map from field names"...
class_declaration
modifiers
private "private"
class "class"
identifier "FindRenameableProperties"
superclass
extends "extends"
type_identifier "AbstractScopingCallback"
class_body
{ "{"
method_declaration (+76 nodes collapsed)
block_comment "/**\n * Processes a GETPROP node.\n */"
method_declaration (+422 nodes collapsed)
block_comment "/**\n * Processes a OBJECTLIT node.\n */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "handleObjectLit"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
) ")"
block
{ "{"
for_statement
for "for"
( "("
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "child"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
binary_expression
identifier "child"
!= "!="
null_literal "null"
; ";"
assignment_expression
identifier "child"
= "="
method_invocation
identifier "child"
. "."
identifier "getNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
line_comment "// Maybe STRING, GET, SET"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "child"
. "."
identifier "isQuotedString"
argument_list
( "("
) ")"
) ")"
block
{ "{"
continue_statement
continue "continue"
; ";"
} "}"
line_comment "// We should never see a mix of numbers and strings."
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "child"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration (+22 nodes collapsed)
local_variable_declaration
type_identifier "Property"
variable_declarator
identifier "prop"
= "="
method_invocation
identifier "getProperty"
argument_list
( "("
identifier "name"
) ")"
; ";"
if_statement (+124 nodes collapsed)
} "}"
} "}"
method_declaration (+182 nodes collapsed)
block_comment "/**\n * Processes a property, adding it to the list of pr"...
method_declaration (+223 nodes collapsed)
} "}"
block_comment "/** Renames all properties with references on more than one "...
method_declaration (+454 nodes collapsed)
block_comment "/**\n * Chooses a name to use for renaming in each equivale"...
method_declaration (+242 nodes collapsed)
block_comment "/** Returns a map from field name to types for which it will"...
method_declaration (+194 nodes collapsed)
block_comment "/** Interface for providing the type information needed by t"...
interface_declaration (+197 nodes collapsed)
block_comment "/** Implementation of TypeSystem using JSTypes. */"
class_declaration (+1739 nodes collapsed)
block_comment "/** Implementation of TypeSystem using concrete types. */"
class_declaration (+1342 nodes collapsed)
} "}"