Abstract Stack Call

Calls a function by reading the arguments from the stack.

Examples

function hello(name) {
  trace("Hello, " + name + "!);
}

@push("OpenFlash");
@stackCall(hello, 1);
function makeArray() {
  var array = [];
  for (var i = 0; i < arguments.length; i++) {
    array.push(arguments[i]);
  }
  return array;
}

var argCount;
if (Math.random() < 0.5) {
  @push("foo");
  @push("bar");
  argCount = 2;
} else {
  @push("baz");
  argCount = 1;
}

var strings = @stackCall(makeArray, argCount);

Syntax

Syntax
AbstractStackCall :
   @stackCall TRIVIA?
   ( TRIVIA?
   AssignmentExpression TRIVIA?
   , TRIVIA?
   AssignmentExpression TRIVIA?
   )

Abstract type

TODO

{
  type: "OpStackCall";
  callee: Expression;
  argumentCount: Expression;
}