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

Unified Diff: pkg/kernel/lib/text/ast_to_text.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 side-by-side diff with in-line comments
Download patch
Index: pkg/kernel/lib/text/ast_to_text.dart
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
index 12d012a1e07dd49b5862c54c99ac148c4f049dbd..1c5b71b4a885157c058dee83823e5ec3c403f5fd 100644
--- a/pkg/kernel/lib/text/ast_to_text.dart
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -283,7 +283,35 @@ class Printer extends Visitor<Null> {
endLine('import "$importPath" as $prefix;');
}
}
+
// TODO(scheglov): Do we want to print dependencies? dartbug.com/30224
+ if (library.additionalExports.isNotEmpty) {
+ write('additionalExports = (');
+ for (var reference in library.additionalExports) {
+ var node = reference.node;
+ if (node is Class) {
+ Library nodeLibrary = node.enclosingLibrary;
+ String prefix = syntheticNames.nameLibraryPrefix(nodeLibrary);
+ write(prefix + '::' + node.name);
+ } else if (node is Field) {
+ Library nodeLibrary = node.enclosingLibrary;
+ String prefix = syntheticNames.nameLibraryPrefix(nodeLibrary);
+ write(prefix + '::' + node.name.name);
+ } else if (node is Procedure) {
+ Library nodeLibrary = node.enclosingLibrary;
+ String prefix = syntheticNames.nameLibraryPrefix(nodeLibrary);
+ write(prefix + '::' + node.name.name);
+ } else if (node is Typedef) {
+ Library nodeLibrary = node.enclosingLibrary;
+ String prefix = syntheticNames.nameLibraryPrefix(nodeLibrary);
+ write(prefix + '::' + node.name);
+ } else {
+ throw new UnimplementedError('${node.runtimeType}');
+ }
+ }
+ endLine(')');
+ }
+
endLine();
var inner = new Printer._inner(this, imports);
library.typedefs.forEach(inner.writeNode);

Powered by Google App Engine
This is Rietveld 408576698