Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Represents a meta-value for code generation. | 6 * Represents a meta-value for code generation. |
| 7 */ | 7 */ |
| 8 class Value { | 8 class Value { |
| 9 /** The [Type] of the [Value]. */ | 9 /** The [Type] of the [Value]. */ |
| 10 Type type; | 10 Type type; |
| 11 | 11 |
| 12 /** The javascript code to generate this value. */ | 12 /** The javascript code to generate this value. */ |
| 13 String code; | 13 String code; |
| 14 | 14 |
| 15 /** The source location that created this value for error messages. */ | 15 /** The source location that created this value for error messages. */ |
| 16 SourceSpan span; | 16 SourceSpan span; |
| 17 | 17 |
| 18 /** Is this a reference to super? */ | 18 /** Is this a reference to super? */ |
| 19 bool isSuper = false; | 19 bool isSuper = false; |
| 20 | 20 |
| 21 /** Is this a pretend first-class type? */ | 21 /** Is this a pretend first-class type? */ |
| 22 bool isType = false; | 22 bool isType = false; |
| 23 | 23 |
| 24 /** Is this a final variable? */ | |
| 25 bool isFinal = false; | |
|
jimhug
2011/11/17 15:36:15
Okay for now - but this is a reminder that I need
| |
| 26 | |
| 24 /** If we reference this value multiple times, do we need a temp? */ | 27 /** If we reference this value multiple times, do we need a temp? */ |
| 25 bool needsTemp; | 28 bool needsTemp; |
| 26 | 29 |
| 27 // TODO(jmesserly): until reified generics are fixed, treat ParameterType as | 30 // TODO(jmesserly): until reified generics are fixed, treat ParameterType as |
| 28 // "var". | 31 // "var". |
| 29 bool get _typeIsVarOrParameterType() => type.isVar || type is ParameterType; | 32 bool get _typeIsVarOrParameterType() => type.isVar || type is ParameterType; |
| 30 | 33 |
| 31 Value(this.type, this.code, this.span, [this.needsTemp = true]) { | 34 Value(this.type, this.code, this.span, [this.needsTemp = true]) { |
| 32 if (type == null) world.internalError('type passed as null', span); | 35 if (type == null) world.internalError('type passed as null', span); |
| 33 } | 36 } |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 | 702 |
| 700 // Then look for members in my library. | 703 // Then look for members in my library. |
| 701 member = home.library.lookup(name, span); | 704 member = home.library.lookup(name, span); |
| 702 if (member != null) { | 705 if (member != null) { |
| 703 return member; | 706 return member; |
| 704 } | 707 } |
| 705 | 708 |
| 706 return null; | 709 return null; |
| 707 } | 710 } |
| 708 } | 711 } |
| OLD | NEW |