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

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/async/async_error.dart

Issue 2698353003: unfork DDC's copy of most SDK libraries (Closed)
Patch Set: revert core_patch Created 3 years, 10 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
Index: pkg/dev_compiler/tool/input_sdk/lib/async/async_error.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/async/async_error.dart b/pkg/dev_compiler/tool/input_sdk/lib/async/async_error.dart
deleted file mode 100644
index 53788859fc979d9be086a5ee7c2c21f726bebfce..0000000000000000000000000000000000000000
--- a/pkg/dev_compiler/tool/input_sdk/lib/async/async_error.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.async;
-
-_invokeErrorHandler(Function errorHandler,
- Object error, StackTrace stackTrace) {
- if (errorHandler is ZoneBinaryCallback) {
- return errorHandler(error, stackTrace);
- } else {
- ZoneUnaryCallback unaryErrorHandler = errorHandler;
- return unaryErrorHandler(error);
- }
-}
-
-Function _registerErrorHandler/*<R>*/(Function errorHandler, Zone zone) {
- if (errorHandler is ZoneBinaryCallback) {
- // TODO(leafp): These are commented out, because the async libraries
- // pass a (...) -> void into this function which fails whenever R
- // is something interesting. This needs to be sorted out in the main
- // SDK as to what the intent is here: if this is really supposed to
- // return an R, then the function that gets passed in is wrong. If not,
- // then this code doesn't need to track the return type at all.
- // return zone.registerBinaryCallback/*<R, dynamic, StackTrace>*/(
- // errorHandler as dynamic/*=ZoneBinaryCallback<R, dynamic, StackTrace>*/);
- return zone.registerBinaryCallback/*<dynamic, dynamic, StackTrace>*/(
- errorHandler as dynamic/*=ZoneBinaryCallback<dynamic, dynamic, StackTrace>*/);
- } else {
- // return zone.registerUnaryCallback/*<R, dynamic>*/(
- // errorHandler as dynamic/*=ZoneUnaryCallback<R, dynamic>*/);
- return zone.registerUnaryCallback/*<dynamic, dynamic>*/(
- errorHandler as dynamic/*=ZoneUnaryCallback<dynamic, dynamic>*/);
- }
-}
-
-class _UncaughtAsyncError extends AsyncError {
- _UncaughtAsyncError(error, StackTrace stackTrace)
- : super(error, _getBestStackTrace(error, stackTrace));
-
- static StackTrace _getBestStackTrace(error, StackTrace stackTrace) {
- if (stackTrace != null) return stackTrace;
- if (error is Error) {
- return error.stackTrace;
- }
- return null;
- }
-
- String toString() {
- String result = "Uncaught Error: ${error}";
-
- if (stackTrace != null) {
- result += "\nStack Trace:\n$stackTrace";
- }
- return result;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698