default newName in scope.rename to a new uid
This commit is contained in:
parent
0c1e1e757c
commit
7b8118d8bd
@ -17,9 +17,7 @@ CommonJSFormatter.prototype.init = function () {
|
||||
var file = this.file;
|
||||
var scope = file.scope;
|
||||
|
||||
if (scope.hasBinding("module")) {
|
||||
scope.rename("module", file.generateUidIdentifier("module").name);
|
||||
}
|
||||
scope.rename("module");
|
||||
|
||||
if (!this.noInteropRequireImport && this.hasNonDefaultExports) {
|
||||
file.ast.program.body.push(util.template("exports-module-declaration", true));
|
||||
|
||||
@ -146,6 +146,8 @@ Scope.prototype.checkBlockScopedCollisions = function (kind, name, id) {
|
||||
};
|
||||
|
||||
Scope.prototype.rename = function (oldName, newName) {
|
||||
newName = newName || this.generateUidIdentifier(oldName).name;
|
||||
|
||||
var info = this.getBindingInfo(oldName);
|
||||
if (!info) return;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user