Totally reasonable fix, but this may break small things, so keep an eye out.

If the arg specified is null, do not wrap it into an array! It prevents you
from being able to call a function and falling back to the default value
for the argument. Instead, only wrap non-null.
If you really do want to pass null as your arg, you'll have to wrap it in
an array.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5197 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2008-06-26 22:41:05 +00:00
parent 3e8061359f
commit 85f269f3e6
+4 -1
View File
@@ -41,7 +41,10 @@ public class CommandEvent extends Event
var fn :Function = (cmdOrFn as Function);
// build our args array
var args :Array;
if (arg is Array) {
if (arg == null) {
args = null;
} else if (arg is Array) {
// if we were passed an array, treat it as the arg array.
// Note: if you want to pass a single array param, you've
// got to wrap it in another array, so sorry.