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–1307 unchanged (1307 lines)
1308 Node property = n.getLastChild();
1309 Node objNode = n.getFirstChild();
1310 JSType childType = getJSType(objNode);
1311
1312 if (childType.isDict()) {
1313 report(t, property, TypeValidator.ILLEGAL_PROPERTY_ACCESS, "'.'", "dict");
1314 } else if (n.getJSType() != null && parent.isAssign()) {
1315 return;
1316 } else if (validator.expectNotNullOrUndefined(t, n, childType,
1317 "No properties on this expression", getNativeType(OBJECT_TYPE))) {
1318 checkPropertyAccess(childType, property.getString(), t, n);
1319 }
1320 ensureTyped(t, n);
1321 }
1322
…lines 1323–1924 unchanged (602 lines)

After

…lines 1–1307 unchanged (1307 lines)
1308 Node property = n.getLastChild();
1309 Node objNode = n.getFirstChild();
1310 JSType childType = getJSType(objNode);
1311
1312 if (childType.isDict()) {
1313 report(t, property, TypeValidator.ILLEGAL_PROPERTY_ACCESS, "'.'", "dict");
1314 } else if (validator.expectNotNullOrUndefined(t, n, childType,
1315 "No properties on this expression", getNativeType(OBJECT_TYPE))) {
1316 checkPropertyAccess(childType, property.getString(), t, n);
1317 }
1318 ensureTyped(t, n);
1319 }
1320
…lines 1321–1922 unchanged (602 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 (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "CheckLevel"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "type"
. "."
identifier "ReverseAbstractInterpreter"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "EnumType"
; ";"
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 "TernaryValue"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * <p>Checks the types of JS expressions against any dec"...
class_declaration
modifiers
public "public"
class "class"
identifier "TypeCheck"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "Callback"
, ","
type_identifier "CompilerPass"
class_body
{ "{"
line_comment "//"
line_comment "// Internal errors"
line_comment "//"
field_declaration (+25 nodes collapsed)
line_comment "//"
line_comment "// User errors"
line_comment "//"
line_comment "// TODO(nicksantos): delete this"
field_declaration (+25 nodes collapsed)
line_comment "//"
line_comment "// User warnings"
line_comment "//"
field_declaration
modifiers
protected "protected"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "OVERRIDING_PROTOTYPE_WITH_NON_OBJECT"
= "="
string_literal
" "\""
string_fragment "overriding prototype with non-object"
" "\""
; ";"
line_comment "// TODO(user): make all the non private messages private onc"...
line_comment "// TypedScopeCreator has been merged with the type checker."
field_declaration (+39 nodes collapsed)
field_declaration (+39 nodes collapsed)
field_declaration (+25 nodes collapsed)
line_comment "// disabled by default. This one only makes sense if you're "...
line_comment "// well-typed externs."
field_declaration (+25 nodes collapsed)
field_declaration (+26 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+45 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+32 nodes collapsed)
field_declaration (+100 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "TypeValidator"
variable_declarator
identifier "validator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ReverseAbstractInterpreter"
variable_declarator
identifier "reverseInterpreter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Scope"
variable_declarator
identifier "topScope"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ScopeCreator"
variable_declarator
identifier "scopeCreator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "reportMissingOverride"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "reportUnknownTypes"
; ";"
line_comment "// This may be expensive, so don't emit these warnings if th"...
line_comment "// explicitly turned off."
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "reportMissingProperties"
= "="
true "true"
; ";"
field_declaration
modifiers
private "private"
type_identifier "InferJSDocInfo"
variable_declarator
identifier "inferJSDocInfo"
= "="
null_literal "null"
; ";"
line_comment "// These fields are used to calculate the percentage of expr"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "typedCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "nullCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "unknownCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "inExterns"
; ";"
line_comment "// A state boolean to see we are currently in @notypecheck s"...
line_comment "// code."
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "noTypeCheckSection"
= "="
decimal_integer_literal "0"
; ";"
constructor_declaration (+130 nodes collapsed)
constructor_declaration (+48 nodes collapsed)
constructor_declaration (+44 nodes collapsed)
block_comment "/** Turn on the missing property check. Returns this for eas"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Main entry point for this phase of processing. This"...
method_declaration (+122 nodes collapsed)
block_comment "/** Main entry point of this phase for testing code. */"
method_declaration (+154 nodes collapsed)
method_declaration (+100 nodes collapsed)
method_declaration (+146 nodes collapsed)
method_declaration (+54 nodes collapsed)
method_declaration (+182 nodes collapsed)
block_comment "/**\n * This is the meat of the type checking. It is basic"...
method_declaration (+2566 nodes collapsed)
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Counts the given node in the typed statistics.\n *"...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * Visits an assignment <code>lvalue = rvalue</code>. "...
method_declaration (+763 nodes collapsed)
method_declaration (+194 nodes collapsed)
block_comment "/**\n * Visits an object literal field definition <code>key"...
method_declaration (+372 nodes collapsed)
block_comment "/**\n * Returns true if any type in the chain has an implic"...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Given a constructor type and a property name, check"...
method_declaration (+846 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, find out "...
method_declaration (+185 nodes collapsed)
block_comment "/**\n * Visits an ASSIGN node for cases such as\n * <pre>\n"...
method_declaration (+201 nodes collapsed)
block_comment "/**\n * Visits a NAME node.\n *\n * @param t The node tra"...
method_declaration (+208 nodes collapsed)
block_comment "/**\n * Visits a GETPROP node.\n *\n * @param t The node "...
method_declaration
modifiers
private "private"
void_type "void"
identifier "visitGetProp"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
line_comment "// obj.prop or obj.method()"
line_comment "// Lots of types can appear on the left, a call to a void fu"...
line_comment "// never be on the left. getPropertyType will decide what is"...
line_comment "// and what isn't."
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "property"
= "="
method_invocation
identifier "n"
. "."
identifier "getLastChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "objNode"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "childType"
= "="
method_invocation
identifier "getJSType"
argument_list
( "("
identifier "objNode"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "childType"
. "."
identifier "isDict"
argument_list
( "("
) ")"
) ")"
block (+28 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
method_invocation
identifier "n"
. "."
identifier "getJSType"
argument_list
( "("
) ")"
!= "!="
null_literal "null"
&& "&&"
method_invocation
identifier "parent"
. "."
identifier "isAssign"
argument_list
( "("
) ")"
) ")"
block
{ "{"
return_statement
return "return"
; ";"
} "}"
else "else"
if_statement (+52 nodes collapsed)
expression_statement
method_invocation
identifier "ensureTyped"
argument_list
( "("
identifier "t"
, ","
identifier "n"
) ")"
; ";"
} "}"
block_comment "/**\n * Emit a warning if we can prove that a property cann"...
method_declaration (+203 nodes collapsed)
method_declaration (+107 nodes collapsed)
block_comment "/**\n * Determines whether this node is testing for the exi"...
method_declaration (+220 nodes collapsed)
block_comment "/**\n * Visits a GETELEM node.\n *\n * @param t The node "...
method_declaration (+66 nodes collapsed)
block_comment "/**\n * Visits a VAR node.\n *\n * @param t The node trav"...
method_declaration (+256 nodes collapsed)
block_comment "/**\n * Visits a NEW node.\n */"
method_declaration (+177 nodes collapsed)
block_comment "/**\n * Check whether there's any property conflict for for"...
method_declaration (+221 nodes collapsed)
block_comment "/**\n * Visits a {@link Token#FUNCTION} node.\n *\n * @pa"...
method_declaration (+683 nodes collapsed)
block_comment "/**\n * Visits a CALL node.\n *\n * @param t The node tra"...
method_declaration (+419 nodes collapsed)
block_comment "/**\n * Visits the parameters of a CALL or a NEW node.\n *"...
method_declaration (+357 nodes collapsed)
block_comment "/**\n * Visits a RETURN node.\n *\n * @param t The node t"...
method_declaration (+187 nodes collapsed)
block_comment "/**\n * This function unifies the type checking involved in"...
method_declaration (+485 nodes collapsed)
block_comment "/**\n * <p>Checks enum aliases.\n *\n * <p>We verify that"...
method_declaration (+154 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+60 nodes collapsed)
line_comment "// TODO(nicksantos): TypeCheck should never be attaching typ"...
line_comment "// All types should be attached by TypeInference. This is no"...
line_comment "// for legacy reasons. There are a number of places where Ty"...
line_comment "// doesn't attach a type, as a signal to TypeCheck that it n"...
line_comment "// that node's type."
block_comment "/**\n * Ensure that the given node has a type. If it does n"...
method_declaration (+35 nodes collapsed)
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Enforces type casts, and ensures the node is typed."...
method_declaration (+251 nodes collapsed)
block_comment "/**\n * Returns the percentage of nodes typed by the type c"...
method_declaration (+48 nodes collapsed)
method_declaration (+25 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 (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
import_declaration (+23 nodes collapsed)
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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "CheckLevel"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "type"
. "."
identifier "ReverseAbstractInterpreter"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "EnumType"
; ";"
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 "TernaryValue"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * <p>Checks the types of JS expressions against any dec"...
class_declaration
modifiers
public "public"
class "class"
identifier "TypeCheck"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "Callback"
, ","
type_identifier "CompilerPass"
class_body
{ "{"
line_comment "//"
line_comment "// Internal errors"
line_comment "//"
field_declaration (+25 nodes collapsed)
line_comment "//"
line_comment "// User errors"
line_comment "//"
line_comment "// TODO(nicksantos): delete this"
field_declaration (+25 nodes collapsed)
line_comment "//"
line_comment "// User warnings"
line_comment "//"
field_declaration
modifiers
protected "protected"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "OVERRIDING_PROTOTYPE_WITH_NON_OBJECT"
= "="
string_literal
" "\""
string_fragment "overriding prototype with non-object"
" "\""
; ";"
line_comment "// TODO(user): make all the non private messages private onc"...
line_comment "// TypedScopeCreator has been merged with the type checker."
field_declaration (+39 nodes collapsed)
field_declaration (+39 nodes collapsed)
field_declaration (+25 nodes collapsed)
line_comment "// disabled by default. This one only makes sense if you're "...
line_comment "// well-typed externs."
field_declaration (+25 nodes collapsed)
field_declaration (+26 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+45 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+32 nodes collapsed)
field_declaration (+100 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "TypeValidator"
variable_declarator
identifier "validator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ReverseAbstractInterpreter"
variable_declarator
identifier "reverseInterpreter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Scope"
variable_declarator
identifier "topScope"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ScopeCreator"
variable_declarator
identifier "scopeCreator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "reportMissingOverride"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CheckLevel"
variable_declarator
identifier "reportUnknownTypes"
; ";"
line_comment "// This may be expensive, so don't emit these warnings if th"...
line_comment "// explicitly turned off."
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "reportMissingProperties"
= "="
true "true"
; ";"
field_declaration
modifiers
private "private"
type_identifier "InferJSDocInfo"
variable_declarator
identifier "inferJSDocInfo"
= "="
null_literal "null"
; ";"
line_comment "// These fields are used to calculate the percentage of expr"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "typedCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "nullCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "unknownCount"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "inExterns"
; ";"
line_comment "// A state boolean to see we are currently in @notypecheck s"...
line_comment "// code."
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "noTypeCheckSection"
= "="
decimal_integer_literal "0"
; ";"
constructor_declaration (+130 nodes collapsed)
constructor_declaration (+48 nodes collapsed)
constructor_declaration (+44 nodes collapsed)
block_comment "/** Turn on the missing property check. Returns this for eas"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Main entry point for this phase of processing. This"...
method_declaration (+122 nodes collapsed)
block_comment "/** Main entry point of this phase for testing code. */"
method_declaration (+154 nodes collapsed)
method_declaration (+100 nodes collapsed)
method_declaration (+146 nodes collapsed)
method_declaration (+54 nodes collapsed)
method_declaration (+182 nodes collapsed)
block_comment "/**\n * This is the meat of the type checking. It is basic"...
method_declaration (+2566 nodes collapsed)
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Counts the given node in the typed statistics.\n *"...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * Visits an assignment <code>lvalue = rvalue</code>. "...
method_declaration (+763 nodes collapsed)
method_declaration (+194 nodes collapsed)
block_comment "/**\n * Visits an object literal field definition <code>key"...
method_declaration (+372 nodes collapsed)
block_comment "/**\n * Returns true if any type in the chain has an implic"...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Given a constructor type and a property name, check"...
method_declaration (+846 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, find out "...
method_declaration (+185 nodes collapsed)
block_comment "/**\n * Visits an ASSIGN node for cases such as\n * <pre>\n"...
method_declaration (+201 nodes collapsed)
block_comment "/**\n * Visits a NAME node.\n *\n * @param t The node tra"...
method_declaration (+208 nodes collapsed)
block_comment "/**\n * Visits a GETPROP node.\n *\n * @param t The node "...
method_declaration
modifiers
private "private"
void_type "void"
identifier "visitGetProp"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
line_comment "// obj.prop or obj.method()"
line_comment "// Lots of types can appear on the left, a call to a void fu"...
line_comment "// never be on the left. getPropertyType will decide what is"...
line_comment "// and what isn't."
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "property"
= "="
method_invocation
identifier "n"
. "."
identifier "getLastChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "objNode"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "childType"
= "="
method_invocation
identifier "getJSType"
argument_list
( "("
identifier "objNode"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "childType"
. "."
identifier "isDict"
argument_list
( "("
) ")"
) ")"
block (+28 nodes collapsed)
else "else"
if_statement (+52 nodes collapsed)
expression_statement
method_invocation
identifier "ensureTyped"
argument_list
( "("
identifier "t"
, ","
identifier "n"
) ")"
; ";"
} "}"
block_comment "/**\n * Emit a warning if we can prove that a property cann"...
method_declaration (+203 nodes collapsed)
method_declaration (+107 nodes collapsed)
block_comment "/**\n * Determines whether this node is testing for the exi"...
method_declaration (+220 nodes collapsed)
block_comment "/**\n * Visits a GETELEM node.\n *\n * @param t The node "...
method_declaration (+66 nodes collapsed)
block_comment "/**\n * Visits a VAR node.\n *\n * @param t The node trav"...
method_declaration (+256 nodes collapsed)
block_comment "/**\n * Visits a NEW node.\n */"
method_declaration (+177 nodes collapsed)
block_comment "/**\n * Check whether there's any property conflict for for"...
method_declaration (+221 nodes collapsed)
block_comment "/**\n * Visits a {@link Token#FUNCTION} node.\n *\n * @pa"...
method_declaration (+683 nodes collapsed)
block_comment "/**\n * Visits a CALL node.\n *\n * @param t The node tra"...
method_declaration (+419 nodes collapsed)
block_comment "/**\n * Visits the parameters of a CALL or a NEW node.\n *"...
method_declaration (+357 nodes collapsed)
block_comment "/**\n * Visits a RETURN node.\n *\n * @param t The node t"...
method_declaration (+187 nodes collapsed)
block_comment "/**\n * This function unifies the type checking involved in"...
method_declaration (+485 nodes collapsed)
block_comment "/**\n * <p>Checks enum aliases.\n *\n * <p>We verify that"...
method_declaration (+154 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+60 nodes collapsed)
line_comment "// TODO(nicksantos): TypeCheck should never be attaching typ"...
line_comment "// All types should be attached by TypeInference. This is no"...
line_comment "// for legacy reasons. There are a number of places where Ty"...
line_comment "// doesn't attach a type, as a signal to TypeCheck that it n"...
line_comment "// that node's type."
block_comment "/**\n * Ensure that the given node has a type. If it does n"...
method_declaration (+35 nodes collapsed)
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Enforces type casts, and ensures the node is typed."...
method_declaration (+251 nodes collapsed)
block_comment "/**\n * Returns the percentage of nodes typed by the type c"...
method_declaration (+48 nodes collapsed)
method_declaration (+25 nodes collapsed)
} "}"