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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartSuperConstructorInvocation.java

Issue 9633009: Use Element instead of Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 package com.google.dart.compiler.ast; 5 package com.google.dart.compiler.ast;
6 6
7 import com.google.dart.compiler.common.HasSymbol;
8 import com.google.dart.compiler.common.Symbol;
9 import com.google.dart.compiler.resolver.ConstructorElement; 7 import com.google.dart.compiler.resolver.ConstructorElement;
8 import com.google.dart.compiler.resolver.Element;
10 9
11 import java.util.List; 10 import java.util.List;
12 11
13 /** 12 /**
14 * Super constructor invocation AST node. 13 * Super constructor invocation AST node.
15 */ 14 */
16 public class DartSuperConstructorInvocation extends DartInvocation implements Ha sSymbol { 15 public class DartSuperConstructorInvocation extends DartInvocation {
17 16
18 private DartIdentifier name; 17 private DartIdentifier name;
19 private ConstructorElement symbol; 18 private ConstructorElement element;
20 19
21 public DartSuperConstructorInvocation(DartIdentifier name, List<DartExpression > args) { 20 public DartSuperConstructorInvocation(DartIdentifier name, List<DartExpression > args) {
22 super(args); 21 super(args);
23 this.name = becomeParentOf(name); 22 this.name = becomeParentOf(name);
24 } 23 }
25 24
26 public String getConstructorName() { 25 public String getConstructorName() {
27 if (name == null) { 26 if (name == null) {
28 return null; 27 return null;
29 } 28 }
30 return name.getTargetName(); 29 return name.getName();
31 } 30 }
32 31
33 public DartIdentifier getName() { 32 public DartIdentifier getName() {
34 return name; 33 return name;
35 } 34 }
36 35
37 public void setName(DartIdentifier newName) { 36 public void setName(DartIdentifier newName) {
38 name = becomeParentOf(newName); 37 name = becomeParentOf(newName);
39 } 38 }
40 39
41 @Override 40 @Override
42 public void setSymbol(Symbol symbol) { 41 public void setElement(Element element) {
43 this.symbol = (ConstructorElement) symbol; 42 this.element = (ConstructorElement) element;
44 } 43 }
45 44
46 @Override 45 @Override
47 public ConstructorElement getSymbol() { 46 public ConstructorElement getElement() {
48 return symbol; 47 return element;
49 } 48 }
50 49
51 @Override 50 @Override
52 public void visitChildren(ASTVisitor<?> visitor) { 51 public void visitChildren(ASTVisitor<?> visitor) {
53 if (name != null) { 52 if (name != null) {
54 name.accept(visitor); 53 name.accept(visitor);
55 } 54 }
56 visitor.visit(getArguments()); 55 visitor.visit(getArguments());
57 } 56 }
58 57
59 @Override 58 @Override
60 public <R> R accept(ASTVisitor<R> visitor) { 59 public <R> R accept(ASTVisitor<R> visitor) {
61 return visitor.visitSuperConstructorInvocation(this); 60 return visitor.visitSuperConstructorInvocation(this);
62 } 61 }
63 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698