Add toString() methods to a few more Removable subclasses.
@@ -1784,6 +1784,11 @@ class RemoveUnusedCode implements CompilerPass {
}
}
}
+
+ @Override
+ public String toString() {
+ return "UnusedReadReference:" + referenceNode;
+ }
}
/**
@@ -1820,6 +1825,11 @@ class RemoveUnusedCode implements CompilerPass {
// there are no instances of it.
return true;
}
+
+ @Override
+ public String toString() {
+ return "InstanceofName:" + instanceofNode;
+ }
}
/** Represents an increment or decrement operation that could be removed. */
@@ -1855,6 +1865,11 @@ class RemoveUnusedCode implements CompilerPass {
}
}
}
+
+ @Override
+ public String toString() {
+ return "IncOrDecOp:" + incOrDecNode;
+ }
}
/** True for `this.propertyName` */
@@ -1991,6 +2006,11 @@ class RemoveUnusedCode implements CompilerPass {
public void removeInternal(AbstractCompiler compiler) {
NodeUtil.deleteNode(classDeclarationNode, compiler);
}
+
+ @Override
+ public String toString() {
+ return "ClassDeclaration:" + classDeclarationNode;
+ }
}
private class NamedClassExpression extends Removable {
@@ -2013,6 +2033,11 @@ class RemoveUnusedCode implements CompilerPass {
}
}
}
+
+ @Override
+ public String toString() {
+ return "NamedClassExpression:" + classNode;
+ }
}
private class ClassOrPrototypeNamedProperty extends Removable {
@@ -2037,6 +2062,11 @@ class RemoveUnusedCode implements CompilerPass {
void removeInternal(AbstractCompiler compiler) {
NodeUtil.deleteNode(propertyNode, compiler);
}
+
+ @Override
+ public String toString() {
+ return "ClassOrPrototypeNamedProperty:" + propertyNode;
+ }
}
/**
@@ -2080,6 +2110,11 @@ class RemoveUnusedCode implements CompilerPass {
// The declared function is always created locally.
return true;
}
+
+ @Override
+ public String toString() {
+ return "FunctionDeclaration:" + functionDeclarationNode;
+ }
}
private class NameDeclarationStatement extends Removable {
@@ -2306,6 +2341,11 @@ class RemoveUnusedCode implements CompilerPass {
boolean isPrototypeProperty() {
return true;
}
+
+ @Override
+ public String toString() {
+ return "AnonymousPrototypeNamedPropertyAssign:" + assignNode;
+ }
}
/**
@@ -2313,7 +2353,6 @@ class RemoveUnusedCode implements CompilerPass {
* `goog.addSingletonGetter()`.
*/
private class ClassSetupCall extends Removable {
-
final Node callNode;
ClassSetupCall(RemovableBuilder builder, Node callNode) {
@@ -2363,6 +2402,11 @@ class RemoveUnusedCode implements CompilerPass {
// it's safe to remove the class setup for it.
return true;
}
+
+ @Override
+ public String toString() {
+ return "ClassSetupCall:" + callNode;
+ }
}
private static boolean alreadyRemoved(Node n) {
