Stop using deprecated features. (#103)
Update SDK version to 2.0.0-dev-55.0.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c226396..bb3c05f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
## 0.7.3+1
-* Updated SDK version to 2.0.0-dev.17.0.
+* Updated SDK version to 2.0.0-dev.55.0.
## 0.7.3
diff --git a/lib/src/body.dart b/lib/src/body.dart
index a91ed73..b52733b 100644
--- a/lib/src/body.dart
+++ b/lib/src/body.dart
@@ -5,9 +5,6 @@
import 'dart:async';
import 'dart:convert';
-import 'package:async/async.dart';
-import 'package:collection/collection.dart';
-
/// The body of a request or response.
///
/// This tracks whether the body has been read. It's separate from [Message]
@@ -57,9 +54,9 @@
}
} else if (body is List) {
contentLength = body.length;
- stream = new Stream.fromIterable([DelegatingList.typed(body)]);
+ stream = new Stream.fromIterable([body.cast()]);
} else if (body is Stream) {
- stream = DelegatingStream.typed(body);
+ stream = body.cast();
} else {
throw new ArgumentError('Response body "$body" must be a String or a '
'Stream.');
diff --git a/lib/src/io_server.dart b/lib/src/io_server.dart
index ac8b3a0..f2d97f0 100644
--- a/lib/src/io_server.dart
+++ b/lib/src/io_server.dart
@@ -25,7 +25,7 @@
// IPv6 addresses in URLs need to be enclosed in square brackets to avoid
// URL ambiguity with the ":" in the address.
- if (server.address.type == InternetAddressType.IP_V6) {
+ if (server.address.type == InternetAddressType.IPv6) {
return new Uri(
scheme: "http",
host: "[${server.address.address}]",
diff --git a/lib/src/util.dart b/lib/src/util.dart
index 1a57993..167969e 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -18,7 +18,7 @@
/// 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)) {
+ if (Zone.current.inSameErrorZone(Zone.root)) {
return runZoned(callback, onError: onError);
} else {
return callback();
diff --git a/pubspec.yaml b/pubspec.yaml
index 315579f..cae569b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -4,7 +4,7 @@
description: Web Server Middleware for Dart
homepage: https://github.com/dart-lang/shelf
environment:
- sdk: '>=2.0.0-dev.17.0 <2.0.0'
+ sdk: '>=2.0.0-dev.55.0 <2.0.0'
dependencies:
async: '>=1.10.0 <3.0.0'
collection: '^1.5.0'
diff --git a/test/io_server_test.dart b/test/io_server_test.dart
index 7905861..4d5e3fc 100644
--- a/test/io_server_test.dart
+++ b/test/io_server_test.dart
@@ -18,9 +18,9 @@
setUp(() async {
try {
- server = await IOServer.bind(InternetAddress.LOOPBACK_IP_V6, 0);
+ server = await IOServer.bind(InternetAddress.loopbackIPv6, 0);
} on SocketException catch (_) {
- server = await IOServer.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+ server = await IOServer.bind(InternetAddress.loopbackIPv4, 0);
}
});
diff --git a/test/shelf_io_test.dart b/test/shelf_io_test.dart
index 894c06e..0414ea4 100644
--- a/test/shelf_io_test.dart
+++ b/test/shelf_io_test.dart
@@ -249,7 +249,7 @@
});
test("doesn't pass asynchronous exceptions to the root error zone", () async {
- var response = await Zone.ROOT.run(() async {
+ var response = await Zone.root.run(() async {
var server = await shelf_io.serve((request) {
new Future(() => throw 'oh no');
return syncHandler(request);