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 // Patch file for the dart:async library. | 5 // Patch file for the dart:async library. |
6 | 6 |
7 import 'dart:_isolate_helper' show TimerImpl; | 7 import 'dart:_isolate_helper' show TimerImpl; |
8 | 8 |
9 typedef void _TimerCallback0(); | 9 typedef void _TimerCallback0(); |
10 typedef void _TimerCallback1(Timer timer); | 10 typedef void _TimerCallback1(Timer timer); |
(...skipping 20 matching lines...) Expand all Loading... |
31 * [milliseconds] millisecond until cancelled. | 31 * [milliseconds] millisecond until cancelled. |
32 */ | 32 */ |
33 patch factory Timer.repeating(var duration, void callback(Timer timer)) { | 33 patch factory Timer.repeating(var duration, void callback(Timer timer)) { |
34 // TODO(floitsch): remove this check when we remove the deprecated | 34 // TODO(floitsch): remove this check when we remove the deprecated |
35 // millisecond argument. | 35 // millisecond argument. |
36 int milliseconds = duration is int ? duration : duration.inMilliseconds; | 36 int milliseconds = duration is int ? duration : duration.inMilliseconds; |
37 if (milliseconds < 0) milliseconds = 0; | 37 if (milliseconds < 0) milliseconds = 0; |
38 return new TimerImpl.repeating(milliseconds, callback); | 38 return new TimerImpl.repeating(milliseconds, callback); |
39 } | 39 } |
40 } | 40 } |
| 41 |
| 42 final Set<String> _loadedLibraries = new Set<String>(); |
| 43 |
| 44 patch class DeferredLibrary { |
| 45 patch Future<bool> load() { |
| 46 // TODO(ahe): Implement this. |
| 47 Future future = |
| 48 new Future<bool>.immediate(!_loadedLibraries.contains(libraryName)); |
| 49 _loadedLibraries.add(libraryName); |
| 50 return future; |
| 51 } |
| 52 } |
OLD | NEW |