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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 9138023: More setting of symbols on identifiers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes many assertEquals() to assertSame() Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.resolver; 5 package com.google.dart.compiler.resolver;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.dart.compiler.DartCompilationError; 8 import com.google.dart.compiler.DartCompilationError;
9 import com.google.dart.compiler.DartCompilerContext; 9 import com.google.dart.compiler.DartCompilerContext;
10 import com.google.dart.compiler.DartCompilerListener; 10 import com.google.dart.compiler.DartCompilerListener;
11 import com.google.dart.compiler.ErrorCode; 11 import com.google.dart.compiler.ErrorCode;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 this.library = library; 147 this.library = library;
148 } 148 }
149 149
150 @Override 150 @Override
151 public Void visitClass(DartClass node) { 151 public Void visitClass(DartClass node) {
152 ClassElement element = Elements.classFromNode(node, library); 152 ClassElement element = Elements.classFromNode(node, library);
153 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); 153 List<DartTypeParameter> parameterNodes = node.getTypeParameters();
154 element.setType(Types.interfaceType(element, 154 element.setType(Types.interfaceType(element,
155 Elements.makeTypeVariables(parameterNo des, element))); 155 Elements.makeTypeVariables(parameterNo des, element)));
156 node.setSymbol(element); 156 node.setSymbol(element);
157 node.getName().setSymbol(element);
157 return null; 158 return null;
158 } 159 }
159 160
160 @Override 161 @Override
161 public Void visitFunctionTypeAlias(DartFunctionTypeAlias node) { 162 public Void visitFunctionTypeAlias(DartFunctionTypeAlias node) {
162 FunctionAliasElement element = Elements.functionTypeAliasFromNode(node, li brary); 163 FunctionAliasElement element = Elements.functionTypeAliasFromNode(node, li brary);
163 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); 164 List<DartTypeParameter> parameterNodes = node.getTypeParameters();
164 element.setType(Types.functionAliasType(element, 165 element.setType(Types.functionAliasType(element,
165 Elements.makeTypeVariables(paramet erNodes, element))); 166 Elements.makeTypeVariables(paramet erNodes, element)));
166 node.setSymbol(element); 167 node.setSymbol(element);
(...skipping 11 matching lines...) Expand all
178 Modifiers modifiers = node.getModifiers(); 179 Modifiers modifiers = node.getModifiers();
179 if (modifiers.isFinal()) { 180 if (modifiers.isFinal()) {
180 // final toplevel fields are implicitly compile-time constants. 181 // final toplevel fields are implicitly compile-time constants.
181 modifiers = modifiers.makeConstant(); 182 modifiers = modifiers.makeConstant();
182 } 183 }
183 node.setSymbol(Elements.fieldFromNode(node, library, modifiers)); 184 node.setSymbol(Elements.fieldFromNode(node, library, modifiers));
184 return null; 185 return null;
185 } 186 }
186 } 187 }
187 } 188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698