@babel/plugin-transform-for-of
Advanced tools
Comparing version 7.4.0 to 7.4.3
@@ -85,3 +85,3 @@ "use strict"; | ||
const buildForOfArray = (0, _core().template)(` | ||
for (var KEY = 0; KEY < ARR.length; KEY++) BODY; | ||
for (var KEY = 0, NAME = ARR; KEY < NAME.length; KEY++) BODY; | ||
`); | ||
@@ -135,7 +135,3 @@ const buildForOfLoose = (0, _core().template)(` | ||
} = path; | ||
const uid = scope.generateUid("arr"); | ||
const nodes = [_core().types.variableDeclaration("var", [_core().types.variableDeclarator(_core().types.identifier(uid), node.right)])]; | ||
const right = _core().types.identifier(uid); | ||
const right = scope.generateUidIdentifierBasedOnNode(node.right, "arr"); | ||
const iterationKey = scope.generateUidIdentifier("i"); | ||
@@ -145,3 +141,4 @@ let loop = buildForOfArray({ | ||
KEY: iterationKey, | ||
ARR: right | ||
NAME: right, | ||
ARR: node.right | ||
}); | ||
@@ -168,4 +165,3 @@ | ||
nodes.push(loop); | ||
return nodes; | ||
return [loop]; | ||
} | ||
@@ -172,0 +168,0 @@ |
{ | ||
"name": "@babel/plugin-transform-for-of", | ||
"version": "7.4.0", | ||
"version": "7.4.3", | ||
"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.4.0", | ||
"@babel/core": "^7.4.3", | ||
"@babel/helper-plugin-test-runner": "^7.0.0" | ||
}, | ||
"gitHead": "f1328fb913b5a93d54dfc6e3728b1f56c8f4a804" | ||
"gitHead": "508fde4009f31883f318b9e6546459ac1b086a91" | ||
} |
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
11309
258