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

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

Issue 8974014: Resolve initializers in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address 2nd round of comments. 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') | frog/leg/resolver.dart » ('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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 } 117 }
118 118
119 class ForeignElement extends Element { 119 class ForeignElement extends Element {
120 ForeignElement(SourceString name) : super(name, ElementKind.FOREIGN, null); 120 ForeignElement(SourceString name) : super(name, ElementKind.FOREIGN, null);
121 121
122 Type computeType(Compiler compiler, types) { 122 Type computeType(Compiler compiler, types) {
123 return types.dynamicType; 123 return types.dynamicType;
124 } 124 }
125 125
126 parseNode(compiler, types) { 126 parseNode(Canceler canceler, Logger logger) {
127 throw "internal error: ForeignElement has no node"; 127 throw "internal error: ForeignElement has no node";
128 } 128 }
129 } 129 }
130 130
131 /** 131 /**
132 * TODO(ngeoffray): Remove this method in favor of using the universe. 132 * TODO(ngeoffray): Remove this method in favor of using the universe.
133 * 133 *
134 * Return the type referred to by the type annotation. This method 134 * Return the type referred to by the type annotation. This method
135 * accepts annotations with 'typeName == null' to indicate a missing 135 * accepts annotations with 'typeName == null' to indicate a missing
136 * annotation. 136 * annotation.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // TODO(ngeoffray): Implement these. 281 // TODO(ngeoffray): Implement these.
282 bool canHaveDefaultConstructor() => true; 282 bool canHaveDefaultConstructor() => true;
283 283
284 SynthesizedConstructorElement getSynthesizedConstructor() { 284 SynthesizedConstructorElement getSynthesizedConstructor() {
285 if (synthesizedConstructor === null && canHaveDefaultConstructor()) { 285 if (synthesizedConstructor === null && canHaveDefaultConstructor()) {
286 synthesizedConstructor = new SynthesizedConstructorElement(this); 286 synthesizedConstructor = new SynthesizedConstructorElement(this);
287 } 287 }
288 return synthesizedConstructor; 288 return synthesizedConstructor;
289 } 289 }
290 290
291 parseNode(compiler, types) => node; 291 parseNode(Canceler canceler, Logger logger) => node;
292 292
293 /** 293 /**
294 * Returns the super class, if any. 294 * Returns the super class, if any.
295 * 295 *
296 * The returned element may not be resolved yet. 296 * The returned element may not be resolved yet.
297 */ 297 */
298 ClassElement get superClass() { 298 ClassElement get superClass() {
299 assert(isResolved); 299 assert(isResolved);
300 return supertype === null ? null : supertype.element; 300 return supertype === null ? null : supertype.element;
301 } 301 }
(...skipping 11 matching lines...) Expand all
313 && !element.isInstanceMember() 313 && !element.isInstanceMember()
314 && (element.kind === ElementKind.FIELD); 314 && (element.kind === ElementKind.FIELD);
315 } 315 }
316 316
317 static bool isInstanceMethod(Element element) { 317 static bool isInstanceMethod(Element element) {
318 return (element != null) 318 return (element != null)
319 && element.isInstanceMember() 319 && element.isInstanceMember()
320 && (element.kind === ElementKind.FUNCTION); 320 && (element.kind === ElementKind.FUNCTION);
321 } 321 }
322 } 322 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/resolver.dart » ('j') | frog/leg/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698