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

Unified Diff: pkg/shelf/lib/src/util.dart

Issue 814113004: Pull args, intl, logging, shelf, and source_maps out of the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also csslib. Created 6 years 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
« no previous file with comments | « pkg/shelf/lib/src/shelf_unmodifiable_map.dart ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/lib/src/util.dart
diff --git a/pkg/shelf/lib/src/util.dart b/pkg/shelf/lib/src/util.dart
deleted file mode 100644
index b668177a011a4bee288b7421a8c14c746cc6200d..0000000000000000000000000000000000000000
--- a/pkg/shelf/lib/src/util.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2014, 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.
-
-library shelf.util;
-
-import 'dart:async';
-
-import 'package:stack_trace/stack_trace.dart';
-
-/// Like [new Future], but avoids around issue 11911 by using [new Future.value]
-/// under the covers.
-Future newFuture(callback()) => new Future.value().then((_) => callback());
-
-/// Like [Future.sync], but wraps the Future in [Chain.track] as well.
-Future syncFuture(callback()) => Chain.track(new Future.sync(callback));
-
-/// Run [callback] and capture any errors that would otherwise be top-leveled.
-///
-/// If [this] is called in a non-root error zone, it will just run [callback]
-/// and return the result. Otherwise, it will capture any errors using
-/// [runZoned] and pass them to [onError].
-catchTopLevelErrors(callback(), void onError(error, StackTrace stackTrace)) {
- if (Zone.current.inSameErrorZone(Zone.ROOT)) {
- return runZoned(callback, onError: onError);
- } else {
- return callback();
- }
-}
-
-/// Returns a [Map] with the values from [original] and the values from
-/// [updates].
-///
-/// For keys that are the same between [original] and [updates], the value in
-/// [updates] is used.
-///
-/// If [updates] is `null` or empty, [original] is returned unchanged.
-Map updateMap(Map original, Map updates) {
- if (updates == null || updates.isEmpty) return original;
-
- return new Map.from(original)
- ..addAll(updates);
-}
« no previous file with comments | « pkg/shelf/lib/src/shelf_unmodifiable_map.dart ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698