From ab4e8129d5c94ff96e6c85d0d2b66a04a052b4e5 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:26:15 +0800 Subject: [PATCH] TODO#139888 嚴選配對 - 文案修改 --- PAMapp/node_modules/async/dist/async.js | 34 +++++++++++++++++++++++++++++++--- 1 files changed, 31 insertions(+), 3 deletions(-) diff --git a/PAMapp/node_modules/async/dist/async.js b/PAMapp/node_modules/async/dist/async.js index 67fec62..832ca57 100644 --- a/PAMapp/node_modules/async/dist/async.js +++ b/PAMapp/node_modules/async/dist/async.js @@ -1197,10 +1197,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); @@ -1957,7 +1983,7 @@ * app.get('/cats', function(request, response) { * var User = request.models.User; * async.seq( - * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) * function(user, fn) { * user.getCats(fn); // 'getCats' has signature (callback(err, data)) * } @@ -3591,6 +3617,8 @@ return memoized; } + /* istanbul ignore file */ + /** * Calls `callback` on a later loop around the event loop. In Node.js this just * calls `process.nextTick`. In the browser it will use `setImmediate` if -- Gitblit v1.8.0