Skip to content

Commit bf9af2c

Browse files
committed
Build dist
1 parent 871140a commit bf9af2c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

dist/error-stack-parser.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,18 @@
5858
// Throw away eval information until we implement stacktrace.js/stackframe#8
5959
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, '');
6060
}
61-
var tokens = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').split(/\s+/).slice(1);
62-
var locationParts = this.extractLocation(tokens.pop());
61+
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
62+
63+
// capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
64+
// case it has spaces in it, as the string is split on \s+ later on
65+
var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
66+
67+
// remove the parenthesized location from the line, if it was matched
68+
sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
69+
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());
6373
var functionName = tokens.join(' ') || undefined;
6474
var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
6575

dist/error-stack-parser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)