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

Side by Side Diff: frog/leg/elements/elements.dart

Issue 8949039: Make sure a class is resolved before looking up its elements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « no previous file | frog/leg/resolver.dart » ('j') | tests/language/language-leg.status » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #library('elements'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 members = members.prepend(element); 253 members = members.prepend(element);
254 } 254 }
255 255
256 Type computeType(compiler, types) { 256 Type computeType(compiler, types) {
257 if (type === null) { 257 if (type === null) {
258 type = new SimpleType(name, this); 258 type = new SimpleType(name, this);
259 } 259 }
260 return type; 260 return type;
261 } 261 }
262 262
263 void resolve(Compiler compiler) { 263 ClassElement resolve(Compiler compiler) {
264 if (isResolved) return; 264 if (!isResolved) {
265 compiler.resolveType(this); 265 compiler.resolveType(this);
266 isResolved = true; 266 isResolved = true;
267 }
268 return this;
267 } 269 }
268 270
269 Element lookupLocalElement(SourceString name) { 271 Element lookupLocalElement(SourceString name) {
270 // TODO(karlklose): replace with more efficient solution. 272 // TODO(karlklose): replace with more efficient solution.
271 for (Link<Element> link = members; 273 for (Link<Element> link = members;
272 link !== null && !link.isEmpty(); 274 link !== null && !link.isEmpty();
273 link = link.tail) { 275 link = link.tail) {
274 if (link.head.name == name) return link.head; 276 if (link.head.name == name) return link.head;
275 } 277 }
276 return null; 278 return null;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 && !element.isInstanceMember() 313 && !element.isInstanceMember()
312 && (element.kind === ElementKind.FIELD); 314 && (element.kind === ElementKind.FIELD);
313 } 315 }
314 316
315 static bool isInstanceMethod(Element element) { 317 static bool isInstanceMethod(Element element) {
316 return (element != null) 318 return (element != null)
317 && element.isInstanceMember() 319 && element.isInstanceMember()
318 && (element.kind === ElementKind.FUNCTION); 320 && (element.kind === ElementKind.FUNCTION);
319 } 321 }
320 } 322 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/resolver.dart » ('j') | tests/language/language-leg.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698