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

Side by Side Diff: test/generated_sdk/lib/async/async_error.dart

Issue 1162723007: remove generated_sdk from checked in code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 part of dart.async;
6
7 _invokeErrorHandler(Function errorHandler,
8 Object error, StackTrace stackTrace) {
9 if (errorHandler is ZoneBinaryCallback) {
10 return errorHandler(error, stackTrace);
11 } else {
12 return errorHandler(error);
13 }
14 }
15
16 Function _registerErrorHandler(Function errorHandler, Zone zone) {
17 if (errorHandler is ZoneBinaryCallback) {
18 return zone.registerBinaryCallback(errorHandler);
19 } else {
20 return zone.registerUnaryCallback(errorHandler);
21 }
22 }
23
24 class _UncaughtAsyncError extends AsyncError {
25 _UncaughtAsyncError(error, StackTrace stackTrace)
26 : super(error, _getBestStackTrace(error, stackTrace));
27
28 static StackTrace _getBestStackTrace(error, StackTrace stackTrace) {
29 if (stackTrace != null) return stackTrace;
30 if (error is Error) {
31 return error.stackTrace;
32 }
33 return null;
34 }
35
36 String toString() {
37 String result = "Uncaught Error: ${error}";
38
39 if (stackTrace != null) {
40 result += "\nStack Trace:\n$stackTrace";
41 }
42 return result;
43 }
44 }
OLDNEW
« no previous file with comments | « test/generated_sdk/lib/async/async.dart ('k') | test/generated_sdk/lib/async/broadcast_stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698