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

Side by Side Diff: tool/input_sdk/lib/async/zone.dart

Issue 1968323002: Work around is check issue causing zone error handlers to never fire. Update test expectations to r… (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 years, 7 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
« no previous file with comments | « test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.async; 5 part of dart.async;
6 6
7 typedef R ZoneCallback<R>(); 7 typedef R ZoneCallback<R>();
8 typedef R ZoneUnaryCallback<R, T>(T arg); 8 typedef R ZoneUnaryCallback<R, T>(T arg);
9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2); 9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2);
10 10
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 */ 1267 */
1268 /*=R*/ runZoned/*<R>*/(/*=R*/ body(), 1268 /*=R*/ runZoned/*<R>*/(/*=R*/ body(),
1269 { Map zoneValues, 1269 { Map zoneValues,
1270 ZoneSpecification zoneSpecification, 1270 ZoneSpecification zoneSpecification,
1271 Function onError }) { 1271 Function onError }) {
1272 HandleUncaughtErrorHandler errorHandler; 1272 HandleUncaughtErrorHandler errorHandler;
1273 if (onError != null) { 1273 if (onError != null) {
1274 errorHandler = (Zone self, ZoneDelegate parent, Zone zone, 1274 errorHandler = (Zone self, ZoneDelegate parent, Zone zone,
1275 error, StackTrace stackTrace) { 1275 error, StackTrace stackTrace) {
1276 try { 1276 try {
1277 if (onError is ZoneBinaryCallback<dynamic/*=R*/, dynamic, StackTrace>) { 1277 // Change this is check back to
1278 return self.parent.runBinary(onError, error, stackTrace); 1278 // onError is ZoneBinaryCallback<dynamic/*=R*/, dynamic, StackTrace>
1279 // once is checks for that type are handled correctly.
1280 if (onError is ZoneBinaryCallback<dynamic, dynamic, StackTrace>) {
1281 return self.parent.runBinary(onError, error, stackTrace) as Object/*=R */;
1279 } 1282 }
1280 return self.parent.runUnary(onError, error); 1283 return self.parent.runUnary(onError, error);
1281 } catch(e, s) { 1284 } catch(e, s) {
1282 if (identical(e, error)) { 1285 if (identical(e, error)) {
1283 return parent.handleUncaughtError(zone, error, stackTrace); 1286 return parent.handleUncaughtError(zone, error, stackTrace);
1284 } else { 1287 } else {
1285 return parent.handleUncaughtError(zone, e, s); 1288 return parent.handleUncaughtError(zone, e, s);
1286 } 1289 }
1287 } 1290 }
1288 }; 1291 };
1289 } 1292 }
1290 if (zoneSpecification == null) { 1293 if (zoneSpecification == null) {
1291 zoneSpecification = 1294 zoneSpecification =
1292 new ZoneSpecification(handleUncaughtError: errorHandler); 1295 new ZoneSpecification(handleUncaughtError: errorHandler);
1293 } else if (errorHandler != null) { 1296 } else if (errorHandler != null) {
1294 zoneSpecification = 1297 zoneSpecification =
1295 new ZoneSpecification.from(zoneSpecification, 1298 new ZoneSpecification.from(zoneSpecification,
1296 handleUncaughtError: errorHandler); 1299 handleUncaughtError: errorHandler);
1297 } 1300 }
1298 Zone zone = Zone.current.fork(specification: zoneSpecification, 1301 Zone zone = Zone.current.fork(specification: zoneSpecification,
1299 zoneValues: zoneValues); 1302 zoneValues: zoneValues);
1300 if (onError != null) { 1303 if (onError != null) {
1301 return zone.runGuarded(body); 1304 return zone.runGuarded(body);
1302 } else { 1305 } else {
1303 return zone.run(body); 1306 return zone.run(body);
1304 } 1307 }
1305 } 1308 }
OLDNEW
« no previous file with comments | « test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698