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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index 9a711861ec42fbfca49ed79a05645e05274bdd5a..21243745bad405163e9062a85231e17f8f0382dc 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -59,12 +59,12 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
: this.withSettings(environment, new BarbackSettings({}, mode));
/// Only ".dart" entrypoint files within a buildable directory are processed.
- Future<bool> isPrimary(AssetId id) {
- if (id.extension != ".dart") return new Future.value(false);
+ bool isPrimary(AssetId id) {
+ if (id.extension != ".dart") return false;
// These should only contain libraries. For efficiency's sake, we don't
// look for entrypoints in there.
- return new Future.value(!["asset/", "lib/"].any(id.path.startsWith));
+ return !["asset/", "lib/"].any(id.path.startsWith);
}
Future apply(Transform transform) {
@@ -87,14 +87,13 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
});
}
- Future declareOutputs(DeclaringTransform transform) {
+ void declareOutputs(DeclaringTransform transform) {
var primaryId = transform.primaryId;
transform.declareOutput(primaryId.addExtension(".js"));
transform.declareOutput(primaryId.addExtension(".precompiled.js"));
if (_generateSourceMaps) {
transform.declareOutput(primaryId.addExtension(".js.map"));
}
- return new Future.value();
}
/// Returns whether or not [asset] might be an entrypoint.

Powered by Google App Engine
This is Rietveld 408576698