Index: sdk/lib/isolate/isolate.dart |
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart |
index df7d10465785c888b929927a80f83d51975454f2..424742a15b1d47dbc07d9d6df02f2e9de88d0807 100644 |
--- a/sdk/lib/isolate/isolate.dart |
+++ b/sdk/lib/isolate/isolate.dart |
@@ -522,40 +522,25 @@ class Isolate { |
* be the same object types as in the actual isolate, but they will |
* always have the same [Object.toString] result. |
* |
- * The returned stream is done when the isolate terminates. |
- * |
- * If the isolate has already terminated, the stream will never emit |
- * any events, not even a done event. |
- * If the isolate terminates while nobody is listening, the returned |
- * stream will also not emit a done event. |
- * |
- * This stream is based on [addErrorListener], [removeErrorListener], |
- * [addOnExitListener] and [removeOnExitListener]. |
+ * This stream is based on [addErrorListener] and [removeErrorListener]. |
*/ |
Stream get errors { |
StreamController controller; |
RawReceivePort port; |
void handleError(message) { |
- if (message != null) { |
- String errorDescription = message[0]; |
- String stackDescription = message[1]; |
- var error = new RemoteError(errorDescription, stackDescription); |
- controller.addError(error, error.stackTrace); |
- } else { |
- port.close(); |
- controller.close(); |
- } |
+ String errorDescription = message[0]; |
+ String stackDescription = message[1]; |
+ var error = new RemoteError(errorDescription, stackDescription); |
+ controller.addError(error, error.stackTrace); |
} |
controller = new StreamController.broadcast( |
sync: true, |
onListen: () { |
port = new RawReceivePort(handleError); |
- this.addOnExitListener(port.sendPort); |
this.addErrorListener(port.sendPort); |
}, |
onCancel: () { |
this.removeErrorListener(port.sendPort); |
- this.removeOnExitListener(port.sendPort); |
port.close(); |
port = null; |
}); |