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

Side by Side Diff: pkg/observe/lib/transform.dart

Issue 23769002: Fix build for pub after new analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 /** 5 /**
6 * Code transform for @observable. The core transformation is relatively 6 * Code transform for @observable. The core transformation is relatively
7 * straightforward, and essentially like an editor refactoring. 7 * straightforward, and essentially like an editor refactoring.
8 */ 8 */
9 library observe.transform; 9 library observe.transform;
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 declaresObservable = true; 166 declaresObservable = true;
167 } 167 }
168 168
169 // Track fields that were transformed. 169 // Track fields that were transformed.
170 var instanceFields = new Set<String>(); 170 var instanceFields = new Set<String>();
171 var getters = new List<String>(); 171 var getters = new List<String>();
172 var setters = new List<String>(); 172 var setters = new List<String>();
173 173
174 for (var member in cls.members) { 174 for (var member in cls.members) {
175 if (member is FieldDeclaration) { 175 if (member is FieldDeclaration) {
176 bool isStatic = _hasKeyword(member.keyword, Keyword.STATIC); 176 if (member.isStatic) {
177 if (isStatic) {
178 if (_hasObservable(member)){ 177 if (_hasObservable(member)){
179 logger.warning('Static fields can no longer be observable. ' 178 logger.warning('Static fields can no longer be observable. '
180 'Observable fields should be put in an observable objects.', 179 'Observable fields should be put in an observable objects.',
181 _getSpan(file, member)); 180 _getSpan(file, member));
182 } 181 }
183 continue; 182 continue;
184 } 183 }
185 if (_hasObservable(member)) { 184 if (_hasObservable(member)) {
186 if (!declaresObservable) { 185 if (!declaresObservable) {
187 logger.warning('Observable fields should be put in an observable' 186 logger.warning('Observable fields should be put in an observable'
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 $type __\$$name$initializer; 319 $type __\$$name$initializer;
321 $type get $name => __\$$name; 320 $type get $name => __\$$name;
322 set $name($type value) { 321 set $name($type value) {
323 __\$$name = notifyPropertyChange(const Symbol('$name'), __\$$name, value); 322 __\$$name = notifyPropertyChange(const Symbol('$name'), __\$$name, value);
324 } 323 }
325 '''.replaceAll('\n', '\n$indent')); 324 '''.replaceAll('\n', '\n$indent'));
326 } 325 }
327 326
328 code.edit(begin, end, '$replace'); 327 code.edit(begin, end, '$replace');
329 } 328 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698