Chromium Code Reviews| Index: pkg/kernel/lib/ast.dart |
| diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart |
| index f051b14ade22132f252350ab363b45c0099bf252..bbb714990cef81b28a087ae543e7f8b1e69c64b1 100644 |
| --- a/pkg/kernel/lib/ast.dart |
| +++ b/pkg/kernel/lib/ast.dart |
| @@ -4216,7 +4216,7 @@ class Supertype extends Node { |
| /// A way to bundle up all the libraries in a program. |
| class Program extends TreeNode { |
| - final CanonicalName root = new CanonicalName.root(); |
| + final CanonicalName root; |
|
Siggi Cherem (dart-lang)
2017/05/10 18:00:38
Question for Kevin on API design here:
- should w
Kevin Millikin (Google)
2017/05/11 08:22:55
Even without these changes, Program is already not
|
| final List<Library> libraries; |
| @@ -4228,14 +4228,19 @@ class Program extends TreeNode { |
| /// Reference to the main method in one of the libraries. |
| Reference mainMethodName; |
| - Program([List<Library> libraries, Map<String, Source> uriToSource]) |
| - : libraries = libraries ?? <Library>[], |
| + Program( |
| + {CanonicalName nameRoot, |
| + List<Library> libraries, |
| + Map<String, Source> uriToSource}) |
| + : root = nameRoot ?? new CanonicalName.root(), |
| + libraries = libraries ?? <Library>[], |
| uriToSource = uriToSource ?? <String, Source>{} { |
| setParents(this.libraries, this); |
| } |
| void computeCanonicalNames() { |
| for (var library in libraries) { |
| + if (library.canonicalName != null) continue; |
|
Kevin Millikin (Google)
2017/05/11 08:22:55
Keep in mind that this approach of skipping librar
scheglov
2017/05/11 18:31:25
OK, I rolled this back.
|
| root.getChildFromUri(library.importUri).bindTo(library.reference); |
| library.computeCanonicalNames(); |
| } |