| 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 { |
| 10 |
| 11 } |
| 12 |
| 13 class J extends N { |
| 14 final String s; |
| 15 J(this.s); |
| 16 } |
| 17 |
| 18 class K extends N { |
| 19 final int i; |
| 20 K(this.i); |
| 21 } |
| 22 |
| 23 void isolate(SendPort port) { |
| 24 port.send(N); |
| 25 port.send(new J("8" * 4)); |
| 26 for (int i=0; i<80000; i++) { |
| 27 port.send(new K(i)); |
| 28 } |
| 29 port.send('done'); |
| 30 } |
| 31 |
| 32 main() async { |
| 33 var recv = new RawReceivePort(); |
| 34 recv.handler = (k) { |
| 35 if (k is J) print(k.s.length); |
| 36 if (k is String) { |
| 37 print(k); |
| 38 recv.close(); |
| 39 } |
| 40 }; |
| 41 var iso = await Isolate.spawn(isolate, recv.sendPort); |
| 42 } |
| 43 |
| OLD | NEW |