return false;
}
private void findJsniRefsAccurately(MethodDeclaration methodDeclaration,
String jsniCode) throws InternalCompilerException {
JsParser jsParser = new JsParser();
JsProgram jsProgram = new JsProgram();
String syntheticFnHeader = "function(";
boolean first = true;
if (methodDeclaration.arguments != null) {
for (int i = 0, c = methodDeclaration.arguments.length; i < c; ++i) {
Argument arg = methodDeclaration.arguments[i];
if (first) {
first = false;
} else {
syntheticFnHeader += ',';
}
syntheticFnHeader += String.valueOf(arg.name);
}
}
syntheticFnHeader += ')';
StringReader sr = new StringReader(syntheticFnHeader + '\n' + jsniCode);
try {
// start at -1 to avoid counting our synthetic header
List<JsStatement> result = jsParser.parse(jsProgram.getScope(), sr, -1);
new JsVisitor() {
public void endVisit(JsNameRef x, JsContext<JsExpression> ctx) {
String ident = x.getIdent();
if (ident.charAt(0) == '@') {
jsniRefs.add(ident.substring(1));