| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 utils; | 5 library utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | |
| 10 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
| 11 | 10 |
| 12 import 'package:stack_trace/stack_trace.dart'; | 11 import 'package:stack_trace/stack_trace.dart'; |
| 13 | 12 |
| 14 import 'byte_stream.dart'; | 13 import 'byte_stream.dart'; |
| 15 | 14 |
| 16 /// Converts a URL query string (or `application/x-www-form-urlencoded` body) | 15 /// Converts a URL query string (or `application/x-www-form-urlencoded` body) |
| 17 /// into a [Map] from parameter names to values. | 16 /// into a [Map] from parameter names to values. |
| 18 /// | 17 /// |
| 19 /// queryToMap("foo=bar&baz=bang&qux"); | 18 /// queryToMap("foo=bar&baz=bang&qux"); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 193 } |
| 195 | 194 |
| 196 /// Configures [future] so that its result (success or exception) is passed on | 195 /// Configures [future] so that its result (success or exception) is passed on |
| 197 /// to [completer]. | 196 /// to [completer]. |
| 198 void chainToCompleter(Future future, Completer completer) { | 197 void chainToCompleter(Future future, Completer completer) { |
| 199 future.then(completer.complete, onError: completer.completeError); | 198 future.then(completer.complete, onError: completer.completeError); |
| 200 } | 199 } |
| 201 | 200 |
| 202 /// Like [Future.sync], but wraps the Future in [Chain.track] as well. | 201 /// Like [Future.sync], but wraps the Future in [Chain.track] as well. |
| 203 Future syncFuture(callback()) => Chain.track(new Future.sync(callback)); | 202 Future syncFuture(callback()) => Chain.track(new Future.sync(callback)); |
| OLD | NEW |