test/src/jdk/nashorn/internal/test/framework/SharedContextEvaluator.java

Print this page

        

*** 32,45 **** import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import jdk.nashorn.api.scripting.NashornException; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.ErrorManager; import jdk.nashorn.internal.runtime.ScriptFunction; - import jdk.nashorn.internal.runtime.ScriptObject; import jdk.nashorn.internal.runtime.ScriptRuntime; import jdk.nashorn.internal.runtime.Source; import jdk.nashorn.internal.runtime.options.Options; /** --- 32,45 ---- import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import jdk.nashorn.api.scripting.NashornException; + import jdk.nashorn.internal.objects.Global; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.ErrorManager; import jdk.nashorn.internal.runtime.ScriptFunction; import jdk.nashorn.internal.runtime.ScriptRuntime; import jdk.nashorn.internal.runtime.Source; import jdk.nashorn.internal.runtime.options.Options; /**
*** 108,123 **** this.context = new Context(options, errors, wout, werr, Thread.currentThread().getContextClassLoader()); } @Override public int run(final OutputStream out, final OutputStream err, final String[] args) throws IOException { ! final ScriptObject oldGlobal = Context.getGlobal(); try { ctxOut.setDelegatee(out); ctxErr.setDelegatee(err); final ErrorManager errors = context.getErrorManager(); ! final ScriptObject global = context.createGlobal(); Context.setGlobal(global); // For each file on the command line. for (final String fileName : args) { if (fileName.startsWith("-")) { --- 108,123 ---- this.context = new Context(options, errors, wout, werr, Thread.currentThread().getContextClassLoader()); } @Override public int run(final OutputStream out, final OutputStream err, final String[] args) throws IOException { ! final Global oldGlobal = Context.getGlobal(); try { ctxOut.setDelegatee(out); ctxErr.setDelegatee(err); final ErrorManager errors = context.getErrorManager(); ! final Global global = context.createGlobal(); Context.setGlobal(global); // For each file on the command line. for (final String fileName : args) { if (fileName.startsWith("-")) {