This mapping has 1 multi-map group: 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–625 unchanged (625 lines)
626 scope = traverse(value, scope);
627 updateScopeForTypeChange(scope, n, n.getJSType() /* could be null */,
628 getJSType(value));
629 return scope;
630 } else {
631 StaticSlot<JSType> var = scope.getSlot(varName);
632 if (var != null &&
633 !(var.isTypeInferred() && unflowableVarNames.contains(varName))) {
634 // There are two situations where we don't want to use type information
635 // from the scope, even if we have it.
636
637 // 1) The var is escaped in a weird way, e.g.,
638 // function f() { var x = 3; function g() { x = null } (x); }
639
640 // 2) We're reading type information from another scope for an
641 // inferred variable.
642 // var t = null; function f() { (t); }
643
644 type = var.getType();
645 if (type == null) {
646 type = getNativeType(UNKNOWN_TYPE);
647 }
648 }
649 }
650 n.setJSType(type);
651 return scope;
652 }
653
654 /** Traverse each element of the array. */
…lines 655–1219 unchanged (565 lines)

After

…lines 1–625 unchanged (625 lines)
626 scope = traverse(value, scope);
627 updateScopeForTypeChange(scope, n, n.getJSType() /* could be null */,
628 getJSType(value));
629 return scope;
630 } else {
631 StaticSlot<JSType> var = scope.getSlot(varName);
632 if (var != null) {
633 // There are two situations where we don't want to use type information
634 // from the scope, even if we have it.
635
636 // 1) The var is escaped in a weird way, e.g.,
637 // function f() { var x = 3; function g() { x = null } (x); }
638 boolean isInferred = var.isTypeInferred();
639 boolean unflowable =
640 isInferred && unflowableVarNames.contains(varName);
641
642 // 2) We're reading type information from another scope for an
643 // inferred variable.
644 // var t = null; function f() { (t); }
645 boolean nonLocalInferredSlot =
646 isInferred &&
647 syntacticScope.getParent() != null &&
648 var == syntacticScope.getParent().getSlot(varName);
649
650 if (!unflowable && !nonLocalInferredSlot) {
651 type = var.getType();
652 if (type == null) {
653 type = getNativeType(UNKNOWN_TYPE);
654 }
655 }
656 }
657 }
658 n.setJSType(type);
659 return scope;
660 }
661
662 /** Traverse each element of the array. */
…lines 663–1227 unchanged (565 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 (+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 "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "HashMultimap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
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 "ControlFlowGraph"
. "."
identifier "Branch"
; ";"
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 (+22 nodes collapsed)
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 "BooleanLiteralSet"
; ";"
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 "StaticSlot"
; ";"
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 "Iterator"
; ";"
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 "Set"
; ";"
block_comment "/**\n * Type inference within a script node or a function bod"...
class_declaration
class "class"
identifier "TypeInference"
superclass
extends "extends"
generic_type
scoped_type_identifier
type_identifier "DataFlowAnalysis"
. "."
type_identifier "BranchedForwardDataFlowAnalysis"
type_arguments
< "<"
type_identifier "Node"
, ","
type_identifier "FlowScope"
> ">"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+31 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 "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ReverseAbstractInterpreter"
variable_declarator
identifier "reverseInterpreter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Scope"
variable_declarator
identifier "syntacticScope"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "FlowScope"
variable_declarator
identifier "functionScope"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "FlowScope"
variable_declarator
identifier "bottomScope"
; ";"
block_comment "/**\n * Local variables that do not belong to this scope, b"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * Vars that we should not map out type flow for.\n *"...
field_declaration (+21 nodes collapsed)
constructor_declaration (+53 nodes collapsed)
block_comment "/**\n * @param unflowableVars Do not do infer flow on the t"...
line_comment "// TODO(nicksantos): Create a builder for this class."
constructor_declaration (+369 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "FlowScope"
identifier "createInitialEstimateLattice"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "bottomScope"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "FlowScope"
identifier "createEntryLattice"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "functionScope"
; ";"
} "}"
block_comment "/**\n * @return Local variables assigned in this scope, but"...
method_declaration
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "Scope"
, ","
type_identifier "Var"
> ">"
identifier "getAssignedOuterLocalVars"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "assignedOuterLocalVars"
; ";"
} "}"
method_declaration (+68 nodes collapsed)
method_declaration (+663 nodes collapsed)
method_declaration (+1354 nodes collapsed)
block_comment "/**\n * Any value can be thrown, so it's really impossible "...
method_declaration (+78 nodes collapsed)
method_declaration (+110 nodes collapsed)
block_comment "/**\n * Updates the scope according to the result of a type"...
method_declaration (+364 nodes collapsed)
block_comment "/**\n * Defines a property if the property has not been def"...
method_declaration (+288 nodes collapsed)
block_comment "/**\n * Defines a declared property if it has not been defi"...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Declares a property on its owner, if necessary.\n "...
method_declaration (+203 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "FlowScope"
identifier "traverseName"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "FlowScope"
identifier "scope"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "varName"
= "="
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "value"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "type"
= "="
method_invocation
identifier "n"
. "."
identifier "getJSType"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "value"
!= "!="
null_literal "null"
) ")"
block (+46 nodes collapsed)
else "else"
block
{ "{"
local_variable_declaration
generic_type
type_identifier "StaticSlot"
type_arguments
< "<"
type_identifier "JSType"
> ">"
variable_declarator
identifier "var"
= "="
method_invocation
identifier "scope"
. "."
identifier "getSlot"
argument_list
( "("
identifier "varName"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression any 2:1
binary_expression any 2:1
identifier "var"
!= "!="
null_literal "null"
&& "&&"
unary_expression
! "!"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "var"
. "."
identifier "isTypeInferred"
argument_list
( "("
) ")"
&& "&&"
method_invocation
identifier "unflowableVarNames"
. "."
identifier "contains"
argument_list
( "("
identifier "varName"
) ")"
) ")"
) ")"
block
{ "{"
line_comment "// There are two situations where we don't want to use type "...
line_comment "// from the scope, even if we have it."
line_comment "// 1) The var is escaped in a weird way, e.g.,"
line_comment "// function f() { var x = 3; function g() { x = null } (x); "...
line_comment "// 2) We're reading type information from another scope for "...
line_comment "// inferred variable."
line_comment "// var t = null; function f() { (t); }"
expression_statement
assignment_expression
identifier "type"
= "="
method_invocation
identifier "var"
. "."
identifier "getType"
argument_list
( "("
) ")"
; ";"
if_statement (+23 nodes collapsed)
} "}"
} "}"
expression_statement
method_invocation
identifier "n"
. "."
identifier "setJSType"
argument_list
( "("
identifier "type"
) ")"
; ";"
return_statement
return "return"
identifier "scope"
; ";"
} "}"
block_comment "/** Traverse each element of the array. */"
method_declaration (+50 nodes collapsed)
method_declaration (+221 nodes collapsed)
method_declaration (+340 nodes collapsed)
method_declaration (+40 nodes collapsed)
method_declaration (+228 nodes collapsed)
method_declaration (+174 nodes collapsed)
block_comment "/**\n * For functions with function parameters, type infere"...
method_declaration (+187 nodes collapsed)
block_comment "/**\n * For functions with function(this: T, ...) and T as "...
method_declaration (+567 nodes collapsed)
method_declaration (+227 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+126 nodes collapsed)
method_declaration (+107 nodes collapsed)
block_comment "/**\n * If we access a property of a symbol, then that symb"...
method_declaration (+110 nodes collapsed)
method_declaration (+261 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+399 nodes collapsed)
method_declaration (+105 nodes collapsed)
block_comment "/**\n * Infers the boolean outcome pair that can be taken b"...
method_declaration (+78 nodes collapsed)
block_comment "/**\n * Infers the boolean literal set that can be taken by"...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * When traversing short-circuiting binary operations,"...
class_declaration (+234 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+79 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+60 nodes collapsed)
method_declaration (+25 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 (+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 "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "HashMultimap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
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 "ControlFlowGraph"
. "."
identifier "Branch"
; ";"
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 (+22 nodes collapsed)
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 "BooleanLiteralSet"
; ";"
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 "StaticSlot"
; ";"
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 "Iterator"
; ";"
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 "Set"
; ";"
block_comment "/**\n * Type inference within a script node or a function bod"...
class_declaration
class "class"
identifier "TypeInference"
superclass
extends "extends"
generic_type
scoped_type_identifier
type_identifier "DataFlowAnalysis"
. "."
type_identifier "BranchedForwardDataFlowAnalysis"
type_arguments
< "<"
type_identifier "Node"
, ","
type_identifier "FlowScope"
> ">"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+31 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 "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ReverseAbstractInterpreter"
variable_declarator
identifier "reverseInterpreter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Scope"
variable_declarator
identifier "syntacticScope"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "FlowScope"
variable_declarator
identifier "functionScope"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "FlowScope"
variable_declarator
identifier "bottomScope"
; ";"
block_comment "/**\n * Local variables that do not belong to this scope, b"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * Vars that we should not map out type flow for.\n *"...
field_declaration (+21 nodes collapsed)
constructor_declaration (+53 nodes collapsed)
block_comment "/**\n * @param unflowableVars Do not do infer flow on the t"...
line_comment "// TODO(nicksantos): Create a builder for this class."
constructor_declaration (+369 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "FlowScope"
identifier "createInitialEstimateLattice"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "bottomScope"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "FlowScope"
identifier "createEntryLattice"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "functionScope"
; ";"
} "}"
block_comment "/**\n * @return Local variables assigned in this scope, but"...
method_declaration
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "Scope"
, ","
type_identifier "Var"
> ">"
identifier "getAssignedOuterLocalVars"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "assignedOuterLocalVars"
; ";"
} "}"
method_declaration (+68 nodes collapsed)
method_declaration (+663 nodes collapsed)
method_declaration (+1354 nodes collapsed)
block_comment "/**\n * Any value can be thrown, so it's really impossible "...
method_declaration (+78 nodes collapsed)
method_declaration (+110 nodes collapsed)
block_comment "/**\n * Updates the scope according to the result of a type"...
method_declaration (+364 nodes collapsed)
block_comment "/**\n * Defines a property if the property has not been def"...
method_declaration (+288 nodes collapsed)
block_comment "/**\n * Defines a declared property if it has not been defi"...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Declares a property on its owner, if necessary.\n "...
method_declaration (+203 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "FlowScope"
identifier "traverseName"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "FlowScope"
identifier "scope"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "varName"
= "="
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "value"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "type"
= "="
method_invocation
identifier "n"
. "."
identifier "getJSType"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "value"
!= "!="
null_literal "null"
) ")"
block (+46 nodes collapsed)
else "else"
block
{ "{"
local_variable_declaration
generic_type
type_identifier "StaticSlot"
type_arguments
< "<"
type_identifier "JSType"
> ">"
variable_declarator
identifier "var"
= "="
method_invocation
identifier "scope"
. "."
identifier "getSlot"
argument_list
( "("
identifier "varName"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression any 2:1
identifier "var"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// There are two situations where we don't want to use type "...
line_comment "// from the scope, even if we have it."
line_comment "// 1) The var is escaped in a weird way, e.g.,"
line_comment "// function f() { var x = 3; function g() { x = null } (x); "...
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "isInferred"
= "="
method_invocation
identifier "var"
. "."
identifier "isTypeInferred"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "unflowable"
= "="
binary_expression
identifier "isInferred"
&& "&&"
method_invocation
identifier "unflowableVarNames"
. "."
identifier "contains"
argument_list
( "("
identifier "varName"
) ")"
; ";"
line_comment "// 2) We're reading type information from another scope for "...
line_comment "// inferred variable."
line_comment "// var t = null; function f() { (t); }"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "nonLocalInferredSlot"
= "="
binary_expression
binary_expression
identifier "isInferred"
&& "&&"
binary_expression
method_invocation
identifier "syntacticScope"
. "."
identifier "getParent"
argument_list
( "("
) ")"
!= "!="
null_literal "null"
&& "&&"
binary_expression
identifier "var"
== "=="
method_invocation
method_invocation
identifier "syntacticScope"
. "."
identifier "getParent"
argument_list
( "("
) ")"
. "."
identifier "getSlot"
argument_list
( "("
identifier "varName"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
unary_expression
! "!"
identifier "unflowable"
&& "&&"
unary_expression
! "!"
identifier "nonLocalInferredSlot"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "type"
= "="
method_invocation
identifier "var"
. "."
identifier "getType"
argument_list
( "("
) ")"
; ";"
if_statement (+23 nodes collapsed)
} "}"
} "}"
} "}"
expression_statement
method_invocation
identifier "n"
. "."
identifier "setJSType"
argument_list
( "("
identifier "type"
) ")"
; ";"
return_statement
return "return"
identifier "scope"
; ";"
} "}"
block_comment "/** Traverse each element of the array. */"
method_declaration (+50 nodes collapsed)
method_declaration (+221 nodes collapsed)
method_declaration (+340 nodes collapsed)
method_declaration (+40 nodes collapsed)
method_declaration (+228 nodes collapsed)
method_declaration (+174 nodes collapsed)
block_comment "/**\n * For functions with function parameters, type infere"...
method_declaration (+187 nodes collapsed)
block_comment "/**\n * For functions with function(this: T, ...) and T as "...
method_declaration (+567 nodes collapsed)
method_declaration (+227 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+126 nodes collapsed)
method_declaration (+107 nodes collapsed)
block_comment "/**\n * If we access a property of a symbol, then that symb"...
method_declaration (+110 nodes collapsed)
method_declaration (+261 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+399 nodes collapsed)
method_declaration (+105 nodes collapsed)
block_comment "/**\n * Infers the boolean outcome pair that can be taken b"...
method_declaration (+78 nodes collapsed)
block_comment "/**\n * Infers the boolean literal set that can be taken by"...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * When traversing short-circuiting binary operations,"...
class_declaration (+234 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+79 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+60 nodes collapsed)
method_declaration (+25 nodes collapsed)
} "}"