@babel/plugin-transform-modules-systemjs
Advanced tools
Comparing version 7.18.5 to 7.18.6
@@ -275,6 +275,6 @@ "use strict"; | ||
} else if (path.isExportDefaultDeclaration()) { | ||
const declar = path.get("declaration"); | ||
const declar = path.node.declaration; | ||
if (declar.isClassDeclaration()) { | ||
const id = declar.node.id; | ||
if (_core.types.isClassDeclaration(declar)) { | ||
const id = declar.id; | ||
@@ -286,13 +286,13 @@ if (id) { | ||
addExportName(id.name, "default"); | ||
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(id), _core.types.toExpression(declar.node)))); | ||
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(id), _core.types.toExpression(declar)))); | ||
} else { | ||
exportNames.push("default"); | ||
exportValues.push(_core.types.toExpression(declar.node)); | ||
exportValues.push(_core.types.toExpression(declar)); | ||
removedPaths.push(path); | ||
} | ||
} else if (declar.isFunctionDeclaration()) { | ||
const id = declar.node.id; | ||
} else if (_core.types.isFunctionDeclaration(declar)) { | ||
const id = declar.id; | ||
if (id) { | ||
beforeBody.push(declar.node); | ||
beforeBody.push(declar); | ||
exportNames.push("default"); | ||
@@ -303,3 +303,3 @@ exportValues.push(_core.types.cloneNode(id)); | ||
exportNames.push("default"); | ||
exportValues.push(_core.types.toExpression(declar.node)); | ||
exportValues.push(_core.types.toExpression(declar)); | ||
} | ||
@@ -309,31 +309,30 @@ | ||
} else { | ||
path.replaceWith(buildExportCall("default", declar.node)); | ||
path.replaceWith(buildExportCall("default", declar)); | ||
} | ||
} else if (path.isExportNamedDeclaration()) { | ||
const declar = path.get("declaration"); | ||
const declar = path.node.declaration; | ||
if (declar.node) { | ||
if (declar) { | ||
path.replaceWith(declar); | ||
if (declar.isFunction()) { | ||
const node = declar.node; | ||
const name = node.id.name; | ||
if (_core.types.isFunction(declar)) { | ||
const name = declar.id.name; | ||
addExportName(name, name); | ||
beforeBody.push(node); | ||
beforeBody.push(declar); | ||
exportNames.push(name); | ||
exportValues.push(_core.types.cloneNode(node.id)); | ||
exportValues.push(_core.types.cloneNode(declar.id)); | ||
removedPaths.push(path); | ||
} else if (declar.isClass()) { | ||
const name = declar.node.id.name; | ||
} else if (_core.types.isClass(declar)) { | ||
const name = declar.id.name; | ||
exportNames.push(name); | ||
exportValues.push(scope.buildUndefinedNode()); | ||
variableIds.push(_core.types.cloneNode(declar.node.id)); | ||
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(declar.node.id), _core.types.toExpression(declar.node)))); | ||
variableIds.push(_core.types.cloneNode(declar.id)); | ||
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(declar.id), _core.types.toExpression(declar)))); | ||
addExportName(name, name); | ||
} else { | ||
if (declar.isVariableDeclaration()) { | ||
declar.node.kind = "var"; | ||
if (_core.types.isVariableDeclaration(declar)) { | ||
declar.kind = "var"; | ||
} | ||
for (const name of Object.keys(declar.getBindingIdentifiers())) { | ||
for (const name of Object.keys(_core.types.getBindingIdentifiers(declar))) { | ||
addExportName(name, name); | ||
@@ -340,0 +339,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-modules-systemjs", | ||
"version": "7.18.5", | ||
"version": "7.18.6", | ||
"description": "This plugin transforms ES2015 modules to SystemJS", | ||
@@ -16,6 +16,6 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-hoist-variables": "^7.16.7", | ||
"@babel/helper-module-transforms": "^7.18.0", | ||
"@babel/helper-plugin-utils": "^7.17.12", | ||
"@babel/helper-validator-identifier": "^7.16.7", | ||
"@babel/helper-hoist-variables": "^7.18.6", | ||
"@babel/helper-module-transforms": "^7.18.6", | ||
"@babel/helper-plugin-utils": "^7.18.6", | ||
"@babel/helper-validator-identifier": "^7.18.6", | ||
"babel-plugin-dynamic-import-node": "^2.3.3" | ||
@@ -30,4 +30,4 @@ }, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.5", | ||
"@babel/helper-plugin-test-runner": "^7.16.7", | ||
"@babel/core": "^7.18.6", | ||
"@babel/helper-plugin-test-runner": "^7.18.6", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3" | ||
@@ -39,3 +39,4 @@ }, | ||
}, | ||
"author": "The Babel Team (https://babel.dev/team)" | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
} |
20985
395
+ Addedelectron-to-chromium@1.4.758(transitive)
- Removedelectron-to-chromium@1.4.757(transitive)