diff options
author | lana <none@none> | 2013-08-23 14:18:06 -0700 |
---|---|---|
committer | lana <none@none> | 2013-08-23 14:18:06 -0700 |
commit | d2d49a0797d942977f91a0f0c94cbb13d21bdabc (patch) | |
tree | f74870f792116e1e841f9e1482269c48faaa8def /src/jdk/nashorn/tools/Shell.java | |
parent | b3da2916d15cbbcfc9d5a270f319c896e751d9f2 (diff) | |
parent | 01a5c8fbf1b428c78951fcb29b041c57f6793195 (diff) |
Mergejdk8-b105
Diffstat (limited to 'src/jdk/nashorn/tools/Shell.java')
-rw-r--r-- | src/jdk/nashorn/tools/Shell.java | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/jdk/nashorn/tools/Shell.java b/src/jdk/nashorn/tools/Shell.java index 55840078..713f92c4 100644 --- a/src/jdk/nashorn/tools/Shell.java +++ b/src/jdk/nashorn/tools/Shell.java @@ -34,8 +34,6 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintStream; import java.io.PrintWriter; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.List; import java.util.Locale; import java.util.ResourceBundle; @@ -68,18 +66,7 @@ public class Shell { /** * Shell message bundle. */ - private static ResourceBundle bundle; - - static { - // Without do privileged, under security manager messages can not be - // loaded. - bundle = AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() { - @Override - public ResourceBundle run() { - return ResourceBundle.getBundle(MESSAGE_RESOURCE, Locale.getDefault()); - } - }); - } + private static final ResourceBundle bundle = ResourceBundle.getBundle(MESSAGE_RESOURCE, Locale.getDefault()); /** * Exit code for command line tool - successful @@ -305,6 +292,14 @@ public class Shell { // For each file on the command line. for (final String fileName : files) { + if ("-".equals(fileName)) { + final int res = readEvalPrint(context, global); + if (res != SUCCESS) { + return res; + } + continue; + } + final File file = new File(fileName); final ScriptFunction script = context.compileScript(new Source(fileName, file.toURI().toURL()), global); if (script == null || errors.getNumberOfErrors() != 0) { |