invoke method
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 idZoneId
is provided, temporary IDs for InstancesRef
and
Instances
in the RPC response will be allocated in the specified ID
zone. If idZoneId
is omitted, ID allocations will be performed in the
default ID zone for the isolate. See IDs and Names
for more information
about ID zones.
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.
Implementation
Future<Response> invoke(
String isolateId,
String targetId,
String selector,
List<String> argumentIds, {
bool? disableBreakpoints,
String? idZoneId,
}) =>
_call('invoke', {
'isolateId': isolateId,
'targetId': targetId,
'selector': selector,
'argumentIds': argumentIds,
if (disableBreakpoints != null)
'disableBreakpoints': disableBreakpoints,
if (idZoneId != null) 'idZoneId': idZoneId,
});