Skip to content

Commit 835c668

Browse files
committed
Fixing anonymous function guessing for file:/// urls
1 parent 3666c0f commit 835c668

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

stacktrace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ printStackTrace.implementation.prototype = {
271271

272272
guessAnonymousFunctions: function(stack) {
273273
for (var i = 0; i < stack.length; ++i) {
274-
var reStack = /\{anonymous\}\(.*\)@(\w+:\/\/([\-\w\.]+)+(:\d+)?[^:]+):(\d+):?(\d+)?/;
274+
var reStack = /\{anonymous\}\(.*\)@(\w+:\/\/([\-\w\.\/]+)+(:\d+)?[^:]+):(\d+):?(\d+)?/;
275275
var frame = stack[i], m = reStack.exec(frame);
276276
if (m) {
277277
var file = m[1], lineno = m[4], charno = m[7] || 0; //m[7] is character position in Chrome

test/test-stacktrace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
for (var i = 0; i < results.length; ++i) {
507507
//equals(results[i], '', 'stack trace');
508508
var functions = p.guessAnonymousFunctions(results[i]);
509-
//equals(functions.join("\n"), '', 'stack trace after guessing');
509+
// equals(functions.join("\n"), '', 'stack trace after guessing');
510510
equals(functions[2].substring(0, 4), 'f2()', 'guessed f2 as 3rd result: ' + functions[2]);
511511
//equals(functions[2].indexOf('f2'), 0, 'guessed f2 as 3rd result');
512512
}

0 commit comments

Comments
 (0)