From 23b60dc1975db38c280d8a123aff97544d1673e0 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期四, 09 六月 2022 15:34:21 +0800
Subject: [PATCH] TODO#139890 FAQ 常見問題 1-文案調整

---
 PAMapp/node_modules/@babel/plugin-transform-modules-systemjs/lib/index.js |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/PAMapp/node_modules/@babel/plugin-transform-modules-systemjs/lib/index.js b/PAMapp/node_modules/@babel/plugin-transform-modules-systemjs/lib/index.js
index 0652ac8..4f843a6 100644
--- a/PAMapp/node_modules/@babel/plugin-transform-modules-systemjs/lib/index.js
+++ b/PAMapp/node_modules/@babel/plugin-transform-modules-systemjs/lib/index.js
@@ -3,8 +3,8 @@
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.getExportSpecifierName = getExportSpecifierName;
 exports.default = void 0;
+exports.getExportSpecifierName = getExportSpecifierName;
 
 var _helperPluginUtils = require("@babel/helper-plugin-utils");
 
@@ -18,7 +18,7 @@
 
 var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
 
-const buildTemplate = (0, _core.template)(`
+const buildTemplate = _core.template.statement(`
   SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {
     "use strict";
     BEFORE_BODY;
@@ -28,11 +28,13 @@
     };
   });
 `);
-const buildExportAll = (0, _core.template)(`
+
+const buildExportAll = _core.template.statement(`
   for (var KEY in TARGET) {
     if (KEY !== "default" && KEY !== "__esModule") EXPORT_OBJ[KEY] = TARGET[KEY];
   }
 `);
+
 const MISSING_PLUGIN_WARNING = `\
 WARNING: Dynamic import() transformation must be enabled using the
          @babel/plugin-proposal-dynamic-import plugin. Babel 8 will
@@ -253,6 +255,8 @@
             } else if (path.isClassDeclaration()) {
               variableIds.push(_core.types.cloneNode(path.node.id));
               path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(path.node.id), _core.types.toExpression(path.node))));
+            } else if (path.isVariableDeclaration()) {
+              path.node.kind = "var";
             } else if (path.isImportDeclaration()) {
               const source = path.node.source.value;
               pushModule(source, "imports", path.node.specifiers);
@@ -268,9 +272,10 @@
               path.remove();
             } else if (path.isExportDefaultDeclaration()) {
               const declar = path.get("declaration");
-              const id = declar.node.id;
 
               if (declar.isClassDeclaration()) {
+                const id = declar.node.id;
+
                 if (id) {
                   exportNames.push("default");
                   exportValues.push(scope.buildUndefinedNode());
@@ -283,6 +288,8 @@
                   removedPaths.push(path);
                 }
               } else if (declar.isFunctionDeclaration()) {
+                const id = declar.node.id;
+
                 if (id) {
                   beforeBody.push(declar.node);
                   exportNames.push("default");
@@ -303,7 +310,7 @@
               if (declar.node) {
                 path.replaceWith(declar);
 
-                if (path.isFunction()) {
+                if (declar.isFunction()) {
                   const node = declar.node;
                   const name = node.id.name;
                   addExportName(name, name);
@@ -311,7 +318,7 @@
                   exportNames.push(name);
                   exportValues.push(_core.types.cloneNode(node.id));
                   removedPaths.push(path);
-                } else if (path.isClass()) {
+                } else if (declar.isClass()) {
                   const name = declar.node.id.name;
                   exportNames.push(name);
                   exportValues.push(scope.buildUndefinedNode());
@@ -319,6 +326,10 @@
                   path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(declar.node.id), _core.types.toExpression(declar.node))));
                   addExportName(name, name);
                 } else {
+                  if (declar.isVariableDeclaration()) {
+                    declar.node.kind = "var";
+                  }
+
                   for (const name of Object.keys(declar.getBindingIdentifiers())) {
                     addExportName(name, name);
                   }
@@ -411,7 +422,7 @@
                 exportValues.push(scope.buildUndefinedNode());
               }
             }
-          }, null);
+          });
 
           if (variableIds.length) {
             beforeBody.unshift(_core.types.variableDeclaration("var", variableIds.map(id => _core.types.variableDeclarator(id))));

--
Gitblit v1.8.0