RESOLVED FIXED 93019
Web Inspector: WebInspector.linkifyStringAsFragment gives wrong typeof lineNumber
https://bugs.webkit.org/show_bug.cgi?id=93019
Summary Web Inspector: WebInspector.linkifyStringAsFragment gives wrong typeof lineNu...
johnjbarton
Reported 2012-08-02 12:40:09 PDT
User reported issue is upstream: Issue 135493: [DevTools] Links to source locations from stacktraces do not work. http://code.google.com/p/chromium/issues/detail?id=135493 The test case writes Error: The original error at triggerError (http://fiddle.jshell.net/Ad2Rr/4/show/:22:11) at HTMLButtonElement.onclick (http://fiddle.jshell.net/Ad2Rr/4/show/:36:121) into the console and the text goes through WebInspector.linkifyStringAsFragment. That calls WebInspector.linkifyStringAsFragmentWithCustomLinkifier() with a custom linkifier that is supposed to accept a string arg for lineNumber. However that linkifier function treats the lineNumber as a number.
Attachments
Patch (4.54 KB, patch)
2012-08-02 12:53 PDT, johnjbarton
no flags
Patch (5.02 KB, patch)
2012-08-03 09:53 PDT, johnjbarton
no flags
Patch (5.02 KB, patch)
2012-08-06 11:31 PDT, johnjbarton
no flags
johnjbarton
Comment 1 2012-08-02 12:53:21 PDT
Vsevolod Vlasov
Comment 2 2012-08-03 00:26:09 PDT
Comment on attachment 156144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156144&action=review > Source/WebCore/inspector/front-end/ResourceUtils.js:-251 > - urlNode.lineNumber = lineNumber; linkifier function is passed to linkifyStringAsFragmentWithCustomLinkifier as a parameter. I think we should fix linkifyStringAsFragmentWithCustomLinkifier instead to always pass the number to linkifier. > LayoutTests/inspector/debugger/linkifier.html:44 > + var linkifyMe = "at triggerError (http://fiddle.jshell.net/Ad2Rr/4/show/:22:11)"; nit: This real life url is distracting, I would use something like http://localhost/:22:11 instead.
johnjbarton
Comment 3 2012-08-03 09:53:06 PDT
Pavel Feldman
Comment 4 2012-08-06 06:20:23 PDT
Comment on attachment 156403 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=156403&action=review > Source/WebCore/inspector/front-end/ResourceUtils.js:210 > + lineNumber = parseInt(lineColumnMatch[1]); Nit: we explicitly say parseInt(foo, 10) to make closure compiler happy.
johnjbarton
Comment 5 2012-08-06 11:31:52 PDT
WebKit Review Bot
Comment 6 2012-08-06 12:04:47 PDT
Comment on attachment 156730 [details] Patch Clearing flags on attachment: 156730 Committed r124792: <http://trac.webkit.org/changeset/124792>
WebKit Review Bot
Comment 7 2012-08-06 12:04:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.