| 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:isolate library. | 5 // Patch file for the dart:isolate library. |
| 6 | 6 |
| 7 patch ReceivePort get port { | 7 patch ReceivePort get port { |
| 8 if (lazyPort == null) { | 8 if (lazyPort == null) { |
| 9 lazyPort = new ReceivePort(); | 9 lazyPort = new ReceivePort(); |
| 10 } | 10 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 /** Default factory for receive ports. */ | 23 /** Default factory for receive ports. */ |
| 24 patch class ReceivePort { | 24 patch class ReceivePort { |
| 25 patch factory ReceivePort() { | 25 patch factory ReceivePort() { |
| 26 return new ReceivePortImpl(); | 26 return new ReceivePortImpl(); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 patch class Timer { | 30 patch class Timer { |
| 31 patch factory Timer(int milliseconds, void callback(Timer timer)) { | 31 patch factory Timer(int milliseconds, void callback(Timer timer)) { |
| 32 if (!hasTimer()) { | 32 if (!hasWindow()) { |
| 33 throw new UnsupportedError("Timer interface not supported."); | 33 throw new UnsupportedError("Timer interface not supported."); |
| 34 } | 34 } |
| 35 return new TimerImpl(milliseconds, callback); | 35 return new TimerImpl(milliseconds, callback); |
| 36 } | 36 } |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Creates a new repeating timer. The [callback] is invoked every | 39 * Creates a new repeating timer. The [callback] is invoked every |
| 40 * [milliseconds] millisecond until cancelled. | 40 * [milliseconds] millisecond until cancelled. |
| 41 */ | 41 */ |
| 42 patch factory Timer.repeating(int milliseconds, void callback(Timer timer)) { | 42 patch factory Timer.repeating(int milliseconds, void callback(Timer timer)) { |
| 43 if (!hasTimer()) { | 43 if (!hasWindow()) { |
| 44 throw new UnsupportedError("Timer interface not supported."); | 44 throw new UnsupportedError("Timer interface not supported."); |
| 45 } | 45 } |
| 46 return new TimerImpl.repeating(milliseconds, callback); | 46 return new TimerImpl.repeating(milliseconds, callback); |
| 47 } | 47 } |
| 48 } | 48 } |
| OLD | NEW |