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

Unified Diff: lib/compiler/implementation/scanner/class_element_parser.dart

Issue 10831262: Revert "Revert "Allow patch files to add top-level declarations to the patched library."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bugs Created 8 years, 4 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 | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/class_element_parser.dart
diff --git a/lib/compiler/implementation/scanner/class_element_parser.dart b/lib/compiler/implementation/scanner/class_element_parser.dart
index 74e0a76f0d0452625543354b2e9a36a866c8f551..2620f9830ac78bd6f78c516eb07775f43941c30f 100644
--- a/lib/compiler/implementation/scanner/class_element_parser.dart
+++ b/lib/compiler/implementation/scanner/class_element_parser.dart
@@ -16,9 +16,9 @@ class PartialClassElement extends ClassElement {
PartialClassElement(SourceString name,
Token this.beginToken,
Token this.endToken,
- CompilationUnitElement enclosing,
+ Element enclosing,
int id)
- : super(name, enclosing, id);
+ : super(name, enclosing, id);
ClassNode parseNode(DiagnosticListener diagnosticListener) {
if (cachedNode != null) return cachedNode;
@@ -34,6 +34,15 @@ class PartialClassElement extends ClassElement {
Token position() => beginToken;
bool isInterface() => beginToken.stringValue === "interface";
+
+ PartialClassElement cloneTo(Element enclosing, DiagnosticListener listener) {
+ parseNode(listener);
+ PartialClassElement result =
+ new PartialClassElement(name, beginToken, endToken, enclosing, id);
+ cloneMembersTo(result, listener);
+ result.cachedNode = cachedNode;
+ return result;
+ }
}
class MemberListener extends NodeListener {
@@ -41,8 +50,8 @@ class MemberListener extends NodeListener {
MemberListener(DiagnosticListener listener,
Element enclosingElement)
- : this.enclosingElement = enclosingElement,
- super(listener, enclosingElement.getCompilationUnit());
+ : this.enclosingElement = enclosingElement,
+ super(listener, enclosingElement.getCompilationUnit());
bool isConstructorName(Node nameNode) {
if (enclosingElement === null ||
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698