diff --git a/CHANGELOG.md b/CHANGELOG.md index bc94105c47..49bca53ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,16 @@ _Note: Gaps between patch versions are faulty/broken releases._ * `specPropertyLiterals` -> `minification.propertyLiterals` * `specMemberExpressionLiterals` -> `minification.memberExpressionLiterals` +## 2.13.7 + + * **Bug Fix** + * Don't realias variables that are already declared in optional `coreAliasing` transformer. + +## 2.13.6 + + * **Bug Fix** + * Add `NewExpression` as a valid parent for parentheses insertion for `ConditionalExpression`. + ## 2.13.5 * **Bug Fix** diff --git a/lib/6to5/transformation/transformers/misc/self-contained.js b/lib/6to5/transformation/transformers/misc/self-contained.js index 332a3b2d23..6748950ac7 100644 --- a/lib/6to5/transformation/transformers/misc/self-contained.js +++ b/lib/6to5/transformation/transformers/misc/self-contained.js @@ -34,7 +34,7 @@ var astVisitor = { context.skip(); return t.prependToMemberExpression(node, file.get("coreIdentifier")); } - } else if (t.isReferencedIdentifier(node, parent) && !t.isMemberExpression(parent) && _.contains(ALIASABLE_CONSTRUCTORS, node.name)) { + } else if (t.isReferencedIdentifier(node, parent) && !t.isMemberExpression(parent) && _.contains(ALIASABLE_CONSTRUCTORS, node.name) && !scope.get(node.name, true)) { // Symbol() -> _core.Symbol(); new Promise -> new _core.Promise return t.memberExpression(file.get("coreIdentifier"), node); } else if (t.isCallExpression(node)) { diff --git a/package.json b/package.json index 6a82ffd25d..ee1c7656eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "6to5", "description": "Turn ES6 code into readable vanilla ES5 with source maps", - "version": "2.13.5", + "version": "2.13.7", "author": "Sebastian McKenzie ", "homepage": "https://6to5.org/", "repository": "6to5/6to5", diff --git a/test/fixtures/transformation/es6-let-scoping/switch-break/exec.js b/test/fixtures/transformation/es6-let-scoping/.switch-break/exec.js similarity index 100% rename from test/fixtures/transformation/es6-let-scoping/switch-break/exec.js rename to test/fixtures/transformation/es6-let-scoping/.switch-break/exec.js