Project
jangaroo-tools
Priority
Minor
Type
Bug
State
Submitted
Assignee
Unassigned
Subsystem
jooc
Fix versions
No Fix versions
Affected versions
0.9.6, 0.9.7, 0.9.9
Fixed in build
Next Build
  • Created by   Frank Wienberg
    3 months ago (30 Jan 2012 12:01)
  • Updated by   Frank Wienberg
    3 months ago (10 Feb 2012 10:12)
 
JOO-12 arguments variable is not an Array
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
In ActionScript, like in JavaScript, there is an implicit arguments variable holding all formal parameters. The difference is that in ActionScript, this variable holds a real Array, not an indexed Object like in JavaScript. Like for the ... (rest) parameter, Jangaroo should add conversion code automatically.
Example:

public function argumentsToString(a:String, b:String):String {
  return arguments.join(",");
}

works in ActionScript, but not in Jangaroo, as the join method is not defined on the JavaScript arguments object.
Also, when using arguments as a .... (rest) parameter, Jangaroo optimizes away the Array conversion code, resulting in the same problem:

public function argumentsToString(...args):String {
  return args.join(",");
}

works, but

public function argumentsToString(...arguments):String {
  return arguments.join(",");
}

does not. :-(
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments