@babel/plugin-transform-for-of
Advanced tools
Comparing version 7.8.4 to 7.8.6
@@ -34,3 +34,2 @@ "use strict"; | ||
right, | ||
body, | ||
await: isAwait | ||
@@ -64,6 +63,13 @@ } = path.node; | ||
const block = _core.types.toBlock(body); | ||
let blockBody; | ||
const body = path.get("body"); | ||
block.body.unshift(assignment); | ||
path.replaceWith(_core.types.forStatement(_core.types.variableDeclaration("let", inits), _core.types.binaryExpression("<", _core.types.cloneNode(i), _core.types.memberExpression(_core.types.cloneNode(array), _core.types.identifier("length"))), _core.types.updateExpression("++", _core.types.cloneNode(i)), block)); | ||
if (body.isBlockStatement() && Object.keys(path.getBindingIdentifiers()).some(id => body.scope.hasOwnBinding(id))) { | ||
blockBody = _core.types.blockStatement([assignment, body.node]); | ||
} else { | ||
blockBody = _core.types.toBlock(body.node); | ||
blockBody.body.unshift(assignment); | ||
} | ||
path.replaceWith(_core.types.forStatement(_core.types.variableDeclaration("let", inits), _core.types.binaryExpression("<", _core.types.cloneNode(i), _core.types.memberExpression(_core.types.cloneNode(array), _core.types.identifier("length"))), _core.types.updateExpression("++", _core.types.cloneNode(i)), blockBody)); | ||
} | ||
@@ -70,0 +76,0 @@ |
{ | ||
"name": "@babel/plugin-transform-for-of", | ||
"version": "7.8.4", | ||
"version": "7.8.6", | ||
"description": "Compile ES2015 for...of to ES5", | ||
@@ -21,6 +21,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of", | ||
"devDependencies": { | ||
"@babel/core": "^7.8.4", | ||
"@babel/core": "^7.8.6", | ||
"@babel/helper-plugin-test-runner": "^7.8.3" | ||
}, | ||
"gitHead": "5c2e6bc07fed3d28801d93168622c99ae622653a" | ||
"gitHead": "750d3dde3bd2d390819820fd22c05441da78751b" | ||
} |
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
11386
255