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–594 unchanged (594 lines)
595 && !knownConstants.contains(n.getString());
596
597 // Properties on constant NAMEs can still be side-effected.
598 case Token.GETPROP:
599 case Token.GETELEM:
600 return true;
601
602 // Anonymous functions definitions are not changed by side-effects,
603 // and named functions are not part of expressions.
604 }
605
606 for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
607 if (canBeSideEffected(c, knownConstants)) {
608 return true;
609 }
610 }
…lines 611–1987 unchanged (1377 lines)

After

…lines 1–595 unchanged (595 lines)
596
597 // Properties on constant NAMEs can still be side-effected.
598 case Token.GETPROP:
599 case Token.GETELEM:
600 return true;
601
602 case Token.FUNCTION:
603 // Anonymous functions definitions are not changed by side-effects,
604 // and named functions are not part of expressions.
605 Preconditions.checkState(NodeUtil.isAnonymousFunction(n));
606 return false;
607 }
608
609 for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
610 if (canBeSideEffected(c, knownConstants)) {
611 return true;
612 }
…lines 613–1990 unchanged (1378 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"
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 "base"
. "."
identifier "Predicate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "FunctionNode"
; ";"
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
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "TokenStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
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 "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
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 "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * NodeUtil contains utilities that get properties from "...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "NodeUtil"
class_body
{ "{"
line_comment "// TODO(user): Eliminate this class and make all of the stat"...
line_comment "// instance methods of com.google.javascript.rhino.Node."
block_comment "/** the set of builtin constructors that don't have side eff"...
field_declaration (+62 nodes collapsed)
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "CONSTANT_MARKER"
= "="
string_literal
" "\""
string_fragment "$$constant"
" "\""
; ";"
line_comment "// Utility class; do not instantiate."
constructor_declaration
modifiers
private "private"
identifier "NodeUtil"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Gets the boolean value of a node that represents a "...
method_declaration (+243 nodes collapsed)
block_comment "/**\n * Gets the value of a node as a String, or null if it"...
method_declaration (+196 nodes collapsed)
block_comment "/**\n * Gets the function's name. This method recognizes fi"...
method_declaration (+127 nodes collapsed)
block_comment "/**\n * Returns true if this is an immutable value.\n */"
method_declaration (+171 nodes collapsed)
block_comment "/**\n * Returns true if this is a literal value. We define "...
method_declaration (+127 nodes collapsed)
block_comment "/**\n * Determines whether the given value may be assigned "...
method_declaration (+193 nodes collapsed)
block_comment "/**\n * Returns whether this a BLOCK node with no children."...
method_declaration (+103 nodes collapsed)
block_comment "/**\n * A \"simple\" operator is one whose children are expre"...
method_declaration (+268 nodes collapsed)
block_comment "/**\n * Creates an EXPR_RESULT.\n *\n * @param child The "...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns true if the node may create new mutable sta"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns true if the node which may have side effect"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns true if some node in n's subtree changes ap"...
method_declaration (+686 nodes collapsed)
block_comment "/**\n * Do calls to this constructor have side effects?\n "...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Returns true if calls to this function have side ef"...
method_declaration (+236 nodes collapsed)
block_comment "/**\n * Returns true if the current node's type implies sid"...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * @return Whether the tree can be affected by side-ef"...
method_declaration (+43 nodes collapsed)
block_comment "/**\n * @param knownConstants A set of names known to be co"...
method_declaration
modifiers
static "static"
boolean_type "boolean"
identifier "canBeSideEffected"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "knownConstants"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "CALL"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "NEW"
: ":"
line_comment "// Function calls or constructor can reference changed value"...
line_comment "// TODO(johnlenz): Add some mechanism for determining that f"...
line_comment "// are unaffected by side effects."
return_statement
return "return"
true "true"
; ";"
switch_block_statement_group (+40 nodes collapsed)
line_comment "// Properties on constant NAMEs can still be side-effected."
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETPROP"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETELEM"
: ":"
return_statement
return "return"
true "true"
; ";"
line_comment "// Anonymous functions definitions are not changed by side-e"...
line_comment "// and named functions are not part of expressions."
} "}"
for_statement (+55 nodes collapsed)
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/*\n * 0 comma ,\n * 1 assignment = += -= *= /= %= <<= >"...
method_declaration (+656 nodes collapsed)
block_comment "/**\n * Returns true if the operator is associative.\n * e"...
method_declaration (+76 nodes collapsed)
method_declaration (+133 nodes collapsed)
method_declaration (+208 nodes collapsed)
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Determines if the given node contains a function de"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Returns true if the subtree contains references to "...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Is this a GETPROP or GETELEM node?\n */"
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Is this a GETPROP node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a NAME node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a NEW node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a VAR node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node the name of a variable being declared?"...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * For an assignment or variable declaration get the a"...
method_declaration (+111 nodes collapsed)
block_comment "/**\n * Is this a STRING node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node an assignment expression statement?\n "...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * Is this an ASSIGN node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node a call expression statement?\n *\n *"...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * @return Whether the node represents a FOR-IN loop.\n"...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Determines whether the given node is a FOR, DO, or "...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * @param n The node to inspect.\n * @return If the n"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Determines whether the given node is a FOR, DO, WHI"...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Determines whether the given node is code node for "...
method_declaration (+238 nodes collapsed)
block_comment "/**\n * Gets the condition of an ON_TRUE / ON_FALSE CFG edg"...
method_declaration (+170 nodes collapsed)
block_comment "/**\n * @return Whether the node is of a type that contain "...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the node is used as a statement.\n "...
method_declaration (+95 nodes collapsed)
block_comment "/** Whether the node is part of a switch statement. */"
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the name is a reference to a variab"...
method_declaration (+50 nodes collapsed)
block_comment "/** @return Whether the node is a label name. */"
method_declaration (+119 nodes collapsed)
block_comment "/** Whether the child node is the FINALLY block of a try. */"
method_declaration (+58 nodes collapsed)
block_comment "/** Safely remove children while maintaining a valid node st"...
method_declaration (+335 nodes collapsed)
block_comment "/**\n * Merge a block with its parent block.\n * @return W"...
method_declaration (+195 nodes collapsed)
block_comment "/**\n * Is this a CALL node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a FUNCTION node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Return a BLOCK node for the given FUNCTION node.\n "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Is this a THIS node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node or any of its children a CALL?\n */"
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Is this node a function declaration? A function dec"...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Is this node a hoisted function declaration? A func"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * Is this node an anonymous function? An anonymous fu"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Is a FUNCTION node an anonymous function? An anonym"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Determines if a function takes a variable number of"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * @return Whether node is a call to methodName.\n * "...
method_declaration (+139 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Determines whether this node is strictly on the lef"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Determines whether a node represents an object lite"...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * Converts an operator's token value (see {@link Toke"...
method_declaration (+647 nodes collapsed)
block_comment "/**\n * Converts an operator's token value (see {@link Toke"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Given a node tree, finds all the VAR declarations i"...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Copy any annotations that follow a named value.\n "...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * Gets a Node at the top of the current scope where w"...
method_declaration (+204 nodes collapsed)
block_comment "/** Creates function name(params_0, ..., params_n) { body }."...
method_declaration (+146 nodes collapsed)
block_comment "/**\n * Creates a node representing a qualified name.\n *\n"...
method_declaration (+231 nodes collapsed)
block_comment "/**\n * Creates a node representing a qualified name, copyi"...
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Sets the debug information (source file info and or"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Creates a new node representing an *existing* name,"...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * Creates a new node representing an *existing* name,"...
method_declaration (+55 nodes collapsed)
block_comment "/** Test if all characters in the string are in the Basic La"...
method_declaration (+94 nodes collapsed)
block_comment "/**\n * Determines whether the given name can appear on the"...
method_declaration (+53 nodes collapsed)
class_declaration (+153 nodes collapsed)
block_comment "/**\n * Retrieves vars declared in the current node tree, e"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n * @return {@code true} if the node an assignment to a"...
method_declaration (+57 nodes collapsed)
method_declaration (+70 nodes collapsed)
block_comment "/**\n * @return The class name part of a qualified prototyp"...
method_declaration (+96 nodes collapsed)
block_comment "/**\n * @return The string property name part of a qualifie"...
method_declaration (+79 nodes collapsed)
block_comment "/**\n * Create a node for an empty result expression:\n * "...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Create a VAR node containing the given name and ini"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * A predicate for matching name nodes with the specif"...
class_declaration (+91 nodes collapsed)
block_comment "/**\n * A predicate for matching nodes with the specified t"...
class_declaration (+73 nodes collapsed)
block_comment "/**\n * Whether a Node type is within the node tree.\n */"
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Whether a Node type is within the node tree.\n */"
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Finds the number of times a type is referenced with"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Whether a simple name is referenced within the node"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Whether a simple name is referenced within the node"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Finds the number of times a simple name is referenc"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * @return Whether the predicate is true for the node "...
method_declaration (+135 nodes collapsed)
block_comment "/**\n * @return The number of times the the predicate is tr"...
method_declaration (+105 nodes collapsed)
block_comment "/**\n * Interface for use with the visit method.\n * @see "...
interface_declaration
modifiers
static "static"
interface "interface"
identifier "Visitor"
interface_body
{ "{"
method_declaration
void_type "void"
identifier "visit"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "node"
) ")"
; ";"
} "}"
block_comment "/**\n * A pre-order traversal, calling Vistor.visit for eac"...
method_declaration (+100 nodes collapsed)
block_comment "/**\n * A post-order traversal, calling Vistor.visit for ea"...
method_declaration (+100 nodes collapsed)
block_comment "/**\n * @return Whether a TRY node has a finally block.\n "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * @return The BLOCK node containing the CATCH node (i"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * @return Whether BLOCK (from a TRY node) contains a "...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * @param fnNode The function.\n * @return The Node"...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Returns true if a name node represents a constant v"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @param nameNode A name node\n * @return The JSDocI"...
method_declaration (+143 nodes collapsed)
block_comment "/**\n * @param n The node.\n * @return The source name pro"...
method_declaration (+75 nodes collapsed)
} "}"

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"
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 "base"
. "."
identifier "Predicate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "FunctionNode"
; ";"
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
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "TokenStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
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 "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
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 "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * NodeUtil contains utilities that get properties from "...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "NodeUtil"
class_body
{ "{"
line_comment "// TODO(user): Eliminate this class and make all of the stat"...
line_comment "// instance methods of com.google.javascript.rhino.Node."
block_comment "/** the set of builtin constructors that don't have side eff"...
field_declaration (+62 nodes collapsed)
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "CONSTANT_MARKER"
= "="
string_literal
" "\""
string_fragment "$$constant"
" "\""
; ";"
line_comment "// Utility class; do not instantiate."
constructor_declaration
modifiers
private "private"
identifier "NodeUtil"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Gets the boolean value of a node that represents a "...
method_declaration (+243 nodes collapsed)
block_comment "/**\n * Gets the value of a node as a String, or null if it"...
method_declaration (+196 nodes collapsed)
block_comment "/**\n * Gets the function's name. This method recognizes fi"...
method_declaration (+127 nodes collapsed)
block_comment "/**\n * Returns true if this is an immutable value.\n */"
method_declaration (+171 nodes collapsed)
block_comment "/**\n * Returns true if this is a literal value. We define "...
method_declaration (+127 nodes collapsed)
block_comment "/**\n * Determines whether the given value may be assigned "...
method_declaration (+193 nodes collapsed)
block_comment "/**\n * Returns whether this a BLOCK node with no children."...
method_declaration (+103 nodes collapsed)
block_comment "/**\n * A \"simple\" operator is one whose children are expre"...
method_declaration (+268 nodes collapsed)
block_comment "/**\n * Creates an EXPR_RESULT.\n *\n * @param child The "...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns true if the node may create new mutable sta"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns true if the node which may have side effect"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns true if some node in n's subtree changes ap"...
method_declaration (+686 nodes collapsed)
block_comment "/**\n * Do calls to this constructor have side effects?\n "...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Returns true if calls to this function have side ef"...
method_declaration (+236 nodes collapsed)
block_comment "/**\n * Returns true if the current node's type implies sid"...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * @return Whether the tree can be affected by side-ef"...
method_declaration (+43 nodes collapsed)
block_comment "/**\n * @param knownConstants A set of names known to be co"...
method_declaration
modifiers
static "static"
boolean_type "boolean"
identifier "canBeSideEffected"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "knownConstants"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "CALL"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "NEW"
: ":"
line_comment "// Function calls or constructor can reference changed value"...
line_comment "// TODO(johnlenz): Add some mechanism for determining that f"...
line_comment "// are unaffected by side effects."
return_statement
return "return"
true "true"
; ";"
switch_block_statement_group (+40 nodes collapsed)
line_comment "// Properties on constant NAMEs can still be side-effected."
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETPROP"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETELEM"
: ":"
return_statement
return "return"
true "true"
; ";"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "FUNCTION"
: ":"
line_comment "// Anonymous functions definitions are not changed by side-e"...
line_comment "// and named functions are not part of expressions."
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "isAnonymousFunction"
argument_list
( "("
identifier "n"
) ")"
) ")"
; ";"
return_statement
return "return"
false "false"
; ";"
} "}"
for_statement (+55 nodes collapsed)
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/*\n * 0 comma ,\n * 1 assignment = += -= *= /= %= <<= >"...
method_declaration (+656 nodes collapsed)
block_comment "/**\n * Returns true if the operator is associative.\n * e"...
method_declaration (+76 nodes collapsed)
method_declaration (+133 nodes collapsed)
method_declaration (+208 nodes collapsed)
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Determines if the given node contains a function de"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Returns true if the subtree contains references to "...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Is this a GETPROP or GETELEM node?\n */"
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Is this a GETPROP node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a NAME node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a NEW node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a VAR node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node the name of a variable being declared?"...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * For an assignment or variable declaration get the a"...
method_declaration (+111 nodes collapsed)
block_comment "/**\n * Is this a STRING node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node an assignment expression statement?\n "...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * Is this an ASSIGN node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node a call expression statement?\n *\n *"...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * @return Whether the node represents a FOR-IN loop.\n"...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Determines whether the given node is a FOR, DO, or "...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * @param n The node to inspect.\n * @return If the n"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Determines whether the given node is a FOR, DO, WHI"...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Determines whether the given node is code node for "...
method_declaration (+238 nodes collapsed)
block_comment "/**\n * Gets the condition of an ON_TRUE / ON_FALSE CFG edg"...
method_declaration (+170 nodes collapsed)
block_comment "/**\n * @return Whether the node is of a type that contain "...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the node is used as a statement.\n "...
method_declaration (+95 nodes collapsed)
block_comment "/** Whether the node is part of a switch statement. */"
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the name is a reference to a variab"...
method_declaration (+50 nodes collapsed)
block_comment "/** @return Whether the node is a label name. */"
method_declaration (+119 nodes collapsed)
block_comment "/** Whether the child node is the FINALLY block of a try. */"
method_declaration (+58 nodes collapsed)
block_comment "/** Safely remove children while maintaining a valid node st"...
method_declaration (+335 nodes collapsed)
block_comment "/**\n * Merge a block with its parent block.\n * @return W"...
method_declaration (+195 nodes collapsed)
block_comment "/**\n * Is this a CALL node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this a FUNCTION node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Return a BLOCK node for the given FUNCTION node.\n "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Is this a THIS node?\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Is this node or any of its children a CALL?\n */"
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Is this node a function declaration? A function dec"...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Is this node a hoisted function declaration? A func"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * Is this node an anonymous function? An anonymous fu"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Is a FUNCTION node an anonymous function? An anonym"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Determines if a function takes a variable number of"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * @return Whether node is a call to methodName.\n * "...
method_declaration (+139 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @return Whether the callNode represents an expressi"...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Determines whether this node is strictly on the lef"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Determines whether a node represents an object lite"...
method_declaration (+128 nodes collapsed)
block_comment "/**\n * Converts an operator's token value (see {@link Toke"...
method_declaration (+647 nodes collapsed)
block_comment "/**\n * Converts an operator's token value (see {@link Toke"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * @return true if n or any of its children are of the"...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Given a node tree, finds all the VAR declarations i"...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Copy any annotations that follow a named value.\n "...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * Gets a Node at the top of the current scope where w"...
method_declaration (+204 nodes collapsed)
block_comment "/** Creates function name(params_0, ..., params_n) { body }."...
method_declaration (+146 nodes collapsed)
block_comment "/**\n * Creates a node representing a qualified name.\n *\n"...
method_declaration (+231 nodes collapsed)
block_comment "/**\n * Creates a node representing a qualified name, copyi"...
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Sets the debug information (source file info and or"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Creates a new node representing an *existing* name,"...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * Creates a new node representing an *existing* name,"...
method_declaration (+55 nodes collapsed)
block_comment "/** Test if all characters in the string are in the Basic La"...
method_declaration (+94 nodes collapsed)
block_comment "/**\n * Determines whether the given name can appear on the"...
method_declaration (+53 nodes collapsed)
class_declaration (+153 nodes collapsed)
block_comment "/**\n * Retrieves vars declared in the current node tree, e"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n * @return {@code true} if the node an assignment to a"...
method_declaration (+57 nodes collapsed)
method_declaration (+70 nodes collapsed)
block_comment "/**\n * @return The class name part of a qualified prototyp"...
method_declaration (+96 nodes collapsed)
block_comment "/**\n * @return The string property name part of a qualifie"...
method_declaration (+79 nodes collapsed)
block_comment "/**\n * Create a node for an empty result expression:\n * "...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Create a VAR node containing the given name and ini"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * A predicate for matching name nodes with the specif"...
class_declaration (+91 nodes collapsed)
block_comment "/**\n * A predicate for matching nodes with the specified t"...
class_declaration (+73 nodes collapsed)
block_comment "/**\n * Whether a Node type is within the node tree.\n */"
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Whether a Node type is within the node tree.\n */"
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Finds the number of times a type is referenced with"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Whether a simple name is referenced within the node"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Whether a simple name is referenced within the node"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Finds the number of times a simple name is referenc"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * @return Whether the predicate is true for the node "...
method_declaration (+135 nodes collapsed)
block_comment "/**\n * @return The number of times the the predicate is tr"...
method_declaration (+105 nodes collapsed)
block_comment "/**\n * Interface for use with the visit method.\n * @see "...
interface_declaration
modifiers
static "static"
interface "interface"
identifier "Visitor"
interface_body
{ "{"
method_declaration
void_type "void"
identifier "visit"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "node"
) ")"
; ";"
} "}"
block_comment "/**\n * A pre-order traversal, calling Vistor.visit for eac"...
method_declaration (+100 nodes collapsed)
block_comment "/**\n * A post-order traversal, calling Vistor.visit for ea"...
method_declaration (+100 nodes collapsed)
block_comment "/**\n * @return Whether a TRY node has a finally block.\n "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * @return The BLOCK node containing the CATCH node (i"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * @return Whether BLOCK (from a TRY node) contains a "...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * @param fnNode The function.\n * @return The Node"...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Returns true if a name node represents a constant v"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * @param nameNode A name node\n * @return The JSDocI"...
method_declaration (+143 nodes collapsed)
block_comment "/**\n * @param n The node.\n * @return The source name pro"...
method_declaration (+75 nodes collapsed)
} "}"