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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart

Issue 12047041: Testable patch parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698