From 69bd8e7c5bc0e44f74cfdf82373bbdb32a3fa96a Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 5 May 2022 16:58:55 +0000 Subject: [PATCH] [core libs] address ~5 analysis issues in the docs for dart:isolate Change-Id: Iebe275335fd098419ede97dbb8baff8efaf9dc1e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241161 Reviewed-by: Jonas Termansen Reviewed-by: Lasse Nielsen Reviewed-by: William Hesse Commit-Queue: Devon Carew --- sdk/lib/isolate/isolate.dart | 10 ++++++++-- tools/bots/test_matrix.json | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart index 8098a0f463f..60d68999717 100644 --- a/sdk/lib/isolate/isolate.dart +++ b/sdk/lib/isolate/isolate.dart @@ -24,6 +24,12 @@ import "dart:typed_data" show ByteBuffer, TypedData, Uint8List; part "capability.dart"; +// Examples can assume: +// Isolate findSomeIsolate() => Isolate.current; +// void untrustedCode(Isolate isolate) {} +// RawReceivePort rawPort = RawReceivePort(); +// void actualHandler() {} + /// Thrown when an isolate cannot be created. class IsolateSpawnException implements Exception { /// Error message reported by the spawn operation. @@ -734,8 +740,8 @@ abstract class RawReceivePort { /// /// The handler is invoked in the [Zone.root] zone. /// If the handler should be invoked in the current zone, do: - /// ```dart - /// rawPort.handler = Zone.current.bind(actualHandler); + /// ```dart import:async + /// rawPort.handler = Zone.current.bindCallback(actualHandler); /// ``` /// /// The handler must be a function which can accept one argument diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json index 7bab85127a6..b24317379d0 100644 --- a/tools/bots/test_matrix.json +++ b/tools/bots/test_matrix.json @@ -3688,6 +3688,7 @@ "dart:convert", "dart:developer", "dart:ffi", + "dart:isolate", "dart:js", "dart:js_util", "dart:math",