parse("foo();\nbar;\n}").error("test.js(3): syntax error\n> }\n> -^");
}
private Result parse(String js) {
try {
JsProgram program = new JsProgram();
SourceInfo rootSourceInfo = program.createSourceInfo(1, "test.js");
JsBlock block = program.getGlobalBlock();
JsParser.parseInto(rootSourceInfo, program.getScope(), block,
new StringReader(js));
return new Result(block);
} catch (IOException e) {
throw new RuntimeException("Unexpected error reading in-memory stream", e);
} catch (JsParserException e) {