| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |