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–756 unchanged (756 lines)
757 foundType = objType;
758 }
759 objType = objType.getImplicitPrototype();
760 }
761 // If the property does not exist on the referenced type but the original
762 // type is an object type, see if any subtype has the property.
763 // getGreatestSubtypeWithProperty does not guarantee that the property
764 // is defined on the returned type, it just indicates that it might be,
765 // so we have to double check.
766 return foundType;
767 }
768
769 @Override public JSType getInstanceFromPrototype(JSType type) {
770 if (type.isFunctionPrototypeType()) {
771 FunctionPrototypeType prototype = (FunctionPrototypeType) type;
772 FunctionType owner = prototype.getOwnerFunction();
…lines 773–985 unchanged (213 lines)

After

…lines 1–756 unchanged (756 lines)
757 foundType = objType;
758 }
759 objType = objType.getImplicitPrototype();
760 }
761 // If the property does not exist on the referenced type but the original
762 // type is an object type, see if any subtype has the property.
763 if (foundType == null) {
764 ObjectType maybeType = ObjectType.cast(
765 registry.getGreatestSubtypeWithProperty(type, field));
766 // getGreatestSubtypeWithProperty does not guarantee that the property
767 // is defined on the returned type, it just indicates that it might be,
768 // so we have to double check.
769 if (maybeType != null && maybeType.hasOwnProperty(field)) {
770 foundType = maybeType;
771 }
772 }
773 return foundType;
774 }
775
776 @Override public JSType getInstanceFromPrototype(JSType type) {
777 if (type.isFunctionPrototypeType()) {
778 FunctionPrototypeType prototype = (FunctionPrototypeType) type;
…lines 779–992 unchanged (214 lines)

Before

program
block_comment "/*\n * Copyright 2008 Google Inc.\n *\n * Licensed under the Ap"...
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 "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 "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 "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
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
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 "FunctionPrototypeType"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "UnionType"
; ";"
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
{ "{"
field_declaration (+27 nodes collapsed)
line_comment "// TODO(user): add a flag to allow enabling of this once app"...
line_comment "// using it."
field_declaration (+31 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "showInvalidationWarnings"
= "="
false "false"
; ";"
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"
; ";"
class_declaration (+836 nodes collapsed)
field_declaration (+22 nodes collapsed)
method_declaration (+42 nodes collapsed)
method_declaration (+54 nodes collapsed)
block_comment "/**\n * This constructor should only be called by one of th"...
constructor_declaration (+40 nodes collapsed)
method_declaration (+126 nodes collapsed)
block_comment "/**\n * Invalidates the given type, so that no properties o"...
method_declaration (+137 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 (+196 nodes collapsed)
block_comment "/**\n * Finds all properties defined in the externs file an"...
class_declaration (+212 nodes collapsed)
block_comment "/**\n * Traverses the tree, building a map from field names"...
class_declaration (+736 nodes collapsed)
block_comment "/** Renames all properties with references on more than one "...
method_declaration (+338 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
modifiers
private "private"
static "static"
class "class"
identifier "JSTypeSystem"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "TypeSystem"
type_arguments
< "<"
type_identifier "JSType"
> ">"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "JSType"
> ">"
variable_declarator
identifier "invalidatingTypes"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
constructor_declaration (+120 nodes collapsed)
method_declaration (+43 nodes collapsed)
method_declaration (+23 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+72 nodes collapsed)
method_declaration (+96 nodes collapsed)
method_declaration (+131 nodes collapsed)
method_declaration (+114 nodes collapsed)
method_declaration (+42 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+174 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "ObjectType"
identifier "getTypeWithProperty"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "field"
, ","
formal_parameter
type_identifier "JSType"
identifier "type"
) ")"
block
{ "{"
if_statement (+55 nodes collapsed)
line_comment "// Ignore the prototype itself at all times."
if_statement (+23 nodes collapsed)
line_comment "// We look up the prototype chain to find the highest place "...
line_comment "// this appears. This will make references to overriden pro"...
line_comment "// like references to the initial property, so they are rena"...
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "foundType"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "objType"
= "="
method_invocation
identifier "ObjectType"
. "."
identifier "cast"
argument_list
( "("
identifier "type"
) ")"
; ";"
while_statement (+58 nodes collapsed)
line_comment "// If the property does not exist on the referenced type but"...
line_comment "// type is an object type, see if any subtype has the proper"...
line_comment "// getGreatestSubtypeWithProperty does not guarantee that th"...
line_comment "// is defined on the returned type, it just indicates that i"...
line_comment "// so we have to double check."
return_statement
return "return"
identifier "foundType"
; ";"
} "}"
method_declaration (+107 nodes collapsed)
method_declaration (+281 nodes collapsed)
} "}"
block_comment "/** Implementation of TypeSystem using concrete types. */"
class_declaration (+1293 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2008 Google Inc.\n *\n * Licensed under the Ap"...
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 "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 "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 "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
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
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 "FunctionPrototypeType"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "UnionType"
; ";"
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
{ "{"
field_declaration (+27 nodes collapsed)
line_comment "// TODO(user): add a flag to allow enabling of this once app"...
line_comment "// using it."
field_declaration (+31 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "showInvalidationWarnings"
= "="
false "false"
; ";"
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"
; ";"
class_declaration (+836 nodes collapsed)
field_declaration (+22 nodes collapsed)
method_declaration (+42 nodes collapsed)
method_declaration (+54 nodes collapsed)
block_comment "/**\n * This constructor should only be called by one of th"...
constructor_declaration (+40 nodes collapsed)
method_declaration (+126 nodes collapsed)
block_comment "/**\n * Invalidates the given type, so that no properties o"...
method_declaration (+137 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 (+196 nodes collapsed)
block_comment "/**\n * Finds all properties defined in the externs file an"...
class_declaration (+212 nodes collapsed)
block_comment "/**\n * Traverses the tree, building a map from field names"...
class_declaration (+736 nodes collapsed)
block_comment "/** Renames all properties with references on more than one "...
method_declaration (+338 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
modifiers
private "private"
static "static"
class "class"
identifier "JSTypeSystem"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "TypeSystem"
type_arguments
< "<"
type_identifier "JSType"
> ">"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "JSType"
> ">"
variable_declarator
identifier "invalidatingTypes"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
constructor_declaration (+120 nodes collapsed)
method_declaration (+43 nodes collapsed)
method_declaration (+23 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+72 nodes collapsed)
method_declaration (+96 nodes collapsed)
method_declaration (+131 nodes collapsed)
method_declaration (+114 nodes collapsed)
method_declaration (+42 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+174 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "ObjectType"
identifier "getTypeWithProperty"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "field"
, ","
formal_parameter
type_identifier "JSType"
identifier "type"
) ")"
block
{ "{"
if_statement (+55 nodes collapsed)
line_comment "// Ignore the prototype itself at all times."
if_statement (+23 nodes collapsed)
line_comment "// We look up the prototype chain to find the highest place "...
line_comment "// this appears. This will make references to overriden pro"...
line_comment "// like references to the initial property, so they are rena"...
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "foundType"
= "="
null_literal "null"
; ";"
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "objType"
= "="
method_invocation
identifier "ObjectType"
. "."
identifier "cast"
argument_list
( "("
identifier "type"
) ")"
; ";"
while_statement (+58 nodes collapsed)
line_comment "// If the property does not exist on the referenced type but"...
line_comment "// type is an object type, see if any subtype has the proper"...
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "foundType"
== "=="
null_literal "null"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "maybeType"
= "="
method_invocation
identifier "ObjectType"
. "."
identifier "cast"
argument_list
( "("
method_invocation
identifier "registry"
. "."
identifier "getGreatestSubtypeWithProperty"
argument_list
( "("
identifier "type"
, ","
identifier "field"
) ")"
) ")"
; ";"
line_comment "// getGreatestSubtypeWithProperty does not guarantee that th"...
line_comment "// is defined on the returned type, it just indicates that i"...
line_comment "// so we have to double check."
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "maybeType"
!= "!="
null_literal "null"
&& "&&"
method_invocation
identifier "maybeType"
. "."
identifier "hasOwnProperty"
argument_list
( "("
identifier "field"
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "foundType"
= "="
identifier "maybeType"
; ";"
} "}"
} "}"
return_statement
return "return"
identifier "foundType"
; ";"
} "}"
method_declaration (+107 nodes collapsed)
method_declaration (+281 nodes collapsed)
} "}"
block_comment "/** Implementation of TypeSystem using concrete types. */"
class_declaration (+1293 nodes collapsed)
} "}"