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–1470 unchanged (1470 lines)
1471 !functionName.getString().equals("join")) {
1472 return;
1473 }
1474
1475 String joinString = NodeUtil.getStringValue(right);
1476 List<Node> arrayFoldedChildren = Lists.newLinkedList();
1477 StringBuilder sb = new StringBuilder();
1478 int foldedSize = 0;
1479 Node elem = arrayNode.getFirstChild();
1480 // Merges adjacent String nodes.
1481 while (elem != null) {
1482 if (NodeUtil.isImmutableValue(elem)) {
1483 if (sb.length() > 0) {
1484 sb.append(joinString);
1485 }
1486 sb.append(NodeUtil.getStringValue(elem));
1487 } else {
1488 if (sb.length() > 0) {
1489 // + 2 for the quotes.
1490 foldedSize += sb.length() + 2;
1491 arrayFoldedChildren.add(Node.newString(sb.toString()));
1492 sb = new StringBuilder();
1493 }
1494 foldedSize += InlineCostEstimator.getCost(elem);
1495 arrayFoldedChildren.add(elem);
1496 }
1497 elem = elem.getNext();
1498 }
1499
1500 if (sb.length() > 0) {
1501 // + 2 for the quotes.
1502 foldedSize += sb.length() + 2;
1503 arrayFoldedChildren.add(Node.newString(sb.toString()));
1504 }
1505 // one for each comma.
1506 foldedSize += arrayFoldedChildren.size() - 1;
1507
1508 int originalSize = InlineCostEstimator.getCost(n);
1509 switch (arrayFoldedChildren.size()) {
1510 case 0:
…lines 1511–2024 unchanged (514 lines)

After

…lines 1–1470 unchanged (1470 lines)
1471 !functionName.getString().equals("join")) {
1472 return;
1473 }
1474
1475 String joinString = NodeUtil.getStringValue(right);
1476 List<Node> arrayFoldedChildren = Lists.newLinkedList();
1477 StringBuilder sb = null;
1478 int foldedSize = 0;
1479 Node elem = arrayNode.getFirstChild();
1480 // Merges adjacent String nodes.
1481 while (elem != null) {
1482 if (NodeUtil.isImmutableValue(elem)) {
1483 if (sb == null) {
1484 sb = new StringBuilder();
1485 } else {
1486 sb.append(joinString);
1487 }
1488 sb.append(NodeUtil.getStringValue(elem));
1489 } else {
1490 if (sb != null) {
1491 // + 2 for the quotes.
1492 foldedSize += sb.length() + 2;
1493 arrayFoldedChildren.add(Node.newString(sb.toString()));
1494 sb = null;
1495 }
1496 foldedSize += InlineCostEstimator.getCost(elem);
1497 arrayFoldedChildren.add(elem);
1498 }
1499 elem = elem.getNext();
1500 }
1501
1502 if (sb != null) {
1503 // + 2 for the quotes.
1504 foldedSize += sb.length() + 2;
1505 arrayFoldedChildren.add(Node.newString(sb.toString()));
1506 }
1507 // one for each comma.
1508 foldedSize += arrayFoldedChildren.size() - 1;
1509
1510 int originalSize = InlineCostEstimator.getCost(n);
1511 switch (arrayFoldedChildren.size()) {
1512 case 0:
…lines 1513–2026 unchanged (514 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 "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractShallowCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
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
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Pattern"
; ";"
block_comment "/**\n * FoldConstants simplifies expressions which consist on"...
class_declaration
class "class"
identifier "FoldConstants"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
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 (+22 nodes collapsed)
field_declaration (+22 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
constructor_declaration
identifier "FoldConstants"
formal_parameters
( "("
formal_parameter
type_identifier "AbstractCompiler"
identifier "compiler"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "compiler"
= "="
identifier "compiler"
; ";"
} "}"
method_declaration (+32 nodes collapsed)
method_declaration (+2253 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Does a statement consume a 'dangling else'? A state"...
method_declaration (+128 nodes collapsed)
method_declaration (+462 nodes collapsed)
block_comment "/**\n * Try removing unneeded block nodes and their useless"...
method_declaration (+166 nodes collapsed)
block_comment "/**\n * Try folding :? (hook) and IF nodes by removing dead"...
method_declaration (+1070 nodes collapsed)
block_comment "/**\n * Try to minimize NOT nodes such as !(x==y).\n */"
method_declaration (+200 nodes collapsed)
block_comment "/**\n * Try turning IF nodes into smaller HOOKs\n */"
method_declaration (+1574 nodes collapsed)
block_comment "/**\n * Try to remove duplicate statements from IF blocks. "...
method_declaration (+250 nodes collapsed)
block_comment "/**\n * Reduce \"return undefined\" or \"return void 0\" to sim"...
method_declaration (+191 nodes collapsed)
block_comment "/**\n * Does the expression contain a property assignment?\n"...
method_declaration (+136 nodes collapsed)
block_comment "/**\n * Does the expression contain an operator with lower "...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Try to fold a AND/OR node.\n */"
method_declaration (+390 nodes collapsed)
block_comment "/**\n * Expressions such as [foo() + 'a' + 'b'] generate pa"...
method_declaration (+233 nodes collapsed)
block_comment "/**\n * Try to fold a ADD node\n */"
method_declaration (+169 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+329 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Try to fold shift operations\n */"
method_declaration (+407 nodes collapsed)
block_comment "/**\n * Try to fold comparison nodes, e.g ==\n */"
method_declaration (+1357 nodes collapsed)
block_comment "/**\n * Try to evaluate String.indexOf/lastIndexOf:\n * "...
method_declaration (+413 nodes collapsed)
block_comment "/**\n * Try to fold an array join: ['a', 'b', 'c'].join('')"...
method_declaration
void_type "void"
identifier "tryFoldStringJoin"
formal_parameters (+22 nodes collapsed)
block
{ "{"
if_statement (+33 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "arrayNode"
= "="
method_invocation
identifier "left"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "functionName"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
if_statement (+48 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "joinString"
= "="
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "right"
) ")"
; ";"
local_variable_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "Node"
> ">"
variable_declarator
identifier "arrayFoldedChildren"
= "="
method_invocation
identifier "Lists"
. "."
identifier "newLinkedList"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "StringBuilder"
variable_declarator
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "foldedSize"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "elem"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
line_comment "// Merges adjacent String nodes."
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "elem"
!= "!="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "isImmutableValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
identifier "joinString"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
line_comment "// + 2 for the quotes."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
+ "+"
decimal_integer_literal "2"
; ";"
expression_statement (+23 nodes collapsed)
expression_statement
assignment_expression
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "elem"
) ")"
; ";"
expression_statement
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "add"
argument_list
( "("
identifier "elem"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "elem"
= "="
method_invocation
identifier "elem"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block (+42 nodes collapsed)
line_comment "// one for each comma."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "size"
argument_list
( "("
) ")"
- "-"
decimal_integer_literal "1"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "originalSize"
= "="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "n"
) ")"
; ";"
switch_expression (+283 nodes collapsed)
expression_statement
method_invocation
method_invocation
identifier "t"
. "."
identifier "getCompiler"
argument_list
( "("
) ")"
. "."
identifier "reportCodeChange"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Try to fold array-element. e.g [1, 2, 3][10];\n */"
method_declaration (+347 nodes collapsed)
block_comment "/**\n * Try to fold array-length. e.g [1, 2, 3].length ==> "...
method_declaration (+229 nodes collapsed)
block_comment "/**\n * Try to fold a RegExp constructor to a regular expre"...
method_declaration (+400 nodes collapsed)
field_declaration (+21 nodes collapsed)
block_comment "/**\n * are the given flags valid regular expression flags?"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * are the given flags safe to fold?\n * We don't fol"...
method_declaration (+29 nodes collapsed)
block_comment "/**\n * returns a string node that can safely be rendered i"...
method_declaration (+232 nodes collapsed)
block_comment "/**\n * Replaces a new Array or Object node with an object "...
method_declaration (+117 nodes collapsed)
block_comment "/**\n * true if the javascript string would contain a unico"...
method_declaration (+147 nodes collapsed)
block_comment "/**\n * Removes WHILEs that always evaluate to false.\n */"
method_declaration (+124 nodes collapsed)
block_comment "/**\n * Removes FORs that always evaluate to false.\n */"
method_declaration (+171 nodes collapsed)
block_comment "/**\n * Removes DOs that always evaluate to false. This lea"...
method_declaration (+171 nodes collapsed)
block_comment "/**\n *\n */"
method_declaration (+90 nodes collapsed)
block_comment "/**\n * Try to minimize conditions expressions, as there ar"...
method_declaration (+493 nodes collapsed)
block_comment "/**\n * Remove always true loop conditions.\n */"
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Replaces a node with a number node if the new numbe"...
method_declaration (+86 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * @return The expression node.\n */"
method_declaration (+39 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The expression that is part of the return.\n"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The var node.\n */"
method_declaration (+39 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 "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractShallowCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
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
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Pattern"
; ";"
block_comment "/**\n * FoldConstants simplifies expressions which consist on"...
class_declaration
class "class"
identifier "FoldConstants"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
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 (+22 nodes collapsed)
field_declaration (+22 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
constructor_declaration
identifier "FoldConstants"
formal_parameters
( "("
formal_parameter
type_identifier "AbstractCompiler"
identifier "compiler"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "compiler"
= "="
identifier "compiler"
; ";"
} "}"
method_declaration (+32 nodes collapsed)
method_declaration (+2253 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Does a statement consume a 'dangling else'? A state"...
method_declaration (+128 nodes collapsed)
method_declaration (+462 nodes collapsed)
block_comment "/**\n * Try removing unneeded block nodes and their useless"...
method_declaration (+166 nodes collapsed)
block_comment "/**\n * Try folding :? (hook) and IF nodes by removing dead"...
method_declaration (+1070 nodes collapsed)
block_comment "/**\n * Try to minimize NOT nodes such as !(x==y).\n */"
method_declaration (+200 nodes collapsed)
block_comment "/**\n * Try turning IF nodes into smaller HOOKs\n */"
method_declaration (+1574 nodes collapsed)
block_comment "/**\n * Try to remove duplicate statements from IF blocks. "...
method_declaration (+250 nodes collapsed)
block_comment "/**\n * Reduce \"return undefined\" or \"return void 0\" to sim"...
method_declaration (+191 nodes collapsed)
block_comment "/**\n * Does the expression contain a property assignment?\n"...
method_declaration (+136 nodes collapsed)
block_comment "/**\n * Does the expression contain an operator with lower "...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Try to fold a AND/OR node.\n */"
method_declaration (+390 nodes collapsed)
block_comment "/**\n * Expressions such as [foo() + 'a' + 'b'] generate pa"...
method_declaration (+233 nodes collapsed)
block_comment "/**\n * Try to fold a ADD node\n */"
method_declaration (+169 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+329 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Try to fold shift operations\n */"
method_declaration (+407 nodes collapsed)
block_comment "/**\n * Try to fold comparison nodes, e.g ==\n */"
method_declaration (+1357 nodes collapsed)
block_comment "/**\n * Try to evaluate String.indexOf/lastIndexOf:\n * "...
method_declaration (+413 nodes collapsed)
block_comment "/**\n * Try to fold an array join: ['a', 'b', 'c'].join('')"...
method_declaration
void_type "void"
identifier "tryFoldStringJoin"
formal_parameters (+22 nodes collapsed)
block
{ "{"
if_statement (+33 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "arrayNode"
= "="
method_invocation
identifier "left"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "functionName"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
if_statement (+48 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "joinString"
= "="
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "right"
) ")"
; ";"
local_variable_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "Node"
> ">"
variable_declarator
identifier "arrayFoldedChildren"
= "="
method_invocation
identifier "Lists"
. "."
identifier "newLinkedList"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "StringBuilder"
variable_declarator
identifier "sb"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "foldedSize"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "elem"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
line_comment "// Merges adjacent String nodes."
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "elem"
!= "!="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "isImmutableValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "sb"
== "=="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
identifier "joinString"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "sb"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// + 2 for the quotes."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
+ "+"
decimal_integer_literal "2"
; ";"
expression_statement (+23 nodes collapsed)
expression_statement
assignment_expression
identifier "sb"
= "="
null_literal "null"
; ";"
} "}"
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "elem"
) ")"
; ";"
expression_statement
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "add"
argument_list
( "("
identifier "elem"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "elem"
= "="
method_invocation
identifier "elem"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "sb"
!= "!="
null_literal "null"
) ")"
block (+42 nodes collapsed)
line_comment "// one for each comma."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "size"
argument_list
( "("
) ")"
- "-"
decimal_integer_literal "1"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "originalSize"
= "="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "n"
) ")"
; ";"
switch_expression (+283 nodes collapsed)
expression_statement
method_invocation
method_invocation
identifier "t"
. "."
identifier "getCompiler"
argument_list
( "("
) ")"
. "."
identifier "reportCodeChange"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Try to fold array-element. e.g [1, 2, 3][10];\n */"
method_declaration (+347 nodes collapsed)
block_comment "/**\n * Try to fold array-length. e.g [1, 2, 3].length ==> "...
method_declaration (+229 nodes collapsed)
block_comment "/**\n * Try to fold a RegExp constructor to a regular expre"...
method_declaration (+400 nodes collapsed)
field_declaration (+21 nodes collapsed)
block_comment "/**\n * are the given flags valid regular expression flags?"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * are the given flags safe to fold?\n * We don't fol"...
method_declaration (+29 nodes collapsed)
block_comment "/**\n * returns a string node that can safely be rendered i"...
method_declaration (+232 nodes collapsed)
block_comment "/**\n * Replaces a new Array or Object node with an object "...
method_declaration (+117 nodes collapsed)
block_comment "/**\n * true if the javascript string would contain a unico"...
method_declaration (+147 nodes collapsed)
block_comment "/**\n * Removes WHILEs that always evaluate to false.\n */"
method_declaration (+124 nodes collapsed)
block_comment "/**\n * Removes FORs that always evaluate to false.\n */"
method_declaration (+171 nodes collapsed)
block_comment "/**\n * Removes DOs that always evaluate to false. This lea"...
method_declaration (+171 nodes collapsed)
block_comment "/**\n *\n */"
method_declaration (+90 nodes collapsed)
block_comment "/**\n * Try to minimize conditions expressions, as there ar"...
method_declaration (+493 nodes collapsed)
block_comment "/**\n * Remove always true loop conditions.\n */"
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Replaces a node with a number node if the new numbe"...
method_declaration (+86 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * @return The expression node.\n */"
method_declaration (+39 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The expression that is part of the return.\n"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The var node.\n */"
method_declaration (+39 nodes collapsed)
} "}"