Actionscript, you are too strange.
I thought I was casting: Function(myObject) I gotta remember that the function-looking variants do more than cast. For example: var o :Object = null; var s :String = String(o); trace(s.length); // outputs 4. (s === "null", now) Apparently Function(args) tries to evaluate the arguments as if they were code. Switched to casting like (args as Function); git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4539 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -66,12 +66,14 @@ public class MethodQueue
|
||||
|
||||
// safely call each function
|
||||
for each (var arr :Array in methods) {
|
||||
var fn :Function = (arr[0] as Function);
|
||||
var args :Array = (arr[1] as Array);
|
||||
try {
|
||||
Function(arr[0]).apply(null, (arr[1] as Array));
|
||||
fn.apply(null, args);
|
||||
|
||||
} catch (e :Error) {
|
||||
Log.getLog(MethodQueue).warning("Error calling deferred method " +
|
||||
"[e=" + e + ", fn=" + arr[0] + "].");
|
||||
"[e=" + e + ", fn=" + fn + ", args=" + args + "].");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user