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/error-stack-parser/error-stack-parser.js | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PAMapp/node_modules/error-stack-parser/error-stack-parser.js b/PAMapp/node_modules/error-stack-parser/error-stack-parser.js index 9de504a..5231091 100644 --- a/PAMapp/node_modules/error-stack-parser/error-stack-parser.js +++ b/PAMapp/node_modules/error-stack-parser/error-stack-parser.js @@ -56,21 +56,21 @@ return filtered.map(function(line) { if (line.indexOf('(eval ') > -1) { // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); + line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(,.*$)/g, ''); } - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); + var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').replace(/^.*?\s+/, ''); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in // case it has spaces in it, as the string is split on \s+ later on - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); + var location = sanitizedLine.match(/ (\(.+\)$)/); // remove the parenthesized location from the line, if it was matched sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); - // if a location was matched, pass it to extractLocation() otherwise pop the last token - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; + // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine + // because this line doesn't have function name + var locationParts = this.extractLocation(location ? location[1] : sanitizedLine); + var functionName = location && sanitizedLine || undefined; var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; return new StackFrame({ -- Gitblit v1.8.0