OLD | NEW |
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:polymer/src/build/script_compactor.dart' show MAIN_HEADER; | 8 import 'package:polymer/src/build/script_compactor.dart' show MAIN_HEADER; |
9 import 'package:unittest/compact_vm_config.dart'; | 9 import 'package:unittest/compact_vm_config.dart'; |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 'a|web/test2.html.0.dart': _sampleObservableOutput("A", "foo"), | 174 'a|web/test2.html.0.dart': _sampleObservableOutput("A", "foo"), |
175 'a|web/b.dart': _sampleObservableOutput('B', 'bar'), | 175 'a|web/b.dart': _sampleObservableOutput('B', 'bar'), |
176 'a|web/index.html.0.dart': _sampleObservableOutput("C", "car"), | 176 'a|web/index.html.0.dart': _sampleObservableOutput("C", "car"), |
177 }); | 177 }); |
178 } | 178 } |
179 | 179 |
180 String _sampleObservable(String className, String fieldName) => ''' | 180 String _sampleObservable(String className, String fieldName) => ''' |
181 library ${className}_$fieldName; | 181 library ${className}_$fieldName; |
182 import 'package:observe/observe.dart'; | 182 import 'package:observe/observe.dart'; |
183 | 183 |
184 class $className extends ObservableBase { | 184 class $className extends Observable { |
185 @observable int $fieldName; | 185 @observable int $fieldName; |
186 $className(this.$fieldName); | 186 $className(this.$fieldName); |
187 } | 187 } |
188 '''; | 188 '''; |
189 | 189 |
190 String _sampleObservableOutput(String className, String field) => | 190 String _sampleObservableOutput(String className, String field) => |
191 "library ${className}_$field;\n" | 191 "library ${className}_$field;\n" |
192 "import 'package:observe/observe.dart';\n\n" | 192 "import 'package:observe/observe.dart';\n\n" |
193 "class $className extends ChangeNotifierBase {\n" | 193 "class $className extends ChangeNotifier {\n" |
194 " @reflectable @observable int get $field => __\$$field; " | 194 " @reflectable @observable int get $field => __\$$field; " |
195 "int __\$$field; " | 195 "int __\$$field; " |
196 "@reflectable set $field(int value) { " | 196 "@reflectable set $field(int value) { " |
197 "__\$$field = notifyPropertyChange(#$field, __\$$field, value); " | 197 "__\$$field = notifyPropertyChange(#$field, __\$$field, value); " |
198 "}\n" | 198 "}\n" |
199 " $className($field) : __\$$field = $field;\n" | 199 " $className($field) : __\$$field = $field;\n" |
200 "}\n"; | 200 "}\n"; |
OLD | NEW |