Web Inspector: use call frame column to determine execution line in source frame
Created attachment 81634 [details] Patch.
Comment on attachment 81634 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=81634&action=review > Source/WebCore/bindings/js/JavaScriptCallFrame.h:58 > + int line() const { return m_textPosition.m_line.zeroBasedInt(); } What's the reason for switching from 1-based to 0-based here? > Source/WebCore/bindings/js/ScriptDebugServer.cpp:446 > + TextPosition0 textPosition(WTF::ZeroBasedNumber::fromZeroBasedInt(lineNumber - 1), WTF::ZeroBasedNumber::base()); Should be WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased()
Created attachment 81782 [details] Patch.
(In reply to comment #2) > (From update of attachment 81634 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=81634&action=review > > > Source/WebCore/bindings/js/JavaScriptCallFrame.h:58 > > + int line() const { return m_textPosition.m_line.zeroBasedInt(); } > > What's the reason for switching from 1-based to 0-based here? Using 0-based lines in protocol is preferable because most of the scripts panel code is using 0-based lines, and maintaining +1/-1 conversions all over the code is painful. > > > Source/WebCore/bindings/js/ScriptDebugServer.cpp:446 > > + TextPosition0 textPosition(WTF::ZeroBasedNumber::fromZeroBasedInt(lineNumber - 1), WTF::ZeroBasedNumber::base()); > > Should be WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased() Done.
Committed r78482: <http://trac.webkit.org/changeset/78482>