@babel/plugin-transform-block-scoping
Advanced tools
Comparing version 8.0.0-alpha.7 to 8.0.0-alpha.8
@@ -186,13 +186,10 @@ import { declare } from '@babel/helper-plugin-utils'; | ||
assign.push(types.assignmentExpression("=", decl.id, decl.init)); | ||
} else if (types.isForXStatement(varPath.parent, { | ||
left: varPath.node | ||
})) { | ||
assign.push(decl.id); | ||
} | ||
} | ||
if (assign.length > 0) { | ||
let replacement = assign.length === 1 ? assign[0] : types.sequenceExpression(assign); | ||
if (!types.isForStatement(varPath.parent, { | ||
init: varPath.node | ||
}) && !types.isForXStatement(varPath.parent, { | ||
left: varPath.node | ||
})) { | ||
replacement = types.expressionStatement(replacement); | ||
} | ||
const replacement = assign.length === 1 ? assign[0] : types.sequenceExpression(assign); | ||
varPath.replaceWith(replacement); | ||
@@ -503,3 +500,3 @@ } else { | ||
var index = declare((api, opts) => { | ||
api.assertVersion("8.0.0-alpha.7"); | ||
api.assertVersion("8.0.0-alpha.8"); | ||
const { | ||
@@ -532,10 +529,10 @@ throwIfClosureRequired = false, | ||
bodyScope = body.scope; | ||
const bindings = getLoopBodyBindings(path); | ||
for (const binding of bindings) { | ||
const { | ||
capturedInClosure | ||
} = getUsageInBody(binding, path); | ||
if (capturedInClosure) markNeedsBodyWrap(); | ||
} | ||
} | ||
const bindings = getLoopBodyBindings(path); | ||
for (const binding of bindings) { | ||
const { | ||
capturedInClosure | ||
} = getUsageInBody(binding, path); | ||
if (capturedInClosure) markNeedsBodyWrap(); | ||
} | ||
const captured = []; | ||
@@ -542,0 +539,0 @@ const updatedBindingsUsages = new Map(); |
{ | ||
"name": "@babel/plugin-transform-block-scoping", | ||
"version": "8.0.0-alpha.7", | ||
"version": "8.0.0-alpha.8", | ||
"description": "Compile ES2015 block scoping (const and let) to ES5", | ||
@@ -17,3 +17,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.7" | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.8" | ||
}, | ||
@@ -24,8 +24,8 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@babel/core": "^8.0.0-alpha.7" | ||
"@babel/core": "^8.0.0-alpha.8" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^8.0.0-alpha.7", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.7", | ||
"@babel/traverse": "^8.0.0-alpha.7" | ||
"@babel/core": "^8.0.0-alpha.8", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.8", | ||
"@babel/traverse": "^8.0.0-alpha.8" | ||
}, | ||
@@ -32,0 +32,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87148
664