| Index: runtime/lib/isolate_patch.dart
|
| diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
|
| index 1313609002de2d77afab21a30c262f499610bcf0..eb88de61913ad044aeae36d32dfe8c608ae980b1 100644
|
| --- a/runtime/lib/isolate_patch.dart
|
| +++ b/runtime/lib/isolate_patch.dart
|
| @@ -17,6 +17,8 @@ patch class Capability {
|
|
|
| class _CapabilityImpl implements Capability {
|
| factory _CapabilityImpl() native "CapabilityImpl_factory";
|
| +
|
| + String toString() => "Capability#";
|
| }
|
|
|
| patch class RawReceivePort {
|
| @@ -245,6 +247,10 @@ void _startIsolate(SendPort parentPort,
|
| }
|
|
|
| patch class Isolate {
|
| + static final _currentIsolate = _getCurrentIsolate();
|
| +
|
| + /* patch */ static Isolate get current => _currentIsolate;
|
| +
|
| /* patch */ static Future<Isolate> spawn(
|
| void entryPoint(message), var message, { bool paused: false }) {
|
| // `paused` isn't handled yet.
|
| @@ -368,4 +374,14 @@ patch class Isolate {
|
| /* patch */ void removeErrorListener(SendPort port) {
|
| throw new UnsupportedError("removeErrorListener");
|
| }
|
| +
|
| + static Isolate _getCurrentIsolate() {
|
| + List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate();
|
| + return new Isolate(portAndCapabilities[0],
|
| + pauseCapability: portAndCapabilities[1],
|
| + terminateCapability: portAndCapabilities[2]);
|
| + }
|
| +
|
| + static List _getPortAndCapabilitiesOfCurrentIsolate()
|
| + native "Isolate_getPortAndCapabilitiesOfCurrentIsolate";
|
| }
|
|
|