@Override public void endVisit(JsNameRef x, JsContext ctx) { String ident = x.getIdent(); if (!x.isJsniReference()) { // Not a jsni reference. return; } JsniRef jsniRef = JsniRef.parse(ident); if (jsniRef == null) { emitError(ERR_MALFORMED_JSNI_IDENTIFIER, x.getSourceInfo(), null, ident); return; } Binding binding = resolveReference(x.getSourceInfo(), jsniRef, x.getQualifier() != null, ctx.isLvalue()); assert !x.isResolved(); if (!ident.equals(jsniRef.getResolvedReference())) { // Replace by the resolved reference (consisting of the fully qualified classname and the // method description including actual signature) so that dispatch everywhere is consistent // with the one resolved here. ident = jsniRef.getResolvedReference(); JsNameRef newRef = new JsNameRef(x.getSourceInfo(), ident); newRef.setQualifier(x.getQualifier()); ctx.replaceMe(newRef); } if (binding != null) { jsniRefs.put(ident, binding); } }