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

Side by Side Diff: test/transformer/sync_rewrite.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 unified diff | Download patch
« no previous file with comments | « test/transformer/one_to_many.dart ('k') | test/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 barback.test.transformer.sync_rewrite; 5 library barback.test.transformer.sync_rewrite;
6 6
7 import 'dart:async';
8
9 import 'package:barback/barback.dart'; 7 import 'package:barback/barback.dart';
10 8
11 /// Like [DeclaringRewriteTransformer], but with no methods returning Futures. 9 /// Like [DeclaringRewriteTransformer], but with no methods returning Futures.
12 class SyncRewriteTransformer extends Transformer 10 class SyncRewriteTransformer extends Transformer
13 implements DeclaringTransformer { 11 implements DeclaringTransformer {
14 final String from; 12 final String from;
15 final String to; 13 final String to;
16 14
17 SyncRewriteTransformer(this.from, this.to); 15 SyncRewriteTransformer(this.from, this.to);
18 16
19 bool isPrimary(AssetId id) => id.extension == ".$from"; 17 bool isPrimary(AssetId id) => id.extension == ".$from";
20 18
21 void apply(Transform transform) { 19 void apply(Transform transform) {
22 for (var extension in to.split(" ")) { 20 for (var extension in to.split(" ")) {
23 var id = transform.primaryInput.id.changeExtension(".$extension"); 21 var id = transform.primaryInput.id.changeExtension(".$extension");
24 transform.addOutput(new Asset.fromString(id, "new.$extension")); 22 transform.addOutput(new Asset.fromString(id, "new.$extension"));
25 } 23 }
26 } 24 }
27 25
28 void declareOutputs(DeclaringTransform transform) { 26 void declareOutputs(DeclaringTransform transform) {
29 for (var extension in to.split(" ")) { 27 for (var extension in to.split(" ")) {
30 var id = transform.primaryId.changeExtension(".$extension"); 28 var id = transform.primaryId.changeExtension(".$extension");
31 transform.declareOutput(id); 29 transform.declareOutput(id);
32 } 30 }
33 } 31 }
34 32
35 String toString() => "$from->$to"; 33 String toString() => "$from->$to";
36 } 34 }
OLDNEW
« no previous file with comments | « test/transformer/one_to_many.dart ('k') | test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698