mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:03:19 +00:00
[ddc] Use renamed library name in export
Fixes the case where libraries got renamed when created and they are exported. Previously ddc was emitting broken code that incorrectly used the original name in the export. This bug was breaking some benchmarks at runtime. Change-Id: Id8b27d645766db41fb5ccb5c74d8655dd4a5d4ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157000 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Mark Zhou <markzipan@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
363c72111d
commit
8661e01552
|
@ -1326,11 +1326,11 @@ class Printer implements NodeVisitor {
|
||||||
if (node.isStar) {
|
if (node.isStar) {
|
||||||
out('*');
|
out('*');
|
||||||
} else {
|
} else {
|
||||||
var name = node.name.name;
|
var localName = localNamer.getName(node.name);
|
||||||
if (node.asName == null) {
|
if (node.asName == null) {
|
||||||
// If our local was renamed, generate an implicit "as".
|
// If our local was renamed, generate an implicit "as".
|
||||||
// This is a convenience feature so imports and exports can be renamed.
|
// This is a convenience feature so imports and exports can be renamed.
|
||||||
var localName = localNamer.getName(node.name);
|
var name = node.name.name;
|
||||||
if (localName != name) {
|
if (localName != name) {
|
||||||
out(export ? localName : name);
|
out(export ? localName : name);
|
||||||
out(' as ');
|
out(' as ');
|
||||||
|
@ -1338,7 +1338,7 @@ class Printer implements NodeVisitor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out(name);
|
out(localName);
|
||||||
}
|
}
|
||||||
if (node.asName != null) {
|
if (node.asName != null) {
|
||||||
out(' as ');
|
out(' as ');
|
||||||
|
|
Loading…
Reference in a new issue