File tree Expand file tree Collapse file tree 7 files changed +16
-13
lines changed Expand file tree Collapse file tree 7 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,8 @@ class ForeignAggregateTransform extends _ForeignBaseAggregateTransform
136
136
deserializeStream (transform['primaryInputs' ], deserializeAsset),
137
137
super (transform);
138
138
139
- Future <Asset > getInput (AssetId id) {
140
- return call (_port, {'type' : 'getInput' , 'id' : serializeId (id)})
141
- .then (deserializeAsset);
142
- }
139
+ Future <Asset > getInput (AssetId id) async => deserializeAsset (
140
+ await call (_port, {'type' : 'getInput' , 'id' : serializeId (id)}));
143
141
144
142
void addOutput (Asset output) {
145
143
call (_port, {'type' : 'addOutput' , 'output' : serializeAsset (output)});
Original file line number Diff line number Diff line change @@ -115,10 +115,8 @@ class ForeignTransform extends _ForeignBaseTransform
115
115
: primaryInput = deserializeAsset (transform['primaryInput' ]),
116
116
super (transform);
117
117
118
- Future <Asset > getInput (AssetId id) {
119
- return call (_port, {'type' : 'getInput' , 'id' : serializeId (id)})
120
- .then (deserializeAsset);
121
- }
118
+ Future <Asset > getInput (AssetId id) async => deserializeAsset (
119
+ await call (_port, {'type' : 'getInput' , 'id' : serializeId (id)}));
122
120
123
121
void addOutput (Asset output) {
124
122
call (_port, {'type' : 'addOutput' , 'output' : serializeAsset (output)});
Original file line number Diff line number Diff line change 5
5
import 'dart:io' ;
6
6
7
7
import 'package:collection/collection.dart' ;
8
+ import 'package:meta/meta.dart' ;
8
9
import 'package:path/path.dart' as path;
9
10
import 'package:pub_semver/pub_semver.dart' ;
10
11
import 'package:source_span/source_span.dart' ;
@@ -879,6 +880,9 @@ class Pubspec {
879
880
if (node == null || node.value == null ) return new YamlList ();
880
881
if (node is YamlList ) return node;
881
882
_error ('Must be a list.' , node.span);
883
+
884
+ // TODO(nweiz): Remove this when sdk#31384 is fixed.
885
+ throw "Unreachable" ;
882
886
}
883
887
884
888
/// Runs [fn] and wraps any [FormatException] it throws in a
@@ -904,6 +908,7 @@ class Pubspec {
904
908
}
905
909
906
910
/// Throws a [PubspecException] with the given message.
911
+ @alwaysThrows
907
912
void _error (String message, SourceSpan span) {
908
913
throw new PubspecException (message, span);
909
914
}
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ class BoundHostedSource extends CachedSource {
220
220
for (var serverDir in listDir (systemCacheRoot)) {
221
221
var url = _directoryToUrl (p.basename (serverDir));
222
222
223
- var packages = [];
223
+ var packages = < Package > [];
224
224
for (var entry in listDir (serverDir)) {
225
225
try {
226
226
packages.add (new Package .load (null , entry, systemCache.sources));
Original file line number Diff line number Diff line change @@ -321,8 +321,8 @@ Set<String> createDirectoryFilter(Iterable<String> dirs) {
321
321
/// Returns the maximum value in [iter] by [compare] .
322
322
///
323
323
/// [compare] defaults to [Comparable.compare] .
324
- maxAll (Iterable iter, [int compare (element1, element2 )]) {
325
- if ( compare == null ) compare = Comparable .compare ;
324
+ T maxAll < T > (Iterable < T > iter, [int compare (T value, T value2 )]) {
325
+ compare ?? = (value1, value2) => (value1 as Comparable ). compareTo (value2) ;
326
326
return iter
327
327
.reduce ((max, element) => compare (element, max) > 0 ? element : max);
328
328
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ dependencies:
20
20
http_multi_server : " >=1.0.0 <3.0.0"
21
21
http_throttle : " ^1.0.0"
22
22
json_rpc_2 : " ^2.0.0"
23
- meta : " >=0.12.2 <2.0 .0"
23
+ meta : " ^1.1 .0"
24
24
mime : " ^0.9.0"
25
25
oauth2 : " ^1.0.0"
26
26
package_config : " ^1.0.0"
Original file line number Diff line number Diff line change @@ -322,7 +322,9 @@ Future _ensureWebSocket() async {
322
322
var socket = await WebSocket .connect ("ws://localhost:$_adminPort " );
323
323
_webSocket = socket;
324
324
// TODO(rnystrom): Works around #13913.
325
- _webSocketBroadcastStream = _webSocket.map (JSON .decode).asBroadcastStream ();
325
+ _webSocketBroadcastStream = _webSocket
326
+ .map ((message) => JSON .decode (message as String ))
327
+ .asBroadcastStream ();
326
328
}
327
329
328
330
/// Closes the web socket connection to the currently-running pub serve.
You can’t perform that action at this time.
0 commit comments