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

Side by Side Diff: lib/src/util.dart

Issue 1583683002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/shelf@master
Patch Set: Created 4 years, 11 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 | « lib/src/shelf_unmodifiable_map.dart ('k') | test/cascade_test.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library shelf.util;
6
7 import 'dart:async'; 5 import 'dart:async';
8 6
9 /// Like [new Future], but avoids around issue 11911 by using [new Future.value] 7 /// Like [new Future], but avoids around issue 11911 by using [new Future.value]
10 /// under the covers. 8 /// under the covers.
11 Future newFuture(callback()) => new Future.value().then((_) => callback()); 9 Future newFuture(callback()) => new Future.value().then((_) => callback());
12 10
13 /// Run [callback] and capture any errors that would otherwise be top-leveled. 11 /// Run [callback] and capture any errors that would otherwise be top-leveled.
14 /// 12 ///
15 /// If [this] is called in a non-root error zone, it will just run [callback] 13 /// If [this] is called in a non-root error zone, it will just run [callback]
16 /// and return the result. Otherwise, it will capture any errors using 14 /// and return the result. Otherwise, it will capture any errors using
(...skipping 21 matching lines...) Expand all
38 36
39 /// Adds a header with [name] and [value] to [headers], which may be null. 37 /// Adds a header with [name] and [value] to [headers], which may be null.
40 /// 38 ///
41 /// Returns a new map without modifying [headers]. 39 /// Returns a new map without modifying [headers].
42 Map<String, String> addHeader( 40 Map<String, String> addHeader(
43 Map<String, String> headers, String name, String value) { 41 Map<String, String> headers, String name, String value) {
44 headers = headers == null ? {} : new Map.from(headers); 42 headers = headers == null ? {} : new Map.from(headers);
45 headers[name] = value; 43 headers[name] = value;
46 return headers; 44 return headers;
47 } 45 }
OLDNEW
« no previous file with comments | « lib/src/shelf_unmodifiable_map.dart ('k') | test/cascade_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698