Hello,
I am trying to use rhino 1.7R1 to parse some javascript containing
'let' local variables declarations but cannot manage to parse these
without errors. Here is my parser configuratino:
Any clues about that ? (I tried using Context.VERSION_1_7).
protected void checkFile(final Result result, final File file) {
try {
result.files++;
final FileReader input = new FileReader(file);
Object o = new ContextFactory().call(new
ContextAction() {
public Object run(Context cx) {
try {
result.println("checking file "
+ file.getPath());
CompilerEnvirons compilerEnv =
new CompilerEnvirons();
compilerEnv.setLanguageVersion(170);
compilerEnv.initFromContext(cx);
ErrorReporter
compilationErrorReporter = compilerEnv
.getErrorReporter();
Parser p = new
Parser(compilerEnv,
compilationErrorReporter);
return p.parse(input,
file.getPath(), 1);
} catch (IOException e) {
return e;
} catch (Exception e) {
throw new
JSSyntaxError(e.getMessage());
}
}
});
} catch (JSSyntaxError e) {
result.error("** Syntax Error (" + file.getPath() + "):
"
+ e.getMessage());
result.failures++;
} catch (IOException e) {
result.error("**** I/O Error(" + file.getPath() + "): "
+ e.getMessage());
result.errors++;
}
}
THanks for your attention
Arnaud Bailly
Courtanet
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino