OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:collection' show HashMap; | 5 import 'dart:collection' show HashMap; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 | 9 |
10 import '../compiler.dart' show corelibOrder; | 10 import '../compiler.dart' show corelibOrder; |
11 | 11 |
12 typedef void ModuleItemEmitter(AstNode item); | 12 typedef void ModuleItemEmitter(AstNode item); |
13 | 13 |
14 /// Helper that tracks order of elements visited by the compiler, detecting | 14 /// Helper that tracks order of elements visited by the compiler, detecting |
15 /// if the top level item can be loaded eagerly or not. | 15 /// if the top level item can be loaded eagerly or not. |
16 class ModuleItemLoadOrder { | 16 class ModuleItemLoadOrder { |
17 /// The order that elements should be emitted in, with a bit indicating if | 17 /// The order that elements should be emitted in, with a bit indicating if |
18 /// the element should be generated lazily. The value will be `false` if | 18 /// the element should be generated lazily. The value will be `false` if |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if (result) break; | 251 if (result) break; |
252 result = _inLibraryCycle(e.importedLibrary); | 252 result = _inLibraryCycle(e.importedLibrary); |
253 } | 253 } |
254 for (var e in library.exports) { | 254 for (var e in library.exports) { |
255 if (result) break; | 255 if (result) break; |
256 result = _inLibraryCycle(e.exportedLibrary); | 256 result = _inLibraryCycle(e.exportedLibrary); |
257 } | 257 } |
258 return _libraryCycleMemo[library] = result; | 258 return _libraryCycleMemo[library] = result; |
259 } | 259 } |
260 } | 260 } |
OLD | NEW |