Index: dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart b/dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
index 41e937f2a0747653f0b4ae790d29e8ca303e3de0..2c103acc68209b54f3063a731cba31515d050a2f 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
@@ -329,15 +329,18 @@ class PatchElementListener extends ElementListener implements PatchListener { |
void pushElement(Element patch) { |
if (isMemberPatch || (isClassPatch && patch is ClassElement)) { |
- // Apply patch. |
patch.addMetadata(popMetadata()); |
- LibraryElement originLibrary = compilationUnitElement.getLibrary(); |
- assert(originLibrary.isPatched); |
- Element origin = originLibrary.localLookup(patch.name); |
- _patchElement(listener, origin, patch); |
+ applyPatch(patch); |
} |
super.pushElement(patch); |
} |
+ |
+ void applyPatch(Element patch) { |
+ LibraryElement originLibrary = compilationUnitElement.getLibrary(); |
+ assert(originLibrary.isPatched); |
+ Element origin = originLibrary.localLookup(patch.name); |
+ _patchElement(listener, origin, patch); |
+ } |
} |
/** |
@@ -390,6 +393,12 @@ class PatchMetadataAnnotation extends MetadataAnnotationX { |
Token get beginToken => null; |
} |
+void patchElement(leg.DiagnosticListener listener, |
+ Element origin, |
+ Element patch) { |
+ _patchElement(listener, origin, patch); |
+} |
+ |
void _patchElement(leg.DiagnosticListener listener, |
Element origin, |
Element patch) { |
@@ -589,3 +598,5 @@ bool _isPatchElement(Element element) { |
} |
return false; |
} |
+ |
+bool isPatchElement(Element element) => _isPatchElement(element); |