babel-plugin-transform-es2015-block-scoping
Advanced tools
Comparing version
@@ -125,3 +125,3 @@ "use strict"; | ||
if (moveBindingsToParent) { | ||
var parentScope = scope.getFunctionParent(); | ||
var parentScope = scope.getFunctionParent() || scope.getProgramParent(); | ||
var ids = path.getBindingIdentifiers(); | ||
@@ -335,3 +335,3 @@ | ||
var scope = this.scope; | ||
var parentScope = scope.getFunctionParent(); | ||
var parentScope = scope.getFunctionParent() || scope.getProgramParent(); | ||
var letRefs = this.letReferences; | ||
@@ -399,4 +399,6 @@ | ||
this.hoistVarDeclarations(); | ||
var params = (0, _values2.default)(outsideRefs); | ||
var args = (0, _values2.default)(outsideRefs); | ||
var params = args.map(function (id) { | ||
return t.clone(id); | ||
}); | ||
var isSwitch = this.blockPath.isSwitchStatement(); | ||
@@ -403,0 +405,0 @@ var fn = t.functionExpression(null, params, t.blockStatement(isSwitch ? [block] : block.body)); |
{ | ||
"name": "babel-plugin-transform-es2015-block-scoping", | ||
"version": "7.0.0-alpha.17", | ||
"version": "7.0.0-alpha.18", | ||
"description": "Compile ES2015 block scoping (const and let) to ES5", | ||
@@ -9,5 +9,5 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-block-scoping", | ||
"dependencies": { | ||
"babel-template": "7.0.0-alpha.17", | ||
"babel-traverse": "7.0.0-alpha.17", | ||
"babel-types": "7.0.0-alpha.17", | ||
"babel-template": "7.0.0-alpha.18", | ||
"babel-traverse": "7.0.0-alpha.18", | ||
"babel-types": "7.0.0-alpha.18", | ||
"lodash": "^4.2.0" | ||
@@ -19,4 +19,4 @@ }, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.17" | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.18" | ||
} | ||
} |
23624
0.34%605
0.33%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated