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

Unified Diff: lib/compiler/implementation/elements/elements.dart

Issue 10830117: Port the remaining of dart:core to the unified corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
Index: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 1d951796313ebf2a8e5288d1ba8c9784d315d79c..79b36295a30ac5421c33aff4ee55b342b47518bb 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -444,7 +444,13 @@ class VariableElement extends Element {
ElementKind kind,
Element enclosing,
[Node node])
- : super(name, kind, enclosing), cachedNode = node;
+ : super(name, kind, enclosing), cachedNode = node;
+
+ VariableElement.from(SourceString name,
+ VariableElement other,
+ Element enclosing)
+ : this(name, new VariableListElement.from(other.variables, enclosing),
+ other.kind, enclosing, other.cachedNode);
Mads Ager (google) 2012/08/01 13:48:34 These are arguments to the this call. Align as arg
Anders Johnsen 2012/08/01 14:21:09 Done.
Node parseNode(DiagnosticListener listener) {
if (cachedNode !== null) return cachedNode;
@@ -522,6 +528,20 @@ class VariableListElement extends Element {
this.cachedNode = node,
this.modifiers = node.modifiers;
+ factory VariableListElement.from(VariableListElement other,
+ Element enclosing) {
+ var variableList;
+ if (other is PartialFieldListElement) {
+ variableList = new PartialFieldListElement(
+ other.beginToken, other.endToken, other.modifiers, enclosing);
+ } else {
+ variableList = new VariableListElement(other.kind, other.modifiers, enclosing);
Mads Ager (google) 2012/08/01 13:48:34 Long line.
Anders Johnsen 2012/08/01 14:21:09 Done.
+ }
+ variableList.cachedNode = other.cachedNode;
+ variableList.type = other.type;
+ return variableList;
+ }
+
VariableDefinitions parseNode(DiagnosticListener listener) {
return cachedNode;
}

Powered by Google App Engine
This is Rietveld 408576698