Skip to content

Commit 409cdd7

Browse files
committed
chore: build dist
1 parent 1c9261a commit 409cdd7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

dist/error-stack-parser.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@
5656
return filtered.map(function(line) {
5757
if (line.indexOf('(eval ') > -1) {
5858
// Throw away eval information until we implement stacktrace.js/stackframe#8
59-
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
59+
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(,.*$)/g, '');
6060
}
61-
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
61+
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').replace(/^.*?\s+/, '');
6262

6363
// capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
6464
// case it has spaces in it, as the string is split on \s+ later on
65-
var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
65+
var location = sanitizedLine.match(/ (\(.+\)$)/);
6666

6767
// remove the parenthesized location from the line, if it was matched
6868
sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
6969

70-
var tokens = sanitizedLine.split(/\s+/).slice(1);
71-
// if a location was matched, pass it to extractLocation() otherwise pop the last token
72-
var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
73-
var functionName = tokens.join(' ') || undefined;
70+
// if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
71+
// because this line doesn't have function name
72+
var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);
73+
var functionName = location && sanitizedLine || undefined;
7474
var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
7575

7676
return new StackFrame({

dist/error-stack-parser.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)