diff --git a/lib/6to5/transformation/transformers/es6-destructuring.js b/lib/6to5/transformation/transformers/es6-destructuring.js index bcd04ba4b2..8b1f5ae882 100644 --- a/lib/6to5/transformation/transformers/es6-destructuring.js +++ b/lib/6to5/transformation/transformers/es6-destructuring.js @@ -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 }); diff --git a/lib/6to5/transformation/transformers/es6-let-scoping.js b/lib/6to5/transformation/transformers/es6-let-scoping.js index 7c589851cd..d6ccf9078f 100644 --- a/lib/6to5/transformation/transformers/es6-let-scoping.js +++ b/lib/6to5/transformation/transformers/es6-let-scoping.js @@ -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; } };