Adds consideration for GETELEMs when analyzing the body of a clinit method in `J2clClinitPrunerPass`.
The possibility of GETELEMs had been overlooked due to the generated nature of the code. However they can appear if other passes have inserted code, such as for instrumentation.
@@ -406,7 +406,12 @@ public class J2clClinitPrunerPass implements CompilerPass {
}
Node lhs = node.getFirstFirstChild();
+ if (lhs.isGetElem()) {
+ // This can happen if code has been inserted, for example for instrumentation.
+ return false;
+ }
checkState(lhs.isName() || lhs.isGetProp(), lhs);
+
Node rhs = node.getFirstChild().getLastChild();
return NodeUtil.isEmptyFunctionExpression(rhs)
&& Objects.equals(NodeUtil.getBestLValueName(lhs), enclosingFnName);
