Always need Object[] rather than String[] for Context.newArray().

git-svn-id: svn://10.0.0.236/trunk@230352 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com
2007-07-20 11:59:51 +00:00
parent 9aeb50a55b
commit f6310de50e

View File

@@ -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);
}