Skip to content

Commit 2a9b1e5

Browse files
author
Eric Wendelin
committed
Remove duplicate 'Error created at' stackframes in Opera
1 parent 091deb2 commit 2a9b1e5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

error-stack-parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@
201201
// Opera 10.65+ Error.stack very similar to FF/Safari
202202
parseOpera11: function ErrorStackParser$$parseOpera11(error) {
203203
return error.stack.split('\n').filter(function (line) {
204-
return !!line.match(FIREFOX_SAFARI_STACK_REGEXP);
204+
return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&
205+
!line.match(/^Error created at/);
205206
}.bind(this)).map(function (line) {
206207
var tokens = line.split('@');
207208
var locationParts = this.extractLocation(tokens.pop());

spec/fixtures/captured-errors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ CapturedExceptions.OPERA_11 = {
115115
stack: "<anonymous function: run>([arguments not available])@http://path/to/file.js:27\n" +
116116
"bar([arguments not available])@http://domain.com:1234/path/to/file.js:18\n" +
117117
"foo([arguments not available])@http://domain.com:1234/path/to/file.js:11\n" +
118-
"<anonymous function>@http://path/to/file.js:15",
118+
"<anonymous function>@http://path/to/file.js:15\n" +
119+
"Error created at <anonymous function>@http://path/to/file.js:15",
119120
stacktrace: "Error thrown at line 42, column 12 in <anonymous function: createException>() in http://path/to/file.js:\n" +
120121
" this.undef();\n" +
121122
"called from line 27, column 8 in <anonymous function: run>(ex) in http://path/to/file.js:\n" +

0 commit comments

Comments
 (0)