lebab
Advanced tools
Comparing version 3.2.3 to 3.2.4
@@ -65,3 +65,2 @@ "use strict"; | ||
} | ||
warnings.forEach(function (_ref) { | ||
@@ -68,0 +67,0 @@ var line = _ref.line, |
@@ -40,3 +40,3 @@ "use strict"; | ||
* registered as function scoped, during hoisting phase. | ||
* Later thay can also be registered in block scope. | ||
* Later they can also be registered in block scope. | ||
* | ||
@@ -43,0 +43,0 @@ * Ignores attempts to register the same variable twice. |
@@ -98,3 +98,2 @@ "use strict"; | ||
} | ||
return arrow; | ||
@@ -101,0 +100,0 @@ } |
@@ -22,3 +22,2 @@ "use strict"; | ||
}, | ||
computed: false, | ||
@@ -25,0 +24,0 @@ value: _isTransformableToMethod["default"] |
@@ -32,3 +32,3 @@ "use strict"; | ||
fn.params = fn.params.map(function (param, i) { | ||
// Ignore params that use destructoring or already have a default | ||
// Ignore params that use destructuring or already have a default | ||
if (param.type !== 'Identifier') { | ||
@@ -35,0 +35,0 @@ return param; |
@@ -36,5 +36,5 @@ "use strict"; | ||
} else if (indexKind !== 'let') { | ||
return [node, 'Only for-loops with indexes declared as let can be tranformed (use let transform first)']; | ||
return [node, 'Only for-loops with indexes declared as let can be transformed (use let transform first)']; | ||
} else if (itemKind !== 'const') { | ||
return [node, 'Only for-loops with const array items can be tranformed (use let transform first)']; | ||
return [node, 'Only for-loops with const array items can be transformed (use let transform first)']; | ||
} | ||
@@ -41,0 +41,0 @@ } |
@@ -30,3 +30,3 @@ "use strict"; | ||
if (matches.itemKind === 'var' || matches.indexKind === 'var') { | ||
logger.warn(node, 'Only for-loops with let/const can be tranformed (use let transform first)', 'for-of'); | ||
logger.warn(node, 'Only for-loops with let/const can be transformed (use let transform first)', 'for-of'); | ||
return; | ||
@@ -74,3 +74,2 @@ } | ||
}], | ||
kind: itemKind | ||
@@ -77,0 +76,0 @@ }, |
@@ -32,2 +32,10 @@ "use strict"; | ||
// Matches the first element in array pattern | ||
// The default matches() tries to match against any array element. | ||
var matchesFirst = function matchesFirst(patterns) { | ||
return function (array) { | ||
return (0, _fMatches.matches)(patterns[0], array[0]); | ||
}; | ||
}; | ||
// Matches for-loop | ||
@@ -77,3 +85,3 @@ // without checking the consistency of index and array variables: | ||
type: 'BlockStatement', | ||
body: [{ | ||
body: matchesFirst([{ | ||
type: 'VariableDeclaration', | ||
@@ -95,3 +103,3 @@ declarations: [{ | ||
kind: (0, _fMatches.extractAny)('itemKind') | ||
}] | ||
}]) | ||
}) | ||
@@ -98,0 +106,0 @@ }); |
{ | ||
"name": "lebab", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"description": "Turn your ES5 code into readable ES6/ES7", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
279360
5824