Chromium Code Reviews| Index: runtime/lib/schedule_immediate_patch.dart |
| diff --git a/runtime/lib/schedule_immediate_patch.dart b/runtime/lib/schedule_immediate_patch.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6f05772e50bb93159d5772ad708afa705fe913a3 |
| --- /dev/null |
| +++ b/runtime/lib/schedule_immediate_patch.dart |
| @@ -0,0 +1,18 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +patch void scheduleImmediate(void callback()) { |
| + if (scheduleImmediateClosure == null) { |
| + throw new UnsupportedError("microtasks are not supported"); |
|
Lasse Reichstein Nielsen
2013/11/27 11:41:28
Capital M in Microtasks?
floitsch
2013/11/27 13:57:06
Done.
|
| + } |
| + scheduleImmediateClosure(callback); |
| +} |
| + |
| +typedef void ScheduleImmediateClosure(void callback()); |
| + |
| +ScheduleImmediateClosure scheduleImmediateClosure; |
| + |
| +void setScheduleImmediateClosure(ScheduleImmediateClosure closure) { |
| + scheduleImmediateClosure = closure; |
| +} |