--- a/src/java.scripting/share/classes/javax/script/AbstractScriptEngine.java Mon Apr 23 10:59:39 2018 -0500
+++ b/src/java.scripting/share/classes/javax/script/AbstractScriptEngine.java Mon Apr 23 18:14:35 2018 +0200
@@ -287,7 +287,7 @@
*/
protected ScriptContext getScriptContext(Bindings nn) {
- SimpleScriptContext ctxt = new SimpleScriptContext();
+ SimpleScriptContext ctxt = new SimpleScriptContext(context.getReader(), context.getWriter(), context.getErrorWriter());
Bindings gs = getBindings(ScriptContext.GLOBAL_SCOPE);
if (gs != null) {
@@ -301,10 +301,6 @@
throw new NullPointerException("Engine scope Bindings may not be null.");
}
- ctxt.setReader(context.getReader());
- ctxt.setWriter(context.getWriter());
- ctxt.setErrorWriter(context.getErrorWriter());
-
return ctxt;
}