From 529544ce0ea4017586baf57a1cc4b2dda3c51432 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 18 Jan 2015 01:16:09 +1100 Subject: [PATCH] use generateUidIdentifier instead of generateUid --- lib/6to5/transformation/transformers/es6-destructuring.js | 5 ++--- lib/6to5/transformation/transformers/es6-let-scoping.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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; } };