diff --git a/mozilla/js/rhino/examples/Shell.java b/mozilla/js/rhino/examples/Shell.java index dd21ba77e71..5e61c47ce7a 100644 --- a/mozilla/js/rhino/examples/Shell.java +++ b/mozilla/js/rhino/examples/Shell.java @@ -80,8 +80,10 @@ public class Shell extends ScriptableObject // Set up "arguments" in the global scope to contain the command // line arguments after the name of the script to execute - Object[] array = args; - if (args.length > 0) { + Object[] array; + if (args.length == 0) { + array = new Object[0]; + } else { int length = args.length - 1; array = new Object[length]; System.arraycopy(args, 1, array, 0, length); @@ -128,7 +130,7 @@ public class Shell extends ScriptableObject private static void usage(String s) { p("Didn't understand \"" + s + "\"."); p("Valid arguments are:"); - p("-version 100|110|120|130|140|150"); + p("-version 100|110|120|130|140|150|160|170"); System.exit(1); }