Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: pkg/kernel/lib/import_table.dart

Issue 3009953003: Store actual Reference(s) for additional exports. (Closed)
Patch Set: Use references, but keep JSON hacks for errors and void/dynamic. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698