From 9bdb95c9e34cef640534e5e5a1e2225a80442000 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期四, 09 六月 2022 15:48:15 +0800
Subject: [PATCH] TODO#139894 [ footer -最下方說明與保經代合作 ] 文案修改

---
 PAMapp/node_modules/async/autoInject.js |   34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/PAMapp/node_modules/async/autoInject.js b/PAMapp/node_modules/async/autoInject.js
index 80125ab..393baad 100644
--- a/PAMapp/node_modules/async/autoInject.js
+++ b/PAMapp/node_modules/async/autoInject.js
@@ -5,11 +5,11 @@
 });
 exports.default = autoInject;
 
-var _auto = require('./auto');
+var _auto = require('./auto.js');
 
 var _auto2 = _interopRequireDefault(_auto);
 
-var _wrapAsync = require('./internal/wrapAsync');
+var _wrapAsync = require('./internal/wrapAsync.js');
 
 var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
 
@@ -19,10 +19,36 @@
 var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;
 var FN_ARG_SPLIT = /,/;
 var FN_ARG = /(=.+)?(\s*)$/;
-var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+
+function stripComments(string) {
+    let stripped = '';
+    let index = 0;
+    let endBlockComment = string.indexOf('*/');
+    while (index < string.length) {
+        if (string[index] === '/' && string[index + 1] === '/') {
+            // inline comment
+            let endIndex = string.indexOf('\n', index);
+            index = endIndex === -1 ? string.length : endIndex;
+        } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') {
+            // block comment
+            let endIndex = string.indexOf('*/', index);
+            if (endIndex !== -1) {
+                index = endIndex + 2;
+                endBlockComment = string.indexOf('*/', index);
+            } else {
+                stripped += string[index];
+                index++;
+            }
+        } else {
+            stripped += string[index];
+            index++;
+        }
+    }
+    return stripped;
+}
 
 function parseParams(func) {
-    const src = func.toString().replace(STRIP_COMMENTS, '');
+    const src = stripComments(func.toString());
     let match = src.match(FN_ARGS);
     if (!match) {
         match = src.match(ARROW_FN_ARGS);

--
Gitblit v1.8.0