From a0219ef278d6765d73e85e682a7f1e299c3b68a1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 5 Dec 2014 09:55:26 +1100 Subject: [PATCH] fix let scoping unneccesary override - fixes #245 --- CHANGELOG.md | 4 ++++ lib/6to5/traverse/scope.js | 2 +- lib/6to5/types/index.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c7f7ef26b..247ff77e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.14.1 + + * Fix let scoping unneccesary override. + # 1.14.6 * Avoid ensuring a block on non-array node replacements. diff --git a/lib/6to5/traverse/scope.js b/lib/6to5/traverse/scope.js index 9666edafa3..98cf4f1710 100644 --- a/lib/6to5/traverse/scope.js +++ b/lib/6to5/traverse/scope.js @@ -23,7 +23,7 @@ function Scope(block, parent) { Scope.add = function (node, references) { if (!node) return; - _.merge(references, t.getIds(node, true)); + _.defaults(references, t.getIds(node, true)); }; Scope.prototype.getReferences = function () { diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 931cfa0ebb..f741debaff 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -162,7 +162,7 @@ t.toIdentifier = function (name) { return c ? c.toUpperCase() : ""; }); - return name; + return name || '_'; }; t.isValidIdentifier = function (name) {