This mapping has 2 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

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–570 unchanged (570 lines)
571 Node errorRoot = rValue == null ? lvalueNode : rValue;
572 boolean isFnLiteral =
573 rValue != null && rValue.getType() == Token.FUNCTION;
574 Node fnRoot = isFnLiteral ? rValue : null;
575 Node parametersNode = isFnLiteral ?
576 rValue.getFirstChild().getNext() : null;
577
578 if (functionType == null && info != null && info.hasType()) {
579 JSType type = info.getType().evaluate(scope, typeRegistry);
580
581 // Known to be not null since we have the FUNCTION token there.
582 type = type.restrictByNotNullOrUndefined();
583 if (type.isFunctionType()) {
…lines 584–610 unchanged (27 lines)
611 functionType =
612 new FunctionTypeBuilder(
613 name, compiler, errorRoot, sourceName, scope)
614 .setSourceNode(fnRoot)
615 .inferFromOverriddenFunction(propType, parametersNode)
616 .inferThisType(info, owner)
617 .buildAndRegister();
618 }
619 }
620 }
621 }
622 } // end if (functionType == null)
623
…lines 624–627 unchanged (4 lines)
628 .setSourceNode(fnRoot)
629 .inferTemplateTypeName(info)
630 .inferReturnType(info)
631 .inferInheritance(info)
632 .inferThisType(info, owner)
633 .inferParameterTypes(parametersNode, info)
634 .buildAndRegister();
635 }
636
637 // assigning the function type to the function node
638 if (rValue != null) {
639 setDeferredType(rValue, functionType);
640 }
…lines 641–1430 unchanged (790 lines)

After

…lines 1–570 unchanged (570 lines)
571 Node errorRoot = rValue == null ? lvalueNode : rValue;
572 boolean isFnLiteral =
573 rValue != null && rValue.getType() == Token.FUNCTION;
574 Node fnRoot = isFnLiteral ? rValue : null;
575 Node parametersNode = isFnLiteral ?
576 rValue.getFirstChild().getNext() : null;
577 Node fnBlock = isFnLiteral ? parametersNode.getNext() : null;
578
579 if (functionType == null && info != null && info.hasType()) {
580 JSType type = info.getType().evaluate(scope, typeRegistry);
581
582 // Known to be not null since we have the FUNCTION token there.
583 type = type.restrictByNotNullOrUndefined();
…lines 584–611 unchanged (28 lines)
612 functionType =
613 new FunctionTypeBuilder(
614 name, compiler, errorRoot, sourceName, scope)
615 .setSourceNode(fnRoot)
616 .inferFromOverriddenFunction(propType, parametersNode)
617 .inferThisType(info, owner)
618 .inferReturnStatements(fnBlock)
619 .buildAndRegister();
620 }
621 }
622 }
623 }
624 } // end if (functionType == null)
…lines 625–629 unchanged (5 lines)
630 .setSourceNode(fnRoot)
631 .inferTemplateTypeName(info)
632 .inferReturnType(info)
633 .inferInheritance(info)
634 .inferThisType(info, owner)
635 .inferParameterTypes(parametersNode, info)
636 .inferReturnStatements(fnBlock)
637 .buildAndRegister();
638 }
639
640 // assigning the function type to the function node
641 if (rValue != null) {
642 setDeferredType(rValue, functionType);
…lines 643–1433 unchanged (791 lines)

Before

program
block_comment "/*\n * Copyright 2004 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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "ENUM_DUP"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "ENUM_NOT_CONSTANT"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "MULTIPLE_VAR_DEF"
; ";"
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 (+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 (+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 "annotations"
. "."
identifier "VisibleForTesting"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "DelegateRelationship"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "ObjectLiteralCast"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "SubclassRelationship"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "SubclassType"
; ";"
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 "AbstractShallowCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "ErrorReporter"
; ";"
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 "FunctionParamBuilder"
; ";"
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
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Creates the symbol table of variables available in th"...
class_declaration
modifiers
final "final"
class "class"
identifier "TypedScopeCreator"
super_interfaces
implements "implements"
type_list
type_identifier "ScopeCreator"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 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 "ErrorReporter"
variable_declarator
identifier "typeParsingErrorReporter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "TypeValidator"
variable_declarator
identifier "validator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CodingConvention"
variable_declarator
identifier "codingConvention"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ObjectType"
> ">"
variable_declarator
identifier "delegateProxyPrototypes"
= "="
method_invocation
identifier "Lists"
. "."
identifier "newArrayList"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Defer attachment of types to nodes until all type n"...
class_declaration (+118 nodes collapsed)
constructor_declaration (+26 nodes collapsed)
constructor_declaration (+78 nodes collapsed)
block_comment "/**\n * Creates a scope with all types declared. Declares n"...
method_declaration (+281 nodes collapsed)
block_comment "/**\n * Create the outermost scope. This scope contains nat"...
method_declaration (+256 nodes collapsed)
method_declaration (+86 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+40 nodes collapsed)
class_declaration (+227 nodes collapsed)
block_comment "/**\n * Given a node, determines whether that node names a "...
method_declaration (+131 nodes collapsed)
class_declaration
modifiers
private "private"
abstract "abstract"
class "class"
identifier "AbstractScopeBuilder"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "Callback"
class_body
{ "{"
block_comment "/**\n * The scope that we're builidng.\n */"
field_declaration
modifiers
final "final"
type_identifier "Scope"
variable_declarator
identifier "scope"
; ";"
field_declaration (+21 nodes collapsed)
block_comment "/**\n * The current source file that we're in.\n */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "sourceName"
= "="
null_literal "null"
; ";"
constructor_declaration (+22 nodes collapsed)
method_declaration (+34 nodes collapsed)
method_declaration (+93 nodes collapsed)
method_declaration (+130 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the type specified in a JSDoc annotation "...
method_declaration (+39 nodes collapsed)
method_declaration (+396 nodes collapsed)
block_comment "/**\n * Defines variable(s) or modifies types based on th"...
method_declaration (+619 nodes collapsed)
block_comment "/**\n * Defines a variable based on the {@link Token#NAME"...
method_declaration (+349 nodes collapsed)
block_comment "/**\n * Gets the function type from the function node and"...
method_declaration
modifiers
private "private"
type_identifier "FunctionType"
identifier "getFunctionType"
formal_parameters (+22 nodes collapsed)
block
{ "{"
local_variable_declaration
type_identifier "FunctionType"
variable_declarator
identifier "functionType"
= "="
null_literal "null"
; ";"
line_comment "// Handle function aliases."
if_statement (+124 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "owner"
= "="
null_literal "null"
; ";"
if_statement (+23 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "errorRoot"
= "="
ternary_expression
binary_expression
identifier "rValue"
== "=="
null_literal "null"
? "?"
identifier "lvalueNode"
: ":"
identifier "rValue"
; ";"
local_variable_declaration (+25 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "fnRoot"
= "="
ternary_expression
identifier "isFnLiteral"
? "?"
identifier "rValue"
: ":"
null_literal "null"
; ";"
local_variable_declaration (+24 nodes collapsed)
if_statement (+97 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "functionType"
== "=="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "info"
== "=="
null_literal "null"
|| "||"
unary_expression
! "!"
method_invocation
identifier "FunctionTypeBuilder"
. "."
identifier "isFunctionTypeDeclaration"
argument_list
( "("
identifier "info"
) ")"
) ")"
block
{ "{"
line_comment "// We don't really have any type information in the annotati"...
line_comment "// Before we give up on this function, look at the object we"...
line_comment "// assigning it to. For example, if the function looks like "...
line_comment "// SubFoo.prototype.bar = function() { ... };"
line_comment "// We can use type information on Foo.prototype.bar and appl"...
line_comment "// to this function."
if_statement
if "if"
parenthesized_expression (+31 nodes collapsed)
block
{ "{"
local_variable_declaration (+26 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "var"
!= "!="
null_literal "null"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "ownerType"
= "="
method_invocation
identifier "ObjectType"
. "."
identifier "cast"
argument_list
( "("
method_invocation
identifier "var"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration
type_identifier "FunctionType"
variable_declarator
identifier "propType"
= "="
null_literal "null"
; ";"
if_statement (+44 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "propType"
!= "!="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "functionType"
= "="
method_invocation any 4:5
method_invocation any 4:5
method_invocation any 4:5
method_invocation any 4:5
object_creation_expression
new "new"
type_identifier "FunctionTypeBuilder"
argument_list
( "("
identifier "name"
, ","
identifier "compiler"
, ","
identifier "errorRoot"
, ","
identifier "sourceName"
, ","
identifier "scope"
) ")"
. "."
identifier "setSourceNode"
argument_list
( "("
identifier "fnRoot"
) ")"
. "."
identifier "inferFromOverriddenFunction"
argument_list
( "("
identifier "propType"
, ","
identifier "parametersNode"
) ")"
. "."
identifier "inferThisType"
argument_list
( "("
identifier "info"
, ","
identifier "owner"
) ")"
. "."
identifier "buildAndRegister"
argument_list
( "("
) ")"
; ";"
} "}"
} "}"
} "}"
} "}"
} "}"
line_comment "// end if (functionType == null)"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "functionType"
== "=="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "functionType"
= "="
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
object_creation_expression
new "new"
type_identifier "FunctionTypeBuilder"
argument_list
( "("
identifier "name"
, ","
identifier "compiler"
, ","
identifier "errorRoot"
, ","
identifier "sourceName"
, ","
identifier "scope"
) ")"
. "."
identifier "setSourceNode"
argument_list
( "("
identifier "fnRoot"
) ")"
. "."
identifier "inferTemplateTypeName"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferReturnType"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferInheritance"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferThisType"
argument_list
( "("
identifier "info"
, ","
identifier "owner"
) ")"
. "."
identifier "inferParameterTypes"
argument_list
( "("
identifier "parametersNode"
, ","
identifier "info"
) ")"
. "."
identifier "buildAndRegister"
argument_list
( "("
) ")"
; ";"
} "}"
line_comment "// assigning the function type to the function node"
if_statement (+22 nodes collapsed)
line_comment "// all done"
return_statement
return "return"
identifier "functionType"
; ";"
} "}"
block_comment "/**\n * Find the function that's being overridden on this"...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * Gets an enum type. If the definition is correct, "...
method_declaration (+423 nodes collapsed)
block_comment "/**\n * Defines a typed variable. The defining node will "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Defines a typed variable. The defining node will "...
method_declaration (+614 nodes collapsed)
} "}"
block_comment "/**\n * A shallow traversal of the global scope to build up"...
class_declaration (+3286 nodes collapsed)
line_comment "// end GlobalScopeBuilder"
block_comment "/**\n * A shallow traversal of a local scope to find all ar"...
class_declaration (+583 nodes collapsed)
line_comment "// end LocalScopeBuilder"
} "}"

After

program
block_comment "/*\n * Copyright 2004 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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "ENUM_DUP"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "ENUM_NOT_CONSTANT"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "TypeCheck"
. "."
identifier "MULTIPLE_VAR_DEF"
; ";"
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 (+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 (+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 "annotations"
. "."
identifier "VisibleForTesting"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "DelegateRelationship"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "ObjectLiteralCast"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "SubclassRelationship"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
. "."
identifier "SubclassType"
; ";"
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 "AbstractShallowCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "ErrorReporter"
; ";"
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 "FunctionParamBuilder"
; ";"
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
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Creates the symbol table of variables available in th"...
class_declaration
modifiers
final "final"
class "class"
identifier "TypedScopeCreator"
super_interfaces
implements "implements"
type_list
type_identifier "ScopeCreator"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 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 "ErrorReporter"
variable_declarator
identifier "typeParsingErrorReporter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "TypeValidator"
variable_declarator
identifier "validator"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CodingConvention"
variable_declarator
identifier "codingConvention"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ObjectType"
> ">"
variable_declarator
identifier "delegateProxyPrototypes"
= "="
method_invocation
identifier "Lists"
. "."
identifier "newArrayList"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Defer attachment of types to nodes until all type n"...
class_declaration (+118 nodes collapsed)
constructor_declaration (+26 nodes collapsed)
constructor_declaration (+78 nodes collapsed)
block_comment "/**\n * Creates a scope with all types declared. Declares n"...
method_declaration (+281 nodes collapsed)
block_comment "/**\n * Create the outermost scope. This scope contains nat"...
method_declaration (+256 nodes collapsed)
method_declaration (+86 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+40 nodes collapsed)
class_declaration (+227 nodes collapsed)
block_comment "/**\n * Given a node, determines whether that node names a "...
method_declaration (+131 nodes collapsed)
class_declaration
modifiers
private "private"
abstract "abstract"
class "class"
identifier "AbstractScopeBuilder"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "Callback"
class_body
{ "{"
block_comment "/**\n * The scope that we're builidng.\n */"
field_declaration
modifiers
final "final"
type_identifier "Scope"
variable_declarator
identifier "scope"
; ";"
field_declaration (+21 nodes collapsed)
block_comment "/**\n * The current source file that we're in.\n */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "sourceName"
= "="
null_literal "null"
; ";"
constructor_declaration (+22 nodes collapsed)
method_declaration (+34 nodes collapsed)
method_declaration (+93 nodes collapsed)
method_declaration (+130 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the type specified in a JSDoc annotation "...
method_declaration (+39 nodes collapsed)
method_declaration (+396 nodes collapsed)
block_comment "/**\n * Defines variable(s) or modifies types based on th"...
method_declaration (+619 nodes collapsed)
block_comment "/**\n * Defines a variable based on the {@link Token#NAME"...
method_declaration (+349 nodes collapsed)
block_comment "/**\n * Gets the function type from the function node and"...
method_declaration
modifiers
private "private"
type_identifier "FunctionType"
identifier "getFunctionType"
formal_parameters (+22 nodes collapsed)
block
{ "{"
local_variable_declaration
type_identifier "FunctionType"
variable_declarator
identifier "functionType"
= "="
null_literal "null"
; ";"
line_comment "// Handle function aliases."
if_statement (+124 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "owner"
= "="
null_literal "null"
; ";"
if_statement (+23 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "errorRoot"
= "="
ternary_expression
binary_expression
identifier "rValue"
== "=="
null_literal "null"
? "?"
identifier "lvalueNode"
: ":"
identifier "rValue"
; ";"
local_variable_declaration (+25 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "fnRoot"
= "="
ternary_expression
identifier "isFnLiteral"
? "?"
identifier "rValue"
: ":"
null_literal "null"
; ";"
local_variable_declaration (+24 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "fnBlock"
= "="
ternary_expression
identifier "isFnLiteral"
? "?"
method_invocation
identifier "parametersNode"
. "."
identifier "getNext"
argument_list
( "("
) ")"
: ":"
null_literal "null"
; ";"
if_statement (+97 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "functionType"
== "=="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "info"
== "=="
null_literal "null"
|| "||"
unary_expression
! "!"
method_invocation
identifier "FunctionTypeBuilder"
. "."
identifier "isFunctionTypeDeclaration"
argument_list
( "("
identifier "info"
) ")"
) ")"
block
{ "{"
line_comment "// We don't really have any type information in the annotati"...
line_comment "// Before we give up on this function, look at the object we"...
line_comment "// assigning it to. For example, if the function looks like "...
line_comment "// SubFoo.prototype.bar = function() { ... };"
line_comment "// We can use type information on Foo.prototype.bar and appl"...
line_comment "// to this function."
if_statement
if "if"
parenthesized_expression (+31 nodes collapsed)
block
{ "{"
local_variable_declaration (+26 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "var"
!= "!="
null_literal "null"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "ObjectType"
variable_declarator
identifier "ownerType"
= "="
method_invocation
identifier "ObjectType"
. "."
identifier "cast"
argument_list
( "("
method_invocation
identifier "var"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration
type_identifier "FunctionType"
variable_declarator
identifier "propType"
= "="
null_literal "null"
; ";"
if_statement (+44 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "propType"
!= "!="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "functionType"
= "="
method_invocation any 4:5
method_invocation any 4:5
method_invocation any 4:5
method_invocation any 4:5
method_invocation any 4:5
object_creation_expression
new "new"
type_identifier "FunctionTypeBuilder"
argument_list
( "("
identifier "name"
, ","
identifier "compiler"
, ","
identifier "errorRoot"
, ","
identifier "sourceName"
, ","
identifier "scope"
) ")"
. "."
identifier "setSourceNode"
argument_list
( "("
identifier "fnRoot"
) ")"
. "."
identifier "inferFromOverriddenFunction"
argument_list
( "("
identifier "propType"
, ","
identifier "parametersNode"
) ")"
. "."
identifier "inferThisType"
argument_list
( "("
identifier "info"
, ","
identifier "owner"
) ")"
. "."
identifier "inferReturnStatements"
argument_list
( "("
identifier "fnBlock"
) ")"
. "."
identifier "buildAndRegister"
argument_list
( "("
) ")"
; ";"
} "}"
} "}"
} "}"
} "}"
} "}"
line_comment "// end if (functionType == null)"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "functionType"
== "=="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "functionType"
= "="
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
method_invocation any 7:8
object_creation_expression
new "new"
type_identifier "FunctionTypeBuilder"
argument_list
( "("
identifier "name"
, ","
identifier "compiler"
, ","
identifier "errorRoot"
, ","
identifier "sourceName"
, ","
identifier "scope"
) ")"
. "."
identifier "setSourceNode"
argument_list
( "("
identifier "fnRoot"
) ")"
. "."
identifier "inferTemplateTypeName"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferReturnType"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferInheritance"
argument_list
( "("
identifier "info"
) ")"
. "."
identifier "inferThisType"
argument_list
( "("
identifier "info"
, ","
identifier "owner"
) ")"
. "."
identifier "inferParameterTypes"
argument_list
( "("
identifier "parametersNode"
, ","
identifier "info"
) ")"
. "."
identifier "inferReturnStatements"
argument_list
( "("
identifier "fnBlock"
) ")"
. "."
identifier "buildAndRegister"
argument_list
( "("
) ")"
; ";"
} "}"
line_comment "// assigning the function type to the function node"
if_statement (+22 nodes collapsed)
line_comment "// all done"
return_statement
return "return"
identifier "functionType"
; ";"
} "}"
block_comment "/**\n * Find the function that's being overridden on this"...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * Gets an enum type. If the definition is correct, "...
method_declaration (+423 nodes collapsed)
block_comment "/**\n * Defines a typed variable. The defining node will "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Defines a typed variable. The defining node will "...
method_declaration (+614 nodes collapsed)
} "}"
block_comment "/**\n * A shallow traversal of the global scope to build up"...
class_declaration (+3286 nodes collapsed)
line_comment "// end GlobalScopeBuilder"
block_comment "/**\n * A shallow traversal of a local scope to find all ar"...
class_declaration (+583 nodes collapsed)
line_comment "// end LocalScopeBuilder"
} "}"