Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: Source/WebCore/bindings/v8/DebuggerScript.js

Issue 9371015: Merge 106468 - Web Inspector: debugger reports wrong sources when paused in inline script on page... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/bindings/js/ScriptDebugServer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/DebuggerScript.js
===================================================================
--- Source/WebCore/bindings/v8/DebuggerScript.js (revision 107226)
+++ Source/WebCore/bindings/v8/DebuggerScript.js (working copy)
@@ -90,10 +90,16 @@
var lineCount = lineEnds.length;
var endLine = script.line_offset + lineCount - 1;
var endColumn;
- if (lineCount === 1)
- endColumn = script.source.length + script.column_offset;
- else
- endColumn = script.source.length - (script.line_ends[lineCount - 2] + 1);
+ // V8 will not count last line if script source ends with \n.
+ if (script.source[script.source.length - 1] === '\n') {
+ endLine += 1;
+ endColumn = 0;
+ } else {
+ if (lineCount === 1)
+ endColumn = script.source.length + script.column_offset;
+ else
+ endColumn = script.source.length - (lineEnds[lineCount - 2] + 1);
+ }
return {
id: script.id,
« no previous file with comments | « Source/WebCore/bindings/js/ScriptDebugServer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698