use generateUidIdentifier instead of generateUid
This commit is contained in:
@@ -249,10 +249,9 @@ exports.AssignmentExpression = function (node, parent, scope, context, file) {
|
||||
if (parent.type === "ExpressionStatement") return;
|
||||
if (!t.isPattern(node.left)) return;
|
||||
|
||||
var tempName = file.generateUid("temp", scope);
|
||||
var ref = t.identifier(tempName);
|
||||
var ref = file.generateUidIdentifier("temp", scope);
|
||||
scope.push({
|
||||
key: tempName,
|
||||
key: ref.name,
|
||||
id: ref
|
||||
});
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ LetScoping.prototype.getInfo = function () {
|
||||
if (has && has !== id) {
|
||||
// there's a variable with this exact name in an upper scope so we need
|
||||
// to generate a new name
|
||||
opts.duplicates[key] = id.name = file.generateUid(key, scope);
|
||||
opts.duplicates[key] = id.name = file.generateUidIdentifier(key, scope).name;
|
||||
opts.hasDuplicates = true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user