Skip to content

Commit

Permalink
rhino exits the JVM even when run as a subshell of another java shell…
Browse files Browse the repository at this point in the history
… - bug-835147
  • Loading branch information
rotty3000 authored and Gregory Brail committed Mar 10, 2015
1 parent 7bc14fa commit 06710fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions toolsrc/org/mozilla/javascript/tools/shell/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public static int exec(String origArgs[])
errorReporter = new ToolErrorReporter(false, global.getErr());
shellContextFactory.setErrorReporter(errorReporter);
String[] args = processOptions(origArgs);
if (exitCode > 0) {
return exitCode;
}
if (processStdin) {
fileList.add(null);
}
Expand Down Expand Up @@ -394,7 +397,8 @@ public static String[] processOptions(String args[])
// print usage message
global.getOut().println(
ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName()));
System.exit(1);
exitCode = 1;
return null;
}
usageError = arg;
break goodUsage;
Expand All @@ -404,7 +408,7 @@ public static String[] processOptions(String args[])
ToolErrorReporter.getMessage("msg.shell.invalid", usageError));
global.getOut().println(
ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName()));
System.exit(1);
exitCode = 1;
return null;
}

Expand Down

0 comments on commit 06710fa

Please sign in to comment.