From f6310de50ef8c19330550f862d1bae48d695e5f6 Mon Sep 17 00:00:00 2001 From: "nboyd%atg.com" Date: Fri, 20 Jul 2007 11:59:51 +0000 Subject: [PATCH] Always need Object[] rather than String[] for Context.newArray(). git-svn-id: svn://10.0.0.236/trunk@230352 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/rhino/examples/Shell.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); }