Skip to content

Commit 3558868

Browse files
committed
Avoid <anonymous> file names. This will fix stacktracejs/stacktrace-gps#32
1 parent 86a1adf commit 3558868

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

error-stack-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
var tokens = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').split(/\s+/).slice(1);
9797
var locationParts = this.extractLocation(tokens.pop());
9898
var functionName = tokens.join(' ') || undefined;
99-
var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];
99+
var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
100100

101101
return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);
102102
}, this);

0 commit comments

Comments
 (0)