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

Side by Side 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, 2 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
« no previous file with comments | « pkg/observe/test/transform_test.dart ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 polymer.test.build.all_phases_test; 5 library polymer.test.build.all_phases_test;
6 6
7 import 'package:polymer/transformer.dart'; 7 import 'package:polymer/transformer.dart';
8 import 'package:unittest/compact_vm_config.dart'; 8 import 'package:unittest/compact_vm_config.dart';
9 9
10 import 'common.dart'; 10 import 'common.dart';
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 String _sampleObservable(String className, String fieldName) => ''' 191 String _sampleObservable(String className, String fieldName) => '''
192 library ${className}_$fieldName; 192 library ${className}_$fieldName;
193 import 'package:observe/observe.dart'; 193 import 'package:observe/observe.dart';
194 194
195 class $className extends ObservableBase { 195 class $className extends ObservableBase {
196 @observable int $fieldName; 196 @observable int $fieldName;
197 $className(this.$fieldName); 197 $className(this.$fieldName);
198 } 198 }
199 '''; 199 ''';
200 200
201 String _sampleObservableOutput(String className, String fieldName) => ''' 201 String _sampleObservableOutput(String className, String field) =>
202 library ${className}_$fieldName; 202 "library ${className}_$field;\n"
203 import 'package:observe/observe.dart'; 203 "import 'package:observe/observe.dart';\n\n"
204 204 "class $className extends ChangeNotifierBase {\n"
205 class $className extends ChangeNotifierBase { 205 " @observable int get $field => __\$$field; "
206 int __\$$fieldName; 206 "int __\$$field; "
207 int get $fieldName => __\$$fieldName; 207 "set $field(int value) { "
208 set $fieldName(int value) { 208 "__\$$field = notifyPropertyChange(#$field, __\$$field, value); "
209 __\$$fieldName = notifyPropertyChange(const Symbol('$fieldName'), __\$$field Name, value); 209 "}\n"
210 } 210 " $className($field) : __\$$field = $field;\n"
211 211 "}\n";
212 $className($fieldName) : __\$$fieldName = $fieldName;
213 }
214 ''';
OLDNEW
« 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