4b7d256a06
This reverts commite9ca6a5335andd3e00fd35e. Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Vijay Menon <vsm@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
19 lines
523 B
Plaintext
19 lines
523 B
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:isolate" as iso;
|
|
|
|
import "dart:isolate";
|
|
|
|
static field dynamic subscription;
|
|
static method onData(dynamic x) → void {
|
|
core::print(x);
|
|
self::subscription.cancel();
|
|
}
|
|
static method main() → dynamic {
|
|
core::String string = core::String::fromCharCode(65);
|
|
iso::ReceivePort port = iso::ReceivePort::•();
|
|
self::subscription = port.{iso::ReceivePort::listen}(self::onData);
|
|
port.{iso::ReceivePort::sendPort}.{iso::SendPort::send}(string);
|
|
}
|