private void compile() {
Context ctx = Context.enter();
try {
// Note: used compileReader instead of compileString to work with the older Rhino in C2.1
this.script = ctx.compileReader(FlowObjectModelHelper.getScope(), new StringReader(getExpression()), "", 1, null);
} catch (Exception e) {
// Note: this catch block is only needed for the Rhino in C2.1 where the older
// Rhino does not throw RuntimeExceptions
if (e instanceof RuntimeException) {
throw (RuntimeException)e;