OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.import_table; | 4 library kernel.import_table; |
5 | 5 |
6 import 'ast.dart'; | 6 import 'ast.dart'; |
7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
8 | 8 |
9 abstract class ImportTable { | 9 abstract class ImportTable { |
10 int getImportIndex(Library library); | 10 int getImportIndex(Library library); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 throw '$referenceUri cannot refer to application library $targetUri'; | 95 throw '$referenceUri cannot refer to application library $targetUri'; |
96 } else { | 96 } else { |
97 table.addImport(target, target.importUri.toString()); | 97 table.addImport(target, target.importUri.toString()); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 visitClassReference(Class node) { | 101 visitClassReference(Class node) { |
102 addLibraryImport(node.enclosingLibrary); | 102 addLibraryImport(node.enclosingLibrary); |
103 } | 103 } |
104 | 104 |
| 105 visitLibrary(Library node) { |
| 106 super.visitLibrary(node); |
| 107 for (Reference exportedReference in node.additionalExports) { |
| 108 addLibraryImport(exportedReference.node.parent); |
| 109 } |
| 110 } |
| 111 |
105 defaultMemberReference(Member node) { | 112 defaultMemberReference(Member node) { |
106 addLibraryImport(node.enclosingLibrary); | 113 addLibraryImport(node.enclosingLibrary); |
107 } | 114 } |
108 | 115 |
109 visitName(Name name) { | 116 visitName(Name name) { |
110 if (name.library != null) { | 117 if (name.library != null) { |
111 addLibraryImport(name.library); | 118 addLibraryImport(name.library); |
112 } | 119 } |
113 } | 120 } |
114 } | 121 } |
OLD | NEW |