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

Side by Side Diff: test/dart_codegen/expect/async/schedule_microtask.dart

Issue 1038583004: Rationalize coercions (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 part of dart.async; 1 part of dart.async;
2 typedef void _AsyncCallback(); 2 typedef void _AsyncCallback();
3 class _AsyncCallbackEntry {final _AsyncCallback callback; 3 class _AsyncCallbackEntry {final _AsyncCallback callback;
4 _AsyncCallbackEntry next; 4 _AsyncCallbackEntry next;
5 _AsyncCallbackEntry(this.callback); 5 _AsyncCallbackEntry(this.callback);
6 } 6 }
7 _AsyncCallbackEntry _nextCallback; 7 _AsyncCallbackEntry _nextCallback;
8 _AsyncCallbackEntry _lastCallback; 8 _AsyncCallbackEntry _lastCallback;
9 _AsyncCallbackEntry _lastPriorityCallback; 9 _AsyncCallbackEntry _lastPriorityCallback;
10 bool _isInCallbackLoop = false; 10 bool _isInCallbackLoop = false;
(...skipping 12 matching lines...) Expand all
23 _asyncRunCallbackLoop(); 23 _asyncRunCallbackLoop();
24 } 24 }
25 finally { 25 finally {
26 _lastPriorityCallback = null; 26 _lastPriorityCallback = null;
27 _isInCallbackLoop = false; 27 _isInCallbackLoop = false;
28 if (_nextCallback != null) _AsyncRun._scheduleImmediate(_asyncRunCallback); 28 if (_nextCallback != null) _AsyncRun._scheduleImmediate(_asyncRunCallback);
29 } 29 }
30 } 30 }
31 void _scheduleAsyncCallback(callback) { 31 void _scheduleAsyncCallback(callback) {
32 if (_nextCallback == null) { 32 if (_nextCallback == null) {
33 _nextCallback = _lastCallback = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynamic, __t28, "CastGeneral", """line 66, column 61 of dart:async/schedule_mic rotask.dart: """, callback is __t28, false)); 33 _nextCallback = _lastCallback = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynamic, __t28, "CompositeCast", """line 66, column 61 of dart:async/schedule_m icrotask.dart: """, callback is __t28, false));
34 if (!_isInCallbackLoop) { 34 if (!_isInCallbackLoop) {
35 _AsyncRun._scheduleImmediate(_asyncRunCallback); 35 _AsyncRun._scheduleImmediate(_asyncRunCallback);
36 } 36 }
37 } 37 }
38 else { 38 else {
39 _AsyncCallbackEntry newEntry = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynamic, __t28, "CastGeneral", """line 71, column 60 of dart:async/schedule_micr otask.dart: """, callback is __t28, false)); 39 _AsyncCallbackEntry newEntry = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynamic, __t28, "CompositeCast", """line 71, column 60 of dart:async/schedule_mi crotask.dart: """, callback is __t28, false));
40 _lastCallback.next = newEntry; 40 _lastCallback.next = newEntry;
41 _lastCallback = newEntry; 41 _lastCallback = newEntry;
42 } 42 }
43 } 43 }
44 void _schedulePriorityAsyncCallback(callback) { 44 void _schedulePriorityAsyncCallback(callback) {
45 _AsyncCallbackEntry entry = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynam ic, __t28, "CastGeneral", """line 84, column 55 of dart:async/schedule_microtask .dart: """, callback is __t28, false)); 45 _AsyncCallbackEntry entry = new _AsyncCallbackEntry(DEVC$RT.cast(callback, dynam ic, __t28, "CompositeCast", """line 84, column 55 of dart:async/schedule_microta sk.dart: """, callback is __t28, false));
46 if (_nextCallback == null) { 46 if (_nextCallback == null) {
47 _scheduleAsyncCallback(callback); 47 _scheduleAsyncCallback(callback);
48 _lastPriorityCallback = _lastCallback; 48 _lastPriorityCallback = _lastCallback;
49 } 49 }
50 else if (_lastPriorityCallback == null) { 50 else if (_lastPriorityCallback == null) {
51 entry.next = _nextCallback; 51 entry.next = _nextCallback;
52 _nextCallback = _lastPriorityCallback = entry; 52 _nextCallback = _lastPriorityCallback = entry;
53 } 53 }
54 else { 54 else {
55 entry.next = _lastPriorityCallback.next; 55 entry.next = _lastPriorityCallback.next;
56 _lastPriorityCallback.next = entry; 56 _lastPriorityCallback.next = entry;
57 _lastPriorityCallback = entry; 57 _lastPriorityCallback = entry;
58 if (entry.next == null) { 58 if (entry.next == null) {
59 _lastCallback = entry; 59 _lastCallback = entry;
60 } 60 }
61 } 61 }
62 } 62 }
63 void scheduleMicrotask(void callback()) { 63 void scheduleMicrotask(void callback()) {
64 if (identical(_ROOT_ZONE, Zone.current)) { 64 if (identical(_ROOT_ZONE, Zone.current)) {
65 _rootScheduleMicrotask(null, null, _ROOT_ZONE, callback); 65 _rootScheduleMicrotask(null, null, _ROOT_ZONE, callback);
66 return;} 66 return;}
67 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, runGuarded: true)); 67 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, runGuarded: true));
68 } 68 }
69 class _AsyncRun {external static void _scheduleImmediate(void callback()); 69 class _AsyncRun {external static void _scheduleImmediate(void callback());
70 } 70 }
71 typedef void __t28(); 71 typedef void __t28();
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/async/future_impl.dart ('k') | test/dart_codegen/expect/async/stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698