| 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 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 return hasBeenResolved(element.memberContext.declaration) && | 1927 return hasBeenResolved(element.memberContext.declaration) && |
| 1928 element.hasResolvedAst; | 1928 element.hasResolvedAst; |
| 1929 } | 1929 } |
| 1930 | 1930 |
| 1931 @override | 1931 @override |
| 1932 ResolvedAst getResolvedAst(ExecutableElement element) { | 1932 ResolvedAst getResolvedAst(ExecutableElement element) { |
| 1933 assert(invariant(element, element.isDeclaration, | 1933 assert(invariant(element, element.isDeclaration, |
| 1934 message: "Element $element must be the declaration.")); | 1934 message: "Element $element must be the declaration.")); |
| 1935 assert(invariant(element, hasResolvedAst(element), | 1935 assert(invariant(element, hasResolvedAst(element), |
| 1936 message: "ResolvedAst not available for $element.")); | 1936 message: "ResolvedAst not available for $element.")); |
| 1937 if (compiler.serialization.isDeserialized(element)) { | |
| 1938 return compiler.serialization.getResolvedAst(element); | |
| 1939 } | |
| 1940 return element.resolvedAst; | 1937 return element.resolvedAst; |
| 1941 } | 1938 } |
| 1942 | 1939 |
| 1943 @override | 1940 @override |
| 1944 ResolvedAst computeResolvedAst(Element element) { | 1941 ResolvedAst computeResolvedAst(Element element) { |
| 1945 ensureResolved(element); | 1942 ensureResolved(element); |
| 1946 return getResolvedAst(element); | 1943 return getResolvedAst(element); |
| 1947 } | 1944 } |
| 1948 | 1945 |
| 1949 @override | 1946 @override |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 _ElementScanner(this.scanner); | 2090 _ElementScanner(this.scanner); |
| 2094 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2091 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 2095 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2092 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 2096 } | 2093 } |
| 2097 | 2094 |
| 2098 class _EmptyEnvironment implements Environment { | 2095 class _EmptyEnvironment implements Environment { |
| 2099 const _EmptyEnvironment(); | 2096 const _EmptyEnvironment(); |
| 2100 | 2097 |
| 2101 String valueOf(String key) => null; | 2098 String valueOf(String key) => null; |
| 2102 } | 2099 } |
| OLD | NEW |