Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions js/VisualEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ VisualEvent.prototype = {
{
var origin = "";
var srcFiles = [];
var i, iLen, a;
var i, iLen, script, pos;

// Webkit reformats the prototype for the function, so the whitespace might not match our
// intended target. Remove the prototype - it means we are more likely to get a clash, but
Expand All @@ -476,11 +476,12 @@ VisualEvent.prototype = {
}

for ( i=0, iLen=this.s.scripts.length ; i<iLen ; i++ ) {
if ( this.s.scripts[i].code.indexOf( func ) !== -1 ) {
a = this.s.scripts[i].code.split( func );
script = this.s.scripts[i];
pos = script.code.indexOf( func );
if ( pos !== -1 ) {
srcFiles.push( {
"src": this.s.scripts[i].src,
"line": a[0].split('\n').length
"src": script.src,
"line": script.code.substr(0, pos).split('\n').length
} );
}
}
Expand Down