| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Note: the following comment is used by test.dart to additionally compile the |
| 6 // other isolate's code. |
| 7 // OtherScripts=issue_21398_child_isolate.dart |
| 8 |
| 5 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 6 import 'dart:async'; | 10 import 'dart:async'; |
| 7 import "package:expect/expect.dart"; | 11 import "package:expect/expect.dart"; |
| 8 | 12 |
| 9 class FromMainIsolate { | 13 class FromMainIsolate { |
| 10 String toString() => 'from main isolate'; | 14 String toString() => 'from main isolate'; |
| 11 int get fld => 10; | 15 int get fld => 10; |
| 12 } | 16 } |
| 13 | 17 |
| 14 funcChild(args) { | 18 funcChild(args) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 (msg) { | 60 (msg) { |
| 57 Expect.isTrue(msg is FromMainIsolate); | 61 Expect.isTrue(msg is FromMainIsolate); |
| 58 Expect.equals(10, msg.fld); | 62 Expect.equals(10, msg.fld); |
| 59 receive2.close(); | 63 receive2.close(); |
| 60 }, | 64 }, |
| 61 onError: (e) => print('$e') | 65 onError: (e) => print('$e') |
| 62 ); | 66 ); |
| 63 } | 67 } |
| 64 ); | 68 ); |
| 65 } | 69 } |
| OLD | NEW |