< prev index next >
src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java
Print this page
rev 52725 : [mq]: 8214491-updates
*** 25,51 ****
package jdk.nashorn.tools.jjs;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
- import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
- import java.io.InputStreamReader;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedAction;
- import java.util.concurrent.Callable;
import java.util.function.Consumer;
! import java.util.function.Function;
! import jdk.internal.jline.console.completer.Completer;
! import jdk.internal.jline.console.UserInterruptException;
! import jdk.nashorn.api.scripting.NashornException;
import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.objects.NativeJava;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.NativeJavaPackage;
import jdk.nashorn.internal.runtime.Property;
--- 25,46 ----
package jdk.nashorn.tools.jjs;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.function.Consumer;
!
! import jdk.internal.org.jline.reader.UserInterruptException;
import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.objects.NativeJava;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.NativeJavaPackage;
import jdk.nashorn.internal.runtime.Property;
*** 176,186 ****
global.addShellBuiltins();
// redefine readLine to use jline Console's readLine!
ScriptingFunctions.setReadLineHelper(str-> {
try {
! return in.readLine(str);
} catch (final IOException ioExp) {
throw new UncheckedIOException(ioExp);
}
});
--- 171,181 ----
global.addShellBuiltins();
// redefine readLine to use jline Console's readLine!
ScriptingFunctions.setReadLineHelper(str-> {
try {
! return in.readUserLine(str);
} catch (final IOException ioExp) {
throw new UncheckedIOException(ioExp);
}
});
*** 207,219 ****
// 'edit' command
global.addOwnProperty("edit", Property.NOT_ENUMERABLE, new EditObject(in, err::println, evaluator));
}
while (true) {
! String source = "";
try {
! source = in.readLine(prompt);
} catch (final IOException ioe) {
err.println(ioe.toString());
if (env._dump_on_error) {
ioe.printStackTrace(err);
}
--- 202,214 ----
// 'edit' command
global.addOwnProperty("edit", Property.NOT_ENUMERABLE, new EditObject(in, err::println, evaluator));
}
while (true) {
! String source;
try {
! source = in.readLine(prompt, prompt2);
} catch (final IOException ioe) {
err.println(ioe.toString());
if (env._dump_on_error) {
ioe.printStackTrace(err);
}
< prev index next >