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–164 unchanged (164 lines)
165 Preconditions.checkNotNull(qualifiedName);
166
167 JSType origType = node.getJSType();
168 origType = origType == null ? getNativeType(UNKNOWN_TYPE) : origType;
169 scope.inferQualifiedSlot(node, qualifiedName, origType, type);
170 break;
171
172 // "this" references aren't currently modeled in the CFG.
173
174 default:
175 throw new IllegalArgumentException("Node cannot be refined. \n" +
176 node.toStringTree());
177 }
178 }
179
…lines 180–708 unchanged (529 lines)

After

…lines 1–165 unchanged (165 lines)
166
167 JSType origType = node.getJSType();
168 origType = origType == null ? getNativeType(UNKNOWN_TYPE) : origType;
169 scope.inferQualifiedSlot(node, qualifiedName, origType, type);
170 break;
171
172 case Token.THIS:
173 // "this" references aren't currently modeled in the CFG.
174 break;
175
176 default:
177 throw new IllegalArgumentException("Node cannot be refined. \n" +
178 node.toStringTree());
179 }
180 }
…lines 181–710 unchanged (530 lines)

Before

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "type"
; ";"
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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
; ";"
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 "EnumElementType"
; ";"
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 "ParameterizedType"
; ";"
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 "TemplateType"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "Visitor"
; ";"
block_comment "/**\n * Chainable reverse abstract interpreter providing basi"...
class_declaration
modifiers
public "public"
abstract "abstract"
class "class"
identifier "ChainableReverseAbstractInterpreter"
super_interfaces
implements "implements"
type_list
type_identifier "ReverseAbstractInterpreter"
class_body
{ "{"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "CodingConvention"
variable_declarator
identifier "convention"
; ";"
field_declaration
modifiers
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ChainableReverseAbstractInterpreter"
variable_declarator
identifier "firstLink"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ChainableReverseAbstractInterpreter"
variable_declarator
identifier "nextLink"
; ";"
block_comment "/**\n * Constructs an interpreter, which is the only link i"...
constructor_declaration (+57 nodes collapsed)
block_comment "/**\n * Appends a link to {@code this}, returning the updat"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Gets the first link of this chain.\n */"
method_declaration
modifiers
public "public"
type_identifier "ChainableReverseAbstractInterpreter"
identifier "getFirst"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "firstLink"
; ";"
} "}"
block_comment "/**\n * Calculates the preciser scope starting with the fir"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Delegates the calculation of the preciser scope to "...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Returns the type of a node in the given scope if th"...
method_declaration (+265 nodes collapsed)
block_comment "/**\n * Declares a refined type in {@code scope} for the na"...
method_declaration
modifiers
protected "protected"
void_type "void"
identifier "declareNameInScope"
formal_parameters
( "("
formal_parameter
type_identifier "FlowScope"
identifier "scope"
, ","
formal_parameter
type_identifier "Node"
identifier "node"
, ","
formal_parameter
type_identifier "JSType"
identifier "type"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "node"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group (+29 nodes collapsed)
switch_block_statement_group (+82 nodes collapsed)
line_comment "// \"this\" references aren't currently modeled in the CFG."
switch_block_statement_group (+27 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * @see #getRestrictedWithoutUndefined(JSType)\n */"
field_declaration (+444 nodes collapsed)
block_comment "/**\n * @see #getRestrictedWithoutNull(JSType)\n */"
field_declaration (+444 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+354 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+161 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+212 nodes collapsed)
block_comment "/**\n * @see ChainableReverseAbstractInterpreter#getRestric"...
class_declaration (+513 nodes collapsed)
block_comment "/**\n * Returns a version of type where undefined is not pr"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Returns a version of type where null is not present"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Returns a version of {@code type} that is restricte"...
method_declaration (+97 nodes collapsed)
method_declaration (+23 nodes collapsed)
block_comment "/**\n * If we definitely know what a type is based on the t"...
method_declaration (+166 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "type"
; ";"
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 "javascript"
. "."
identifier "jscomp"
. "."
identifier "CodingConvention"
; ";"
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 "EnumElementType"
; ";"
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 "ParameterizedType"
; ";"
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 "TemplateType"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "Visitor"
; ";"
block_comment "/**\n * Chainable reverse abstract interpreter providing basi"...
class_declaration
modifiers
public "public"
abstract "abstract"
class "class"
identifier "ChainableReverseAbstractInterpreter"
super_interfaces
implements "implements"
type_list
type_identifier "ReverseAbstractInterpreter"
class_body
{ "{"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "CodingConvention"
variable_declarator
identifier "convention"
; ";"
field_declaration
modifiers
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ChainableReverseAbstractInterpreter"
variable_declarator
identifier "firstLink"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ChainableReverseAbstractInterpreter"
variable_declarator
identifier "nextLink"
; ";"
block_comment "/**\n * Constructs an interpreter, which is the only link i"...
constructor_declaration (+57 nodes collapsed)
block_comment "/**\n * Appends a link to {@code this}, returning the updat"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Gets the first link of this chain.\n */"
method_declaration
modifiers
public "public"
type_identifier "ChainableReverseAbstractInterpreter"
identifier "getFirst"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "firstLink"
; ";"
} "}"
block_comment "/**\n * Calculates the preciser scope starting with the fir"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Delegates the calculation of the preciser scope to "...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Returns the type of a node in the given scope if th"...
method_declaration (+265 nodes collapsed)
block_comment "/**\n * Declares a refined type in {@code scope} for the na"...
method_declaration
modifiers
protected "protected"
void_type "void"
identifier "declareNameInScope"
formal_parameters
( "("
formal_parameter
type_identifier "FlowScope"
identifier "scope"
, ","
formal_parameter
type_identifier "Node"
identifier "node"
, ","
formal_parameter
type_identifier "JSType"
identifier "type"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "node"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group (+29 nodes collapsed)
switch_block_statement_group (+82 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "THIS"
: ":"
line_comment "// \"this\" references aren't currently modeled in the CFG."
break_statement
break "break"
; ";"
switch_block_statement_group (+27 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * @see #getRestrictedWithoutUndefined(JSType)\n */"
field_declaration (+444 nodes collapsed)
block_comment "/**\n * @see #getRestrictedWithoutNull(JSType)\n */"
field_declaration (+444 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+354 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+161 nodes collapsed)
block_comment "/**\n * A class common to all visitors that need to restric"...
class_declaration (+212 nodes collapsed)
block_comment "/**\n * @see ChainableReverseAbstractInterpreter#getRestric"...
class_declaration (+513 nodes collapsed)
block_comment "/**\n * Returns a version of type where undefined is not pr"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Returns a version of type where null is not present"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Returns a version of {@code type} that is restricte"...
method_declaration (+97 nodes collapsed)
method_declaration (+23 nodes collapsed)
block_comment "/**\n * If we definitely know what a type is based on the t"...
method_declaration (+166 nodes collapsed)
} "}"