Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: sdk/lib/isolate/isolate.dart

Issue 2563723003: Revert "Let `Isolate.errors` close on isolate exit." (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/isolate/isolate_errors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
});
« no previous file with comments | « no previous file | tests/isolate/isolate_errors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698