invoke method

Future<Response> invoke(
  1. String isolateId,
  2. String targetId,
  3. String selector,
  4. List<String> argumentIds,
  5. {bool? disableBreakpoints}

The invoke RPC is used to perform regular method invocation on some receiver, as if by dart:mirror's ObjectMirror.invoke. Note this does not provide a way to perform getter, setter or constructor invocation.

targetId may refer to a Library, Class, or Instance.

Each elements of argumentId may refer to an Instance.

If disableBreakpoints is provided and set to true, any breakpoints hit as a result of this invocation are ignored, including pauses resulting from a call to debugger() from dart:developer. Defaults to false if not provided.

If targetId or any element of argumentIds is a temporary id which has expired, then the Expired Sentinel is returned.

If targetId or any element of argumentIds refers to an object which has been collected by the VM's garbage collector, then the Collected Sentinel is returned.

If isolateId refers to an isolate which has exited, then the Collected Sentinel is returned.

If invocation triggers a failed compilation then RPCError 113 "Expression compilation error" is returned.

If a runtime error occurs while evaluating the invocation, an ErrorRef reference will be returned.

If the invocation is evaluated successfully, an InstanceRef reference will be returned.

The return value can be one of InstanceRef or ErrorRef.

This method will throw a SentinelException in the case a Sentinel is returned.


Future<Response> invoke(
  String isolateId,
  String targetId,
  String selector,
  List<String> argumentIds, {
  bool? disableBreakpoints,
}) =>
    _call('invoke', {
      'isolateId': isolateId,
      'targetId': targetId,
      'selector': selector,
      'argumentIds': argumentIds,
      if (disableBreakpoints != null)
        'disableBreakpoints': disableBreakpoints,