internal_invokeByNamedArguments method

AsyncReply internal_invokeByNamedArguments(
  1. int index,
  2. Structure namedArgs
)

Implementation

AsyncReply<dynamic> internal_invokeByNamedArguments(
    int index, Structure namedArgs) {
  if (_destroyed) throw new Exception("Trying to access destroyed object");
  if (_suspended) throw new Exception("Trying to access suspended object");

  if (instance == null) throw Exception("Object not initialized.");

  var ins = instance as Instance;

  if (index >= ins.template.functions.length)
    throw new Exception("Function index is incorrect");

  return connection?.sendInvokeByNamedArguments(
      _instanceId as int, index, namedArgs) as AsyncReply<dynamic>;
}