@babel/helper-module-transforms
Advanced tools
Comparing version 7.8.3 to 7.8.6
@@ -178,3 +178,3 @@ "use strict"; | ||
const getTemplateForReexport = loose => { | ||
return loose ? _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;` : _template.default` | ||
return loose ? _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;` : (0, _template.default)` | ||
Object.defineProperty(EXPORTS, "EXPORT_NAME", { | ||
@@ -235,3 +235,3 @@ enumerable: true, | ||
EXPORTS: metadata.exportName, | ||
VERIFY_NAME_LIST: metadata.exportNameListName ? _template.default` | ||
VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _template.default)` | ||
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return; | ||
@@ -238,0 +238,0 @@ `({ |
@@ -251,3 +251,43 @@ "use strict"; | ||
}, | ||
"ForOfStatement|ForInStatement"(path) { | ||
const { | ||
scope, | ||
node | ||
} = path; | ||
const { | ||
left | ||
} = node; | ||
const { | ||
exported, | ||
scope: programScope | ||
} = this; | ||
if (!t.isVariableDeclaration(left)) { | ||
let didTransform = false; | ||
const bodyPath = path.get("body"); | ||
const loopBodyScope = bodyPath.scope; | ||
for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) { | ||
if (exported.get(name) && programScope.getBinding(name) === scope.getBinding(name)) { | ||
didTransform = true; | ||
if (loopBodyScope.hasOwnBinding(name)) { | ||
loopBodyScope.rename(name); | ||
} | ||
} | ||
} | ||
if (!didTransform) { | ||
return; | ||
} | ||
const newLoopId = scope.generateUidIdentifierBasedOnNode(left); | ||
bodyPath.unshiftContainer("body", t.expressionStatement(t.assignmentExpression("=", left, newLoopId))); | ||
path.get("left").replaceWith(t.variableDeclaration("let", [t.variableDeclarator(newLoopId)])); | ||
scope.registerDeclaration(path.get("left")); | ||
} | ||
} | ||
}; |
@@ -8,2 +8,4 @@ "use strict"; | ||
var _helperReplaceSupers = require("@babel/helper-replace-supers"); | ||
function rewriteThis(programPath) { | ||
@@ -19,7 +21,7 @@ programPath.traverse(rewriteThisVisitor); | ||
Function(path) { | ||
if (!path.isArrowFunctionExpression()) path.skip(); | ||
if (path.isMethod()) (0, _helperReplaceSupers.skipAllButComputedKey)(path);else if (!path.isArrowFunctionExpression()) path.skip(); | ||
}, | ||
ClassProperty(path) { | ||
path.skip(); | ||
(0, _helperReplaceSupers.skipAllButComputedKey)(path); | ||
}, | ||
@@ -26,0 +28,0 @@ |
{ | ||
"name": "@babel/helper-module-transforms", | ||
"version": "7.8.3", | ||
"version": "7.8.6", | ||
"description": "Babel helper functions for implementing ES6 module transformations", | ||
@@ -15,9 +15,10 @@ "author": "Logan Smyth <loganfsmyth@gmail.com>", | ||
"@babel/helper-module-imports": "^7.8.3", | ||
"@babel/helper-replace-supers": "^7.8.6", | ||
"@babel/helper-simple-access": "^7.8.3", | ||
"@babel/helper-split-export-declaration": "^7.8.3", | ||
"@babel/template": "^7.8.3", | ||
"@babel/types": "^7.8.3", | ||
"@babel/template": "^7.8.6", | ||
"@babel/types": "^7.8.6", | ||
"lodash": "^4.17.13" | ||
}, | ||
"gitHead": "a7620bd266ae1345975767bbc7abf09034437017" | ||
"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
32657
819
7
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@babel/compat-data@7.26.2(transitive)
+ Added@babel/core@7.26.0(transitive)
+ Added@babel/helper-compilation-targets@7.25.9(transitive)
+ Added@babel/helper-member-expression-to-functions@7.25.9(transitive)
+ Added@babel/helper-module-transforms@7.26.0(transitive)
+ Added@babel/helper-optimise-call-expression@7.25.9(transitive)
+ Added@babel/helper-replace-supers@7.25.9(transitive)
+ Added@babel/helper-validator-option@7.25.9(transitive)
+ Added@babel/helpers@7.26.0(transitive)
+ Addedbrowserslist@4.24.2(transitive)
+ Addedcaniuse-lite@1.0.30001680(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addedelectron-to-chromium@1.5.63(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedgensync@1.0.0-beta.2(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addednode-releases@2.0.18(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedupdate-browserslist-db@1.1.1(transitive)
+ Addedyallist@3.1.1(transitive)
Updated@babel/template@^7.8.6
Updated@babel/types@^7.8.6