OLD | NEW |
1 // Copyright (c) 2012, 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 library dart2js.compiler_base; | 5 library dart2js.compiler_base; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 EventSink, | 8 EventSink, |
9 Future; | 9 Future; |
10 | 10 |
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 FunctionSignature resolveSignature(FunctionElement function) { | 1996 FunctionSignature resolveSignature(FunctionElement function) { |
1997 return compiler.resolver.resolveSignature(function); | 1997 return compiler.resolver.resolveSignature(function); |
1998 } | 1998 } |
1999 | 1999 |
2000 @override | 2000 @override |
2001 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { | 2001 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { |
2002 return compiler.resolver.resolveTypeAnnotation(element, node); | 2002 return compiler.resolver.resolveTypeAnnotation(element, node); |
2003 } | 2003 } |
2004 | 2004 |
2005 @override | 2005 @override |
| 2006 bool hasResolvedAst(Element element) { |
| 2007 return element is AstElement && |
| 2008 hasBeenResolved(element) && |
| 2009 element.hasResolvedAst; |
| 2010 } |
| 2011 |
| 2012 @override |
| 2013 ResolvedAst getResolvedAst(Element element) { |
| 2014 if (hasResolvedAst(element)) { |
| 2015 AstElement astElement = element; |
| 2016 return astElement.resolvedAst; |
| 2017 } |
| 2018 assert(invariant(element, hasResolvedAst(element), |
| 2019 message: "ResolvedAst not available for $element.")); |
| 2020 return null; |
| 2021 } |
| 2022 |
| 2023 |
| 2024 @override |
2006 bool hasResolutionImpact(Element element) { | 2025 bool hasResolutionImpact(Element element) { |
2007 return _resolutionImpactCache.containsKey(element); | 2026 return _resolutionImpactCache.containsKey(element); |
2008 } | 2027 } |
2009 | 2028 |
2010 @override | 2029 @override |
2011 ResolutionImpact getResolutionImpact(Element element) { | 2030 ResolutionImpact getResolutionImpact(Element element) { |
2012 ResolutionImpact resolutionImpact = _resolutionImpactCache[element]; | 2031 ResolutionImpact resolutionImpact = _resolutionImpactCache[element]; |
2013 assert(invariant(element, resolutionImpact != null, | 2032 assert(invariant(element, resolutionImpact != null, |
2014 message: "ResolutionImpact not available for $element.")); | 2033 message: "ResolutionImpact not available for $element.")); |
2015 return resolutionImpact; | 2034 return resolutionImpact; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 _ElementScanner(this.scanner); | 2183 _ElementScanner(this.scanner); |
2165 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2184 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
2166 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2185 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
2167 } | 2186 } |
2168 | 2187 |
2169 class _EmptyEnvironment implements Environment { | 2188 class _EmptyEnvironment implements Environment { |
2170 const _EmptyEnvironment(); | 2189 const _EmptyEnvironment(); |
2171 | 2190 |
2172 String valueOf(String key) => null; | 2191 String valueOf(String key) => null; |
2173 } | 2192 } |
OLD | NEW |