bindings = verifySlingBindings(scriptName, props);
ScriptContext ctx = new SimpleScriptContext();
ctx.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
ctx.setReader((Reader) bindings.get(READER));
ctx.setWriter((Writer) bindings.get(OUT));
<BUG>ctx.setErrorWriter(new LogWriter((Logger) bindings.get(LOG)));
reader = getScriptReader();</BUG>
if ( method != null && !(this.scriptEngine instanceof Invocable)) {
reader = getWrapperReader(reader, method, args);
}

bindings = verifySlingBindings(scriptName, props);
ScriptContext ctx = new SimpleScriptContext();
ctx.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
ctx.setReader((Reader) bindings.get(READER));
ctx.setWriter((Writer) bindings.get(OUT));
ctx.setErrorWriter(new LogWriter((Logger) bindings.get(LOG)));
requestResourceResolver.set(props.getRequest().getResourceResolver());
ctx.setAttribute(SlingScriptConstants.ATTR_SCRIPT_RESOURCE_RESOLVER,
this.scriptResource.getResourceResolver(), ScriptContext.ENGINE_SCOPE);
reader = getScriptReader();
if ( method != null && !(this.scriptEngine instanceof Invocable)) {
reader = getWrapperReader(reader, method, args);
}
