Context.enter();
Context ctx = new StoppableContext();
try {
ctx.setInstructionObserverThreshold(1);
ctx.setOptimizationLevel(-1);
Scriptable scope = ctx.newObject(ctx.initStandardObjects());
getScriptFromClasspath("coffeescript/nb/resources/coffee-script.js").exec(ctx, scope);
scope.put("code", scope, code);
String options = String.format("{bare: %b}", bare);
String script = String.format("CoffeeScript.compile(code, %s);", options);
return (String) getScriptFromString(script).exec(ctx, scope);