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

Side by Side Diff: test/codegen/expect/async/async.js

Issue 967713002: fixes #69, avoid module name inside module scope (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 var async; 1 var async;
2 (function(async) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 dart.copyProperties(async, { 4 dart.copyProperties(exports, {
5 get _hasDocument() { 5 get _hasDocument() {
6 return dart.equals(typeof document, 'object'); 6 return dart.equals(typeof document, 'object');
7 } 7 }
8 }); 8 });
9 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic 9 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic
10 function _invokeErrorHandler(errorHandler, error, stackTrace) { 10 function _invokeErrorHandler(errorHandler, error, stackTrace) {
11 if (dart.is(errorHandler, ZoneBinaryCallback)) { 11 if (dart.is(errorHandler, ZoneBinaryCallback)) {
12 return dart.dinvokef(errorHandler, error, stackTrace); 12 return dart.dinvokef(errorHandler, error, stackTrace);
13 } else { 13 } else {
14 return dart.dinvokef(errorHandler, error); 14 return dart.dinvokef(errorHandler, error);
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 _Future._ERROR = 8; 1251 _Future._ERROR = 8;
1252 return _Future; 1252 return _Future;
1253 }); 1253 });
1254 let _Future = _Future$(dynamic); 1254 let _Future = _Future$(dynamic);
1255 class _AsyncCallbackEntry extends dart.Object { 1255 class _AsyncCallbackEntry extends dart.Object {
1256 _AsyncCallbackEntry(callback) { 1256 _AsyncCallbackEntry(callback) {
1257 this.callback = callback; 1257 this.callback = callback;
1258 this.next = null; 1258 this.next = null;
1259 } 1259 }
1260 } 1260 }
1261 async._nextCallback = null; 1261 exports._nextCallback = null;
1262 async._lastCallback = null; 1262 exports._lastCallback = null;
1263 async._lastPriorityCallback = null; 1263 exports._lastPriorityCallback = null;
1264 async._isInCallbackLoop = false; 1264 exports._isInCallbackLoop = false;
1265 // Function _asyncRunCallbackLoop: () → void 1265 // Function _asyncRunCallbackLoop: () → void
1266 function _asyncRunCallbackLoop() { 1266 function _asyncRunCallbackLoop() {
1267 while (async._nextCallback !== null) { 1267 while (exports._nextCallback !== null) {
1268 async._lastPriorityCallback = null; 1268 exports._lastPriorityCallback = null;
1269 let entry = async._nextCallback; 1269 let entry = exports._nextCallback;
1270 async._nextCallback = entry.next; 1270 exports._nextCallback = entry.next;
1271 if (async._nextCallback === null) 1271 if (exports._nextCallback === null)
1272 async._lastCallback = null; 1272 exports._lastCallback = null;
1273 entry.callback(); 1273 entry.callback();
1274 } 1274 }
1275 } 1275 }
1276 // Function _asyncRunCallback: () → void 1276 // Function _asyncRunCallback: () → void
1277 function _asyncRunCallback() { 1277 function _asyncRunCallback() {
1278 async._isInCallbackLoop = true; 1278 exports._isInCallbackLoop = true;
1279 try { 1279 try {
1280 _asyncRunCallbackLoop(); 1280 _asyncRunCallbackLoop();
1281 } finally { 1281 } finally {
1282 async._lastPriorityCallback = null; 1282 exports._lastPriorityCallback = null;
1283 async._isInCallbackLoop = false; 1283 exports._isInCallbackLoop = false;
1284 if (async._nextCallback !== null) 1284 if (exports._nextCallback !== null)
1285 _AsyncRun._scheduleImmediate(_asyncRunCallback); 1285 _AsyncRun._scheduleImmediate(_asyncRunCallback);
1286 } 1286 }
1287 } 1287 }
1288 // Function _scheduleAsyncCallback: (dynamic) → void 1288 // Function _scheduleAsyncCallback: (dynamic) → void
1289 function _scheduleAsyncCallback(callback) { 1289 function _scheduleAsyncCallback(callback) {
1290 if (async._nextCallback === null) { 1290 if (exports._nextCallback === null) {
1291 async._nextCallback = async._lastCallback = new _AsyncCallbackEntry(dart.a s(callback, _AsyncCallback)); 1291 exports._nextCallback = exports._lastCallback = new _AsyncCallbackEntry(da rt.as(callback, _AsyncCallback));
1292 if (!dart.notNull(async._isInCallbackLoop)) { 1292 if (!dart.notNull(exports._isInCallbackLoop)) {
1293 _AsyncRun._scheduleImmediate(_asyncRunCallback); 1293 _AsyncRun._scheduleImmediate(_asyncRunCallback);
1294 } 1294 }
1295 } else { 1295 } else {
1296 let newEntry = new _AsyncCallbackEntry(dart.as(callback, _AsyncCallback)); 1296 let newEntry = new _AsyncCallbackEntry(dart.as(callback, _AsyncCallback));
1297 async._lastCallback.next = newEntry; 1297 exports._lastCallback.next = newEntry;
1298 async._lastCallback = newEntry; 1298 exports._lastCallback = newEntry;
1299 } 1299 }
1300 } 1300 }
1301 // Function _schedulePriorityAsyncCallback: (dynamic) → void 1301 // Function _schedulePriorityAsyncCallback: (dynamic) → void
1302 function _schedulePriorityAsyncCallback(callback) { 1302 function _schedulePriorityAsyncCallback(callback) {
1303 let entry = new _AsyncCallbackEntry(dart.as(callback, _AsyncCallback)); 1303 let entry = new _AsyncCallbackEntry(dart.as(callback, _AsyncCallback));
1304 if (async._nextCallback === null) { 1304 if (exports._nextCallback === null) {
1305 _scheduleAsyncCallback(callback); 1305 _scheduleAsyncCallback(callback);
1306 async._lastPriorityCallback = async._lastCallback; 1306 exports._lastPriorityCallback = exports._lastCallback;
1307 } else if (async._lastPriorityCallback === null) { 1307 } else if (exports._lastPriorityCallback === null) {
1308 entry.next = async._nextCallback; 1308 entry.next = exports._nextCallback;
1309 async._nextCallback = async._lastPriorityCallback = entry; 1309 exports._nextCallback = exports._lastPriorityCallback = entry;
1310 } else { 1310 } else {
1311 entry.next = async._lastPriorityCallback.next; 1311 entry.next = exports._lastPriorityCallback.next;
1312 async._lastPriorityCallback.next = entry; 1312 exports._lastPriorityCallback.next = entry;
1313 async._lastPriorityCallback = entry; 1313 exports._lastPriorityCallback = entry;
1314 if (entry.next === null) { 1314 if (entry.next === null) {
1315 async._lastCallback = entry; 1315 exports._lastCallback = entry;
1316 } 1316 }
1317 } 1317 }
1318 } 1318 }
1319 // Function scheduleMicrotask: (() → void) → void 1319 // Function scheduleMicrotask: (() → void) → void
1320 function scheduleMicrotask(callback) { 1320 function scheduleMicrotask(callback) {
1321 if (core.identical(_ROOT_ZONE, Zone.current)) { 1321 if (core.identical(_ROOT_ZONE, Zone.current)) {
1322 _rootScheduleMicrotask(null, null, dart.as(_ROOT_ZONE, Zone), callback); 1322 _rootScheduleMicrotask(null, null, dart.as(_ROOT_ZONE, Zone), callback);
1323 return; 1323 return;
1324 } 1324 }
1325 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, {runGuard ed: true})); 1325 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, {runGuard ed: true}));
(...skipping 3422 matching lines...) Expand 10 before | Expand all | Expand 10 after
4748 zoneSpecification = new ZoneSpecification.from(zoneSpecification, {handleU ncaughtError: errorHandler}); 4748 zoneSpecification = new ZoneSpecification.from(zoneSpecification, {handleU ncaughtError: errorHandler});
4749 } 4749 }
4750 let zone = Zone.current.fork({specification: zoneSpecification, zoneValues: zoneValues}); 4750 let zone = Zone.current.fork({specification: zoneSpecification, zoneValues: zoneValues});
4751 if (onError !== null) { 4751 if (onError !== null) {
4752 return zone.runGuarded(body); 4752 return zone.runGuarded(body);
4753 } else { 4753 } else {
4754 return zone.run(body); 4754 return zone.run(body);
4755 } 4755 }
4756 } 4756 }
4757 // Exports: 4757 // Exports:
4758 async.DeferredLibrary = DeferredLibrary; 4758 exports.DeferredLibrary = DeferredLibrary;
4759 async.DeferredLoadException = DeferredLoadException; 4759 exports.DeferredLoadException = DeferredLoadException;
4760 async.Future = Future; 4760 exports.Future = Future;
4761 async.Future$ = Future$; 4761 exports.Future$ = Future$;
4762 async.TimeoutException = TimeoutException; 4762 exports.TimeoutException = TimeoutException;
4763 async.Completer = Completer; 4763 exports.Completer = Completer;
4764 async.Completer$ = Completer$; 4764 exports.Completer$ = Completer$;
4765 async.scheduleMicrotask = scheduleMicrotask; 4765 exports.scheduleMicrotask = scheduleMicrotask;
4766 async.Stream = Stream; 4766 exports.Stream = Stream;
4767 async.Stream$ = Stream$; 4767 exports.Stream$ = Stream$;
4768 async.StreamSubscription = StreamSubscription; 4768 exports.StreamSubscription = StreamSubscription;
4769 async.StreamSubscription$ = StreamSubscription$; 4769 exports.StreamSubscription$ = StreamSubscription$;
4770 async.EventSink = EventSink; 4770 exports.EventSink = EventSink;
4771 async.EventSink$ = EventSink$; 4771 exports.EventSink$ = EventSink$;
4772 async.StreamView = StreamView; 4772 exports.StreamView = StreamView;
4773 async.StreamView$ = StreamView$; 4773 exports.StreamView$ = StreamView$;
4774 async.StreamConsumer = StreamConsumer; 4774 exports.StreamConsumer = StreamConsumer;
4775 async.StreamConsumer$ = StreamConsumer$; 4775 exports.StreamConsumer$ = StreamConsumer$;
4776 async.StreamSink = StreamSink; 4776 exports.StreamSink = StreamSink;
4777 async.StreamSink$ = StreamSink$; 4777 exports.StreamSink$ = StreamSink$;
4778 async.StreamTransformer = StreamTransformer; 4778 exports.StreamTransformer = StreamTransformer;
4779 async.StreamTransformer$ = StreamTransformer$; 4779 exports.StreamTransformer$ = StreamTransformer$;
4780 async.StreamIterator = StreamIterator; 4780 exports.StreamIterator = StreamIterator;
4781 async.StreamIterator$ = StreamIterator$; 4781 exports.StreamIterator$ = StreamIterator$;
4782 async.StreamController = StreamController; 4782 exports.StreamController = StreamController;
4783 async.StreamController$ = StreamController$; 4783 exports.StreamController$ = StreamController$;
4784 async.Timer = Timer; 4784 exports.Timer = Timer;
4785 async.AsyncError = AsyncError; 4785 exports.AsyncError = AsyncError;
4786 async.ZoneSpecification = ZoneSpecification; 4786 exports.ZoneSpecification = ZoneSpecification;
4787 async.ZoneDelegate = ZoneDelegate; 4787 exports.ZoneDelegate = ZoneDelegate;
4788 async.Zone = Zone; 4788 exports.Zone = Zone;
4789 async.runZoned = runZoned; 4789 exports.runZoned = runZoned;
4790 })(async || (async = {})); 4790 })(async || (async = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/_native_typed_data/_native_typed_data.js ('k') | test/codegen/expect/cascade/cascade.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698