evaluateInFrame method

Future<Response> evaluateInFrame(
  1. String isolateId,
  2. int frameIndex,
  3. String expression, {
  4. Map<String, String>? scope,
  5. bool? disableBreakpoints,
})

The evaluateInFrame RPC is used to evaluate an expression in the context of a particular stack frame. frameIndex is the index of the desired Frame, with an index of 0 indicating the top (most recent) frame.

If scope is provided, it should be a map from identifiers to object ids. These bindings will be added to the scope in which the expression is evaluated, which is a child scope of the frame's current scope. This means bindings provided in scope may shadow instance members, class members, top-level members, parameters and locals.

If disableBreakpoints is provided and set to true, any breakpoints hit as a result of this evaluation are ignored. Defaults to false if not provided.

If the expression fails to parse and compile, then RPCError 113 "Expression compilation error" is returned.

If an error occurs while evaluating the expression, an ErrorRef reference will be returned.

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

If isolateId refers to an isolate which has exited, then the Collected Sentinel is 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> evaluateInFrame(
  String isolateId,
  int frameIndex,
  String expression, {
  Map<String, String>? scope,
  bool? disableBreakpoints,
}) =>
    _call('evaluateInFrame', {
      'isolateId': isolateId,
      'frameIndex': frameIndex,
      'expression': expression,
      if (scope != null) 'scope': scope,
      if (disableBreakpoints != null)
        'disableBreakpoints': disableBreakpoints,
    });