OLD | NEW |
1 library; | 1 library; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:isolate" as iso; | 4 import "dart:isolate" as iso; |
5 | 5 |
6 static field dynamic subscription = null; | 6 static field dynamic subscription; |
7 static method onData(dynamic x) → void { | 7 static method onData(dynamic x) → void { |
8 core::print(x); | 8 core::print(x); |
9 self::subscription.cancel(); | 9 self::subscription.cancel(); |
10 } | 10 } |
11 static method main() → dynamic { | 11 static method main() → dynamic { |
12 dynamic string = core::String::fromCharCode(65); | 12 dynamic string = core::String::fromCharCode(65); |
13 dynamic port = iso::ReceivePort::•(); | 13 dynamic port = new iso::_ReceivePortImpl::•(); |
14 self::subscription = port.listen(self::onData); | 14 self::subscription = port.listen(self::onData); |
15 port.sendPort.send(string); | 15 port.sendPort.send(string); |
16 } | 16 } |
OLD | NEW |