evaluate method

Future<VMInstanceRef> evaluate (String expression)

Evaluates expression in the context of this frame.

Throws a VMErrorException if evaluating the expression throws an error. Throws a VMSentinelException if this frame has expired.

Implementation

Future<VMInstanceRef> evaluate(String expression) async {
  var result = await _scope.sendRequest(
      "evaluateInFrame", {"frameIndex": index, "expression": expression});

  switch (result["type"]) {
    case "@Error":
      throw new VMErrorException(newVMErrorRef(_scope, result));
    case "@Instance":
      return newVMInstanceRef(_scope, result);
    default:
      throw new StateError('Unexpected Object type "${result["type"]}".');
  }
}