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

Side by Side Diff: pkg/barback/test/transformer/declaring_rewrite.dart

Issue 243793005: Don't require Transformer methods to return Futures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 8 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 | Annotate | Revision Log
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.declaring_rewrite; 5 library barback.test.transformer.declaring_rewrite;
6 6
7 import 'dart:async';
8
9 import 'package:barback/barback.dart'; 7 import 'package:barback/barback.dart';
10 8
11 import 'rewrite.dart'; 9 import 'rewrite.dart';
12 10
13 /// Like [RewriteTransformer], but declares its assets ahead of time. 11 /// Like [RewriteTransformer], but declares its assets ahead of time.
14 class DeclaringRewriteTransformer extends RewriteTransformer 12 class DeclaringRewriteTransformer extends RewriteTransformer
15 implements DeclaringTransformer { 13 implements DeclaringTransformer {
16 DeclaringRewriteTransformer(String from, String to) 14 DeclaringRewriteTransformer(String from, String to)
17 : super(from, to); 15 : super(from, to);
18 16
19 Future declareOutputs(DeclaringTransform transform) { 17 void declareOutputs(DeclaringTransform transform) {
20 if (consumePrimary) transform.consumePrimary(); 18 if (consumePrimary) transform.consumePrimary();
21 for (var extension in to.split(" ")) { 19 for (var extension in to.split(" ")) {
22 var id = transform.primaryId.changeExtension(".$extension"); 20 var id = transform.primaryId.changeExtension(".$extension");
23 transform.declareOutput(id); 21 transform.declareOutput(id);
24 } 22 }
25 } 23 }
26 } 24 }
OLDNEW
« no previous file with comments | « pkg/barback/test/transformer/declaring_bad.dart ('k') | pkg/barback/test/transformer/emit_nothing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698