| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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("patchparser"); | 5 #library("patchparser"); |
| 6 #import("dart:uri"); | 6 #import("dart:uri"); |
| 7 | 7 |
| 8 #import("tree/tree.dart", prefix: "tree"); | 8 #import("tree/tree.dart", prefix: "tree"); |
| 9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. | 9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. |
| 10 #import("apiimpl.dart"); | 10 #import("apiimpl.dart"); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (isMemberPatch) { | 204 if (isMemberPatch) { |
| 205 if (element is! FunctionElement) { | 205 if (element is! FunctionElement) { |
| 206 listener.internalErrorOnElement(element, | 206 listener.internalErrorOnElement(element, |
| 207 "Member patch is not a function."); | 207 "Member patch is not a function."); |
| 208 } | 208 } |
| 209 if (existing.kind === ElementKind.ABSTRACT_FIELD) { | 209 if (existing.kind === ElementKind.ABSTRACT_FIELD) { |
| 210 if (!element.isAccessor()) { | 210 if (!element.isAccessor()) { |
| 211 listener.internalErrorOnElement( | 211 listener.internalErrorOnElement( |
| 212 element, "Patching non-accessor with accessor"); | 212 element, "Patching non-accessor with accessor"); |
| 213 } | 213 } |
| 214 AbstractField field = existing; | 214 AbstractFieldElement field = existing; |
| 215 if (element.isGetter()) { | 215 if (element.isGetter()) { |
| 216 existing = field.getter; | 216 existing = field.getter; |
| 217 } else { | 217 } else { |
| 218 existing = field.setter; | 218 existing = field.setter; |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 if (existing is! FunctionElement) { | 221 if (existing is! FunctionElement) { |
| 222 listener.internalErrorOnElement(element, | 222 listener.internalErrorOnElement(element, |
| 223 "No corresponding method for patch."); | 223 "No corresponding method for patch."); |
| 224 } | 224 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 void addMember(Element element) { | 277 void addMember(Element element) { |
| 278 if (isMemberPatch || (isClassPatch && element is ClassElement)) { | 278 if (isMemberPatch || (isClassPatch && element is ClassElement)) { |
| 279 element.addMetadata(popNode()); | 279 element.addMetadata(popNode()); |
| 280 } | 280 } |
| 281 super.addMember(element); | 281 super.addMember(element); |
| 282 } | 282 } |
| 283 } | 283 } |
| OLD | NEW |