load method

Future<VMIsolate> load ()

Loads the full representation of this isolate.

Throws a VMSentinelException if this isolate is no longer available.

Implementation

Future<VMIsolate> load() async {
  var response = await _scope.sendRequest("getIsolate");

  // Work around sdk#24142.
  if (response["type"] == "Error") {
    throw new VMSentinelException(VMSentinel.collected);
  } else if (response["type"] == "Sentinel") {
    throw new VMSentinelException(newVMSentinel(response));
  } else {
    return response["rootLib"] == null ||
            // Work around sdk#24140
            response["rootLib"]["type"] == "@Instance"
        ? new VMIsolate._(_scope, response)
        : new VMRunnableIsolate._(_scope, response);
  }
}