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

Unified Diff: lib/src/transformer/aggregate_transform.dart

Issue 1947773002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Code review changes Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/graph/transformer_classifier.dart ('k') | lib/src/transformer/base_transform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/transformer/aggregate_transform.dart
diff --git a/lib/src/transformer/aggregate_transform.dart b/lib/src/transformer/aggregate_transform.dart
index 6d471fd34bba833070bda7891bcd6c46a739eee4..a92f738652e7145c83ef92e6913952cbd528d674 100644
--- a/lib/src/transformer/aggregate_transform.dart
+++ b/lib/src/transformer/aggregate_transform.dart
@@ -7,6 +7,8 @@ library barback.transformer.aggregate_transform;
import 'dart:async';
import 'dart:convert';
+import 'package:async/async.dart';
+
import '../asset/asset.dart';
import '../asset/asset_id.dart';
import '../asset/asset_set.dart';
@@ -62,7 +64,7 @@ class AggregateTransform extends BaseTransform {
/// If an input with [id] cannot be found, throws an [AssetNotFoundException].
Future<Asset> getInput(AssetId id) {
if (_emittedPrimaryInputs.containsId(id)) {
- return syncFuture(() => _emittedPrimaryInputs[id]);
+ return new Future.sync(() => _emittedPrimaryInputs[id]);
} else {
return _node.getInput(id);
}
@@ -79,7 +81,8 @@ class AggregateTransform extends BaseTransform {
/// If an input with [id] cannot be found, throws an [AssetNotFoundException].
Future<String> readInputAsString(AssetId id, {Encoding encoding}) {
if (encoding == null) encoding = UTF8;
- return getInput(id).then((input) => input.readAsString(encoding: encoding));
+ return getInput(id).then/*<Future<String>>*/(
+ (input) => input.readAsString(encoding: encoding));
}
/// A convenience method to the contents of the input with [id].
@@ -97,10 +100,11 @@ class AggregateTransform extends BaseTransform {
/// This is equivalent to calling [getInput] and catching an
/// [AssetNotFoundException].
Future<bool> hasInput(AssetId id) {
- return getInput(id).then((_) => true).catchError((error) {
+ return DelegatingFuture.typed(
+ getInput(id).then((_) => true).catchError((error) {
if (error is AssetNotFoundException && error.id == id) return false;
throw error;
- });
+ }));
}
/// Stores [output] as an output created by this transformation.
@@ -124,7 +128,7 @@ class AggregateTransform extends BaseTransform {
/// The controller for [AggregateTransform].
class AggregateTransformController extends BaseTransformController {
- AggregateTransform get transform => super.transform;
+ final AggregateTransform transform;
/// The set of assets that the transformer has emitted.
AssetSet get outputs => transform._outputs;
@@ -132,7 +136,7 @@ class AggregateTransformController extends BaseTransformController {
bool get isDone => transform._inputController.isClosed;
AggregateTransformController(TransformNode node)
- : super(new AggregateTransform._(node));
+ : transform = new AggregateTransform._(node);
/// Adds a primary input asset to the [AggregateTransform.primaryInputs]
/// stream.
« no previous file with comments | « lib/src/graph/transformer_classifier.dart ('k') | lib/src/transformer/base_transform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698