OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library _isolate_helper; | 5 library _isolate_helper; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection' show Queue, HashMap; |
8 import 'dart:isolate'; | 9 import 'dart:isolate'; |
9 | 10 |
10 ReceivePort lazyPort; | 11 ReceivePort lazyPort; |
11 | 12 |
12 /** | 13 /** |
13 * Called by the compiler to support switching | 14 * Called by the compiler to support switching |
14 * between isolates when we get a callback from the DOM. | 15 * between isolates when we get a callback from the DOM. |
15 */ | 16 */ |
16 void _callInIsolate(_IsolateContext isolate, Function function) { | 17 void _callInIsolate(_IsolateContext isolate, Function function) { |
17 isolate.eval(function); | 18 isolate.eval(function); |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 JS('void', '#.clearInterval(#)', globalThis, _handle); | 1329 JS('void', '#.clearInterval(#)', globalThis, _handle); |
1329 } | 1330 } |
1330 _handle = null; | 1331 _handle = null; |
1331 } else { | 1332 } else { |
1332 throw new UnsupportedError("Canceling a timer."); | 1333 throw new UnsupportedError("Canceling a timer."); |
1333 } | 1334 } |
1334 } | 1335 } |
1335 } | 1336 } |
1336 | 1337 |
1337 bool hasTimer() => JS('', '#.setTimeout', globalThis) != null; | 1338 bool hasTimer() => JS('', '#.setTimeout', globalThis) != null; |
OLD | NEW |