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–409 unchanged (409 lines)
410 ObjectType.cast(dereference(getprop.getFirstChild().getJSType()));
411 String propertyName = getprop.getLastChild().getString();
412
413 if (objectType != null) {
414 // Is this a normal property access, or are we trying to override
415 // an existing property?
416 boolean isOverride = t.inGlobalScope() &&
417 parent.getType() == Token.ASSIGN &&
418 parent.getFirstChild() == getprop;
419
420 // Find the lowest property defined on a class with visibility
421 // information.
422 if (isOverride) {
…lines 423–643 unchanged (221 lines)

After

…lines 1–409 unchanged (409 lines)
410 ObjectType.cast(dereference(getprop.getFirstChild().getJSType()));
411 String propertyName = getprop.getLastChild().getString();
412
413 if (objectType != null) {
414 // Is this a normal property access, or are we trying to override
415 // an existing property?
416 boolean isOverride = parent.getJSDocInfo() != null &&
417 parent.getType() == Token.ASSIGN &&
418 parent.getFirstChild() == getprop;
419
420 // Find the lowest property defined on a class with visibility
421 // information.
422 if (isOverride) {
…lines 423–643 unchanged (221 lines)

Before

program
block_comment "/*\n * Copyright 2008 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
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "ScopedCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
. "."
identifier "Visibility"
; ";"
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 "FunctionPrototypeType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "FunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "ObjectType"
; ";"
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
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 "HashMultimap"
; ";"
block_comment "/**\n * A compiler pass that checks that the programmer has o"...
class_declaration
class "class"
identifier "CheckAccessControls"
super_interfaces
implements "implements"
type_list
type_identifier "ScopedCallback"
, ","
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
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 "TypeValidator"
variable_declarator
identifier "validator"
; ";"
line_comment "// State about the current traversal."
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "deprecatedDepth"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "methodDepth"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSType"
variable_declarator
identifier "currentClass"
= "="
null_literal "null"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "String"
> ">"
variable_declarator
identifier "initializedConstantProperties"
; ";"
constructor_declaration (+50 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+108 nodes collapsed)
method_declaration (+101 nodes collapsed)
block_comment "/**\n * Gets the type of the class that \"owns\" a method, or"...
method_declaration (+241 nodes collapsed)
block_comment "/**\n * Normalize the type of a constructor, its instance, "...
method_declaration (+137 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+140 nodes collapsed)
block_comment "/**\n * Checks the given NEW node to ensure that access res"...
method_declaration (+160 nodes collapsed)
block_comment "/**\n * Checks the given NAME node to ensure that access re"...
method_declaration (+244 nodes collapsed)
block_comment "/**\n * Checks the given GETPROP node to ensure that access"...
method_declaration (+246 nodes collapsed)
block_comment "/**\n * Determines whether the given name is visible in the"...
method_declaration (+205 nodes collapsed)
block_comment "/**\n * Determines whether the given property with @const t"...
method_declaration (+426 nodes collapsed)
block_comment "/**\n * Determines whether the given property is visible in"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "checkPropertyVisibility"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "getprop"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
local_variable_declaration (+31 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "propertyName"
= "="
method_invocation
method_invocation
identifier "getprop"
. "."
identifier "getLastChild"
argument_list
( "("
) ")"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "objectType"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// Is this a normal property access, or are we trying to ove"...
line_comment "// an existing property?"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "isOverride"
= "="
binary_expression
binary_expression
method_invocation
identifier "t"
. "."
identifier "inGlobalScope"
argument_list
( "("
) ")"
&& "&&"
binary_expression
method_invocation
identifier "parent"
. "."
identifier "getType"
argument_list
( "("
) ")"
== "=="
field_access
identifier "Token"
. "."
identifier "ASSIGN"
&& "&&"
binary_expression
method_invocation
identifier "parent"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
== "=="
identifier "getprop"
; ";"
line_comment "// Find the lowest property defined on a class with visibili"...
line_comment "// information."
if_statement (+21 nodes collapsed)
local_variable_declaration
type_identifier "JSDocInfo"
variable_declarator
identifier "docInfo"
= "="
null_literal "null"
; ";"
for_statement (+66 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "objectType"
== "=="
null_literal "null"
) ")"
block
{ "{"
line_comment "// We couldn't find a visibility modifier; assume it's publi"...
return_statement
return "return"
; ";"
} "}"
local_variable_declaration (+32 nodes collapsed)
local_variable_declaration
type_identifier "Visibility"
variable_declarator
identifier "visibility"
= "="
method_invocation
identifier "docInfo"
. "."
identifier "getVisibility"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "ownerType"
= "="
method_invocation
identifier "normalizeClassType"
argument_list
( "("
identifier "objectType"
) ")"
; ";"
if_statement (+364 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * Whether the given access of a private constructor i"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Determines whether a deprecation warning should be "...
method_declaration (+161 nodes collapsed)
block_comment "/**\n * Returns whether it's currently ok to access depreca"...
method_declaration (+121 nodes collapsed)
block_comment "/**\n * Returns whether this is a function node annotated a"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Returns the deprecation reason for the type if it i"...
method_declaration (+163 nodes collapsed)
block_comment "/**\n * Returns the deprecation reason for the property if "...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * Dereference a type, autoboxing it and filtering out"...
method_declaration (+33 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2008 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
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "ScopedCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
. "."
identifier "Visibility"
; ";"
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 "FunctionPrototypeType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "FunctionType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "ObjectType"
; ";"
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
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 "HashMultimap"
; ";"
block_comment "/**\n * A compiler pass that checks that the programmer has o"...
class_declaration
class "class"
identifier "CheckAccessControls"
super_interfaces
implements "implements"
type_list
type_identifier "ScopedCallback"
, ","
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
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 "TypeValidator"
variable_declarator
identifier "validator"
; ";"
line_comment "// State about the current traversal."
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "deprecatedDepth"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "methodDepth"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSType"
variable_declarator
identifier "currentClass"
= "="
null_literal "null"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Multimap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "String"
> ">"
variable_declarator
identifier "initializedConstantProperties"
; ";"
constructor_declaration (+50 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+108 nodes collapsed)
method_declaration (+101 nodes collapsed)
block_comment "/**\n * Gets the type of the class that \"owns\" a method, or"...
method_declaration (+241 nodes collapsed)
block_comment "/**\n * Normalize the type of a constructor, its instance, "...
method_declaration (+137 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+140 nodes collapsed)
block_comment "/**\n * Checks the given NEW node to ensure that access res"...
method_declaration (+160 nodes collapsed)
block_comment "/**\n * Checks the given NAME node to ensure that access re"...
method_declaration (+244 nodes collapsed)
block_comment "/**\n * Checks the given GETPROP node to ensure that access"...
method_declaration (+246 nodes collapsed)
block_comment "/**\n * Determines whether the given name is visible in the"...
method_declaration (+205 nodes collapsed)
block_comment "/**\n * Determines whether the given property with @const t"...
method_declaration (+426 nodes collapsed)
block_comment "/**\n * Determines whether the given property is visible in"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "checkPropertyVisibility"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "getprop"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
local_variable_declaration (+31 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "propertyName"
= "="
method_invocation
method_invocation
identifier "getprop"
. "."
identifier "getLastChild"
argument_list
( "("
) ")"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "objectType"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// Is this a normal property access, or are we trying to ove"...
line_comment "// an existing property?"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "isOverride"
= "="
binary_expression
binary_expression
binary_expression
method_invocation
identifier "parent"
. "."
identifier "getJSDocInfo"
argument_list
( "("
) ")"
!= "!="
null_literal "null"
&& "&&"
binary_expression
method_invocation
identifier "parent"
. "."
identifier "getType"
argument_list
( "("
) ")"
== "=="
field_access
identifier "Token"
. "."
identifier "ASSIGN"
&& "&&"
binary_expression
method_invocation
identifier "parent"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
== "=="
identifier "getprop"
; ";"
line_comment "// Find the lowest property defined on a class with visibili"...
line_comment "// information."
if_statement (+21 nodes collapsed)
local_variable_declaration
type_identifier "JSDocInfo"
variable_declarator
identifier "docInfo"
= "="
null_literal "null"
; ";"
for_statement (+66 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "objectType"
== "=="
null_literal "null"
) ")"
block
{ "{"
line_comment "// We couldn't find a visibility modifier; assume it's publi"...
return_statement
return "return"
; ";"
} "}"
local_variable_declaration (+32 nodes collapsed)
local_variable_declaration
type_identifier "Visibility"
variable_declarator
identifier "visibility"
= "="
method_invocation
identifier "docInfo"
. "."
identifier "getVisibility"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "ownerType"
= "="
method_invocation
identifier "normalizeClassType"
argument_list
( "("
identifier "objectType"
) ")"
; ";"
if_statement (+364 nodes collapsed)
} "}"
} "}"
block_comment "/**\n * Whether the given access of a private constructor i"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Determines whether a deprecation warning should be "...
method_declaration (+161 nodes collapsed)
block_comment "/**\n * Returns whether it's currently ok to access depreca"...
method_declaration (+121 nodes collapsed)
block_comment "/**\n * Returns whether this is a function node annotated a"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Returns the deprecation reason for the type if it i"...
method_declaration (+163 nodes collapsed)
block_comment "/**\n * Returns the deprecation reason for the property if "...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * Dereference a type, autoboxing it and filtering out"...
method_declaration (+33 nodes collapsed)
} "}"