boolean throwsOnUndefined, Result out) {
StringBuilder sb = new StringBuilder();
sb.append('(');
Expression obj = ma.children().get(0);
optimize(s, obj, false, false, false, false, out);
Reference prop = (Reference) ma.children().get(1);
if (out.node != obj) {
ma = Operation.createInfix(
Operator.MEMBER_ACCESS, (Expression) out.node, prop);
}
sb = addDigest(out.digest, sb);
int objDigestEnd = sb != null ? sb.length() : -1;
if (sb != null) {
nodeDigest(ma.children().get(1), sb);
nodeTail(ma, sb);
}
String digest = sb != null ? sb.toString() : null;
out.node = ma;
out.digest = digest;
if (digest != null) {
if (!isLhs) {
Fact f = getFact(digest);
if (f != null && f.isSubstitutable(isFuzzy)) {
out.node = f.value.clone();
out.digest = nodeDigest(out.node);
return;
}
}
// window.addEventListener -> addEventListener
String objDigest = digest.substring(1, objDigestEnd);
Pair<Expression, Fact> objFe = facts.get(objDigest);
if (objFe != null && objFe.b.isGlobal()
&& s.isOuter(prop.getIdentifierName())) {
String propDigest = nodeDigest(prop);
boolean canSimplify = false;
if (isLhs || throwsOnUndefined) {
// If it's being set, we don't need to worry about undefined global
// errors, and we don't need to worry if the containing expression