| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // |
| 5 library regress; |
| 6 |
| 7 import 'dart:isolate'; |
| 8 |
| 9 abstract class N<T> { |
| 10 |
| 11 } |
| 12 |
| 13 class J extends N<String> { |
| 14 final String s; |
| 15 J(this.s); |
| 16 } |
| 17 |
| 18 class K extends N<int> { |
| 19 final int i; |
| 20 K(this.i); |
| 21 } |
| 22 |
| 23 void isolate(SendPort port) { |
| 24 port.send(new J("8" * 4)); |
| 25 for (int i=0; i<80000; i++) { |
| 26 port.send(new K(i)); |
| 27 } |
| 28 port.send('done'); |
| 29 } |
| 30 |
| 31 main() async { |
| 32 var recv = new RawReceivePort(); |
| 33 recv.handler = (k) { |
| 34 if (k is J) print(k.s.length); |
| 35 if (k is String) { |
| 36 print(k); |
| 37 recv.close(); |
| 38 } |
| 39 }; |
| 40 var iso = await Isolate.spawn(isolate, recv.sendPort); |
| 41 } |
| 42 |
| OLD | NEW |