use generateUidIdentifier instead of generateUid

This commit is contained in:
Sebastian McKenzie
2015-01-18 01:16:09 +11:00
parent f298cd3f0f
commit 529544ce0e
2 changed files with 3 additions and 4 deletions

View File

@@ -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
});

View File

@@ -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;
}
};