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

Unified Diff: pkg/polymer/test/build/all_phases_test.dart

Issue 25439002: fix observe transform to preserve metadata (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use isPrivateName Created 7 years, 3 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/observe/test/transform_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/build/all_phases_test.dart
diff --git a/pkg/polymer/test/build/all_phases_test.dart b/pkg/polymer/test/build/all_phases_test.dart
index 1c2dccc4cdc7145077a8353c3017cc94fc028f0c..9e6a9b754c67dc4b9cd2fc20c0b1d0b8850531d3 100644
--- a/pkg/polymer/test/build/all_phases_test.dart
+++ b/pkg/polymer/test/build/all_phases_test.dart
@@ -198,17 +198,14 @@ class $className extends ObservableBase {
}
''';
-String _sampleObservableOutput(String className, String fieldName) => '''
-library ${className}_$fieldName;
-import 'package:observe/observe.dart';
-
-class $className extends ChangeNotifierBase {
- int __\$$fieldName;
- int get $fieldName => __\$$fieldName;
- set $fieldName(int value) {
- __\$$fieldName = notifyPropertyChange(const Symbol('$fieldName'), __\$$fieldName, value);
- }
-
- $className($fieldName) : __\$$fieldName = $fieldName;
-}
-''';
+String _sampleObservableOutput(String className, String field) =>
+ "library ${className}_$field;\n"
+ "import 'package:observe/observe.dart';\n\n"
+ "class $className extends ChangeNotifierBase {\n"
+ " @observable int get $field => __\$$field; "
+ "int __\$$field; "
+ "set $field(int value) { "
+ "__\$$field = notifyPropertyChange(#$field, __\$$field, value); "
+ "}\n"
+ " $className($field) : __\$$field = $field;\n"
+ "}\n";
« no previous file with comments | « pkg/observe/test/transform_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698