Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3826)

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 11866003: Support Timer with 0 millisecond delay in dart2js running in the command line. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/pkg.status ('k') | sdk/lib/_internal/compiler/implementation/lib/async_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/enqueue.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/enqueue.dart (revision 16956)
+++ sdk/lib/_internal/compiler/implementation/enqueue.dart (working copy)
@@ -414,11 +414,20 @@
}
// Enable isolate support if we start using something from the
- // isolate library.
+ // isolate library, or timers for the async library.
LibraryElement library = element.getLibrary();
- if (!compiler.hasIsolateSupport()
- && library.uri.toString() == 'dart:isolate') {
- enableIsolateSupport(library);
+ if (!compiler.hasIsolateSupport()) {
+ String uri = library.uri.toString();
+ if (uri == 'dart:isolate') {
+ enableIsolateSupport(library);
+ } else if (uri == 'dart:async') {
+ ClassElement cls = element.getEnclosingClass();
+ if (cls != null && cls.name == const SourceString('Timer')) {
+ // The [:Timer:] class uses the event queue of the isolate
+ // library, so we make sure that event queue is generated.
+ enableIsolateSupport(library);
+ }
+ }
}
return true;
« no previous file with comments | « pkg/pkg.status ('k') | sdk/lib/_internal/compiler/implementation/lib/async_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698