[docs] Update Isolate.spawn doc to remove top-level function/static method restriction.

The restriction was lifted in 5f9ec9f52a.

Fixes https://github.com/dart-lang/sdk/issues/50009

TESt=ci

Change-Id: I5a6c063fe558d4dd305ec4c78bf998f4f3750c89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260403
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev 2022-09-22 07:45:41 +00:00 committed by Commit Bot
parent fea406591e
commit 92638bf5d3

View file

@ -293,15 +293,11 @@ class Isolate {
/// The entry-point function is invoked in the new isolate with [message]
/// as the only argument.
///
/// The function must be a top-level function or a static method
/// that can be called with a single argument,
/// that is, a compile-time constant function value
/// which accepts at least one positional parameter
/// The function must be such that it can be called with a single argument,
/// that is, a function which accepts at least one positional parameter
/// and has at most one required positional parameter.
/// The function may accept any number of optional parameters,
/// as long as it *can* be called with just a single argument.
/// The function must not be the value of a function expression
/// or an instance method tear-off.
///
/// Usually the initial [message] contains a [SendPort] so
/// that the spawner and spawnee can communicate with each other.