Fix all strong-mode errors and warnings.
R=alanknight@google.com
Review URL: https://codereview.chromium.org//1959433002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d25b8f4..90f5aaf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,7 @@
## 1.0.3
+* Fix all strong-mode errors and warnings.
+
* Fix a bug where `HtmlWebSocketChannel.close()` would crash on non-Dartium
browsers if the close code and reason weren't provided explicitly.
diff --git a/lib/html.dart b/lib/html.dart
index 1c0a602..07a17ed 100644
--- a/lib/html.dart
+++ b/lib/html.dart
@@ -126,8 +126,8 @@
final HtmlWebSocketChannel _channel;
_HtmlWebSocketSink(HtmlWebSocketChannel channel)
- : super(channel._controller.foreign.sink),
- _channel = channel;
+ : _channel = channel,
+ super(channel._controller.foreign.sink);
Future close([int closeCode, String closeReason]) {
_channel._localCloseCode = closeCode;
diff --git a/lib/io.dart b/lib/io.dart
index 8c225be..8bf087b 100644
--- a/lib/io.dart
+++ b/lib/io.dart
@@ -85,8 +85,8 @@
final WebSocket _webSocket;
_IOWebSocketSink(WebSocket webSocket)
- : super(webSocket),
- _webSocket = webSocket;
+ : _webSocket = webSocket,
+ super(webSocket);
Future close([int closeCode, String closeReason]) =>
_webSocket.close(closeCode, closeReason);
diff --git a/lib/src/channel.dart b/lib/src/channel.dart
index 9c82c68..6aff42c 100644
--- a/lib/src/channel.dart
+++ b/lib/src/channel.dart
@@ -104,8 +104,8 @@
final WebSocketImpl _webSocket;
WebSocketSink._(WebSocketImpl webSocket)
- : super(webSocket),
- _webSocket = webSocket;
+ : _webSocket = webSocket,
+ super(webSocket);
/// Closes the web socket connection.
///
diff --git a/pubspec.yaml b/pubspec.yaml
index 2833116..7a8c0fe 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: web_socket_channel
-version: 1.0.3-dev
+version: 1.0.3
description: StreamChannel wrappers for WebSockets.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/web_socket_channel
diff --git a/test/html_test.dart b/test/html_test.dart
index f5c3555..9954eb6 100644
--- a/test/html_test.dart
+++ b/test/html_test.dart
@@ -17,6 +17,7 @@
import 'package:test/test.dart';
import 'package:web_socket_channel/html.dart';
+import 'package:web_socket_channel/web_socket_channel.dart';
void main() {
var channel;
@@ -88,5 +89,5 @@
var reader = new FileReader();
reader.readAsArrayBuffer(blob);
await reader.onLoad.first;
- return reader.result;
+ return reader.result as Uint8List;
}
diff --git a/test/web_socket_test.dart b/test/web_socket_test.dart
index a105b67..217df13 100644
--- a/test/web_socket_test.dart
+++ b/test/web_socket_test.dart
@@ -35,7 +35,7 @@
var response = await request.close();
var socket = await response.detachSocket();
- var innerChannel = new StreamChannel(socket, socket);
+ var innerChannel = new StreamChannel<List<int>>(socket, socket);
var webSocket = new WebSocketChannel(innerChannel, serverSide: false);
var n = 0;
@@ -67,7 +67,7 @@
response.contentLength = 0;
var socket = await response.detachSocket();
- var innerChannel = new StreamChannel(socket, socket);
+ var innerChannel = new StreamChannel<List<int>>(socket, socket);
var webSocket = new WebSocketChannel(innerChannel);
webSocket.sink.add("hello!");