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 EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
8 | 8 |
9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
10 import 'cache_strategy.dart' show CacheStrategy; | 10 import 'cache_strategy.dart' show CacheStrategy; |
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 FunctionSignature resolveSignature(FunctionElement function) { | 1887 FunctionSignature resolveSignature(FunctionElement function) { |
1888 return compiler.resolver.resolveSignature(function); | 1888 return compiler.resolver.resolveSignature(function); |
1889 } | 1889 } |
1890 | 1890 |
1891 @override | 1891 @override |
1892 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { | 1892 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { |
1893 return compiler.resolver.resolveTypeAnnotation(element, node); | 1893 return compiler.resolver.resolveTypeAnnotation(element, node); |
1894 } | 1894 } |
1895 | 1895 |
1896 @override | 1896 @override |
| 1897 bool hasResolvedAst(Element element) { |
| 1898 return element is AstElement && |
| 1899 hasBeenResolved(element) && |
| 1900 element.hasResolvedAst; |
| 1901 } |
| 1902 |
| 1903 @override |
| 1904 ResolvedAst getResolvedAst(Element element) { |
| 1905 if (hasResolvedAst(element)) { |
| 1906 AstElement astElement = element; |
| 1907 return astElement.resolvedAst; |
| 1908 } |
| 1909 assert(invariant(element, hasResolvedAst(element), |
| 1910 message: "ResolvedAst not available for $element.")); |
| 1911 return null; |
| 1912 } |
| 1913 |
| 1914 |
| 1915 @override |
1897 bool hasResolutionImpact(Element element) { | 1916 bool hasResolutionImpact(Element element) { |
1898 return _resolutionImpactCache.containsKey(element); | 1917 return _resolutionImpactCache.containsKey(element); |
1899 } | 1918 } |
1900 | 1919 |
1901 @override | 1920 @override |
1902 ResolutionImpact getResolutionImpact(Element element) { | 1921 ResolutionImpact getResolutionImpact(Element element) { |
1903 ResolutionImpact resolutionImpact = _resolutionImpactCache[element]; | 1922 ResolutionImpact resolutionImpact = _resolutionImpactCache[element]; |
1904 assert(invariant(element, resolutionImpact != null, | 1923 assert(invariant(element, resolutionImpact != null, |
1905 message: "ResolutionImpact not available for $element.")); | 1924 message: "ResolutionImpact not available for $element.")); |
1906 return resolutionImpact; | 1925 return resolutionImpact; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 _ElementScanner(this.scanner); | 2073 _ElementScanner(this.scanner); |
2055 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2074 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
2056 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2075 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
2057 } | 2076 } |
2058 | 2077 |
2059 class _EmptyEnvironment implements Environment { | 2078 class _EmptyEnvironment implements Environment { |
2060 const _EmptyEnvironment(); | 2079 const _EmptyEnvironment(); |
2061 | 2080 |
2062 String valueOf(String key) => null; | 2081 String valueOf(String key) => null; |
2063 } | 2082 } |
OLD | NEW |