LuaObject.func constructor

LuaObject.func(
  1. String id,
  2. FuncExpr def,
  3. Function closure
)

Constructs a lua function with id for its function name in scope with some closure to be written to the metamethod '__call'. A required def is needed to determine the input arguments and other runtime information.

Implementation

LuaObject.func(this.id, FuncExpr def, Function closure) : super() {
  _fields = {};
  funcDef = def;
  writeField('__call', closure);
}