evaluate method

Future<VMInstanceRef> evaluate (
  1. 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.


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);
      throw new StateError('Unexpected Object type "${result["type"]}".');