Mangling externally imported names by using aliasing

This commit is contained in:
Fábio Santos
2016-02-27 12:01:16 +00:00
committed by Richard van Velzen
parent 59e1601fb8
commit 86b5248837
5 changed files with 44 additions and 2 deletions

View File

@@ -707,6 +707,12 @@ var AST_NameImport = DEFNODE("NameImport", "foreign_name name", {
$propdoc: {
foreign_name: "[AST_SymbolImportForeign] The name being imported (as specified in the module)",
name: "[AST_SymbolImport] The name as it becomes available to this module."
},
_walk: function (visitor) {
return visitor._visit(this, function() {
this.foreign_name._walk(visitor);
this.name._walk(visitor);
});
}
})
@@ -722,6 +728,11 @@ var AST_Import = DEFNODE("Import", "imported_name imported_names module_name", {
if (this.imported_name) {
this.imported_name._walk(visitor);
}
if (this.imported_names) {
this.imported_names.forEach(function (name_import) {
name_import._walk(visitor);
});
}
this.module_name._walk(visitor);
});
}