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

Unified Diff: pkg/observe/lib/transform.dart

Issue 23543005: Make Transform a little more pleasant to use: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 4 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 | « pkg/barback/test/utils.dart ('k') | pkg/observe/test/transform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/lib/transform.dart
diff --git a/pkg/observe/lib/transform.dart b/pkg/observe/lib/transform.dart
index 99cb13b47e4bd797f1bef5b75fb78875ecde9e20..7f6668695feceb05a98a911b2a0010b0319d704e 100644
--- a/pkg/observe/lib/transform.dart
+++ b/pkg/observe/lib/transform.dart
@@ -20,7 +20,7 @@ import 'package:source_maps/span.dart' show SourceFile;
/**
* A [Transformer] that replaces observables based on dirty-checking with an
- * implementation based on change notifications.
+ * implementation based on change notifications.
*
* The transformation adds hooks for field setters and notifies the observation
* system of the change.
@@ -38,9 +38,8 @@ class ObservableTransformer extends Transformer {
}
Future apply(Transform transform) {
- return transform.primaryInput
- .then((input) => input.readAsString().then((content) {
- var id = transform.primaryId;
+ return transform.primaryInput.readAsString().then((content) {
+ var id = transform.primaryInput.id;
// TODO(sigmund): improve how we compute this url
var url = id.path.startsWith('lib/')
? 'package:${id.package}/${id.path.substring(4)}' : id.path;
@@ -56,7 +55,7 @@ class ObservableTransformer extends Transformer {
// dartbug.com/12340)
printer.build(url);
transform.addOutput(new Asset.fromString(id, printer.text));
- }));
+ });
}
}
« no previous file with comments | « pkg/barback/test/utils.dart ('k') | pkg/observe/test/transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698