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 import 'package:analyzer/src/generated/ast.dart'; | 6 import 'package:analyzer/src/generated/ast.dart'; |
7 import 'package:analyzer/src/generated/element.dart'; | 7 import 'package:analyzer/src/generated/element.dart'; |
8 import 'package:dev_compiler/src/dependency_graph.dart' show corelibOrder; | 8 import 'package:dev_compiler/src/compiler.dart' show corelibOrder; |
9 | 9 |
10 typedef void ModuleItemEmitter(AstNode item); | 10 typedef void ModuleItemEmitter(AstNode item); |
11 | 11 |
12 /// Helper that tracks order of elements visited by the compiler, detecting | 12 /// Helper that tracks order of elements visited by the compiler, detecting |
13 /// if the top level item can be loaded eagerly or not. | 13 /// if the top level item can be loaded eagerly or not. |
14 class ModuleItemLoadOrder { | 14 class ModuleItemLoadOrder { |
15 | 15 |
16 /// The order that elements should be emitted in, with a bit indicating if | 16 /// The order that elements should be emitted in, with a bit indicating if |
17 /// the element should be generated lazily. The value will be `false` if | 17 /// the element should be generated lazily. The value will be `false` if |
18 /// the item could not be loaded, and needs to be made lazy. | 18 /// the item could not be loaded, and needs to be made lazy. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 return _libraryCycleMemo[library] = result; | 227 return _libraryCycleMemo[library] = result; |
228 } | 228 } |
229 | 229 |
230 /// Returns whether this is a library imported with 'dart:' URI. | 230 /// Returns whether this is a library imported with 'dart:' URI. |
231 /// | 231 /// |
232 /// This is similar to [LibraryElement.isInSdk], but checking the URI instead | 232 /// This is similar to [LibraryElement.isInSdk], but checking the URI instead |
233 /// of the library naming convention, because the URI is reliable. | 233 /// of the library naming convention, because the URI is reliable. |
234 static bool _isDartUri(LibraryElement e) => e.source.uri.scheme == 'dart'; | 234 static bool _isDartUri(LibraryElement e) => e.source.uri.scheme == 'dart'; |
235 } | 235 } |
OLD | NEW |