@babel/plugin-transform-for-of
Advanced tools
Comparing version 7.9.0 to 7.10.0
@@ -20,3 +20,4 @@ "use strict"; | ||
loose, | ||
assumeArray | ||
assumeArray, | ||
allowArrayLike | ||
} = options; | ||
@@ -28,2 +29,10 @@ | ||
if (assumeArray === true && allowArrayLike === true) { | ||
throw new Error(`The assumeArray and allowArrayLike options cannot be used together in @babel/plugin-transform-for-of`); | ||
} | ||
if (allowArrayLike && /^7\.\d\./.test(api.version)) { | ||
throw new Error(`The allowArrayLike is only supported when using @babel/core@^7.10.0`); | ||
} | ||
if (assumeArray) { | ||
@@ -90,3 +99,3 @@ return { | ||
const buildForOfLoose = _core.template.statements(` | ||
for (var ITERATOR_HELPER = CREATE_ITERATOR_HELPER(OBJECT), STEP_KEY; | ||
for (var ITERATOR_HELPER = CREATE_ITERATOR_HELPER(OBJECT, ALLOW_ARRAY_LIKE), STEP_KEY; | ||
!(STEP_KEY = ITERATOR_HELPER()).done;) BODY; | ||
@@ -96,3 +105,3 @@ `); | ||
const buildForOf = _core.template.statements(` | ||
var ITERATOR_HELPER = CREATE_ITERATOR_HELPER(OBJECT), STEP_KEY; | ||
var ITERATOR_HELPER = CREATE_ITERATOR_HELPER(OBJECT, ALLOW_ARRAY_LIKE), STEP_KEY; | ||
try { | ||
@@ -187,2 +196,3 @@ for (ITERATOR_HELPER.s(); !(STEP_KEY = ITERATOR_HELPER.n()).done;) BODY; | ||
ITERATOR_HELPER: scope.generateUidIdentifier("iterator"), | ||
ALLOW_ARRAY_LIKE: allowArrayLike ? _core.types.booleanLiteral(true) : null, | ||
STEP_KEY: _core.types.identifier(stepKey), | ||
@@ -189,0 +199,0 @@ OBJECT: node.right, |
{ | ||
"name": "@babel/plugin-transform-for-of", | ||
"version": "7.9.0", | ||
"version": "7.10.0", | ||
"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.9.0", | ||
"@babel/core": "^7.10.0", | ||
"@babel/helper-plugin-test-runner": "^7.8.3" | ||
}, | ||
"gitHead": "8d5e422be27251cfaadf8dd2536b31b4a5024b02" | ||
"gitHead": "5da2440adff6f25579fb6e9a018062291c89416f" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13924
322
0