Compare commits

...

4 Commits

Author SHA1 Message Date
Sebastian McKenzie
7c1a924ef6 v1.14.14 2014-12-06 00:04:00 +11:00
Sebastian McKenzie
1d975a2635 Fix tagged template literals 2014-12-06 00:03:11 +11:00
Sebastian McKenzie
67cfdbd447 better closure variable name in default parameters 2014-12-06 00:00:09 +11:00
Sebastian McKenzie
ab02231d39 fix template literals escaping 2014-12-06 00:00:00 +11:00
4 changed files with 10 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
# 1.14.14
* Fix template literals escaping.
# 1.14.13
* Fix let scoping of `while` loops.

View File

@@ -11,7 +11,7 @@ exports.Function = function (node, parent, file, scope) {
return t.getIds(param);
});
var closure = false;
var iife = false;
_.each(node.defaults, function (def, i) {
if (!def) return;
@@ -29,7 +29,7 @@ exports.Function = function (node, parent, file, scope) {
}
if (scope.has(node.name)) {
closure = true;
iife = true;
}
};
@@ -40,7 +40,7 @@ exports.Function = function (node, parent, file, scope) {
// we're accessing a variable that's already defined within this function
var has = scope.get(param.name);
if (has && !_.contains(node.params, has)) {
closure = true;
iife = true;
}
});
@@ -55,7 +55,7 @@ exports.Function = function (node, parent, file, scope) {
}, true));
});
if (closure) {
if (iife) {
var container = t.functionExpression(null, [], node.body, node.generator);
container._aliasFunction = true;

View File

@@ -31,7 +31,7 @@ exports.TemplateLiteral = function (node) {
var nodes = [];
_.each(node.quasis, function (elem) {
nodes.push(t.literal(elem.value.raw));
nodes.push(t.literal(elem.value.cooked));
var expr = node.expressions.shift();
if (expr) {

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "1.14.13",
"version": "1.14.14",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://github.com/6to5/6to5",
"repository": {