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

Side by Side Diff: lib/src/observable_transform.dart

Issue 23513017: Fixes needed in webui for sdk 7.1.0 (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
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
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | 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. You can find the 7 * straightforward, and essentially like an editor refactoring. You can find the
8 * core implementation in [transformClass], which is ultimately called by 8 * core implementation in [transformClass], which is ultimately called by
9 * [transformObservables], the entry point to this library. 9 * [transformObservables], the entry point to this library.
10 */ 10 */
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 void transformTopLevelField(TopLevelVariableDeclaration field, 118 void transformTopLevelField(TopLevelVariableDeclaration field,
119 TextEditTransaction code, Set<String> changedFields) { 119 TextEditTransaction code, Set<String> changedFields) {
120 120
121 transformFields(field.variables, code, field.offset, field.end, 121 transformFields(field.variables, code, field.offset, field.end,
122 isTopLevel: true, changedFields: changedFields); 122 isTopLevel: true, changedFields: changedFields);
123 } 123 }
124 124
125 void transformClassFields(FieldDeclaration member, TextEditTransaction code, 125 void transformClassFields(FieldDeclaration member, TextEditTransaction code,
126 Set<String> instanceFields, Set<String> staticFields) { 126 Set<String> instanceFields, Set<String> staticFields) {
127 127
128 bool isStatic = hasKeyword(member.keyword, Keyword.STATIC);
129 transformFields(member.fields, code, member.offset, member.end, 128 transformFields(member.fields, code, member.offset, member.end,
130 isStatic: isStatic, 129 isStatic: member.isStatic,
131 changedFields: isStatic ? staticFields : instanceFields); 130 changedFields: member.isStatic ? staticFields : instanceFields);
132 } 131 }
133 132
134 133
135 void fixConstructor(ConstructorDeclaration ctor, TextEditTransaction code, 134 void fixConstructor(ConstructorDeclaration ctor, TextEditTransaction code,
136 Set<String> changedFields) { 135 Set<String> changedFields) {
137 136
138 // Fix normal initializers 137 // Fix normal initializers
139 for (var initializer in ctor.initializers) { 138 for (var initializer in ctor.initializers) {
140 if (initializer is ConstructorFieldInitializer) { 139 if (initializer is ConstructorFieldInitializer) {
141 var field = initializer.fieldName; 140 var field = initializer.fieldName;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 __\$$name, value); 241 __\$$name, value);
243 } 242 }
244 __\$$name = value; 243 __\$$name = value;
245 }'''.replaceAll('\n', '\n$indent')); 244 }'''.replaceAll('\n', '\n$indent'));
246 245
247 if (changedFields != null) changedFields.add(name); 246 if (changedFields != null) changedFields.add(name);
248 } 247 }
249 248
250 code.edit(begin, end, '$replace'); 249 code.edit(begin, end, '$replace');
251 } 250 }
OLDNEW
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698