Bug 93019 - Web Inspector: WebInspector.linkifyStringAsFragment gives wrong typeof lineNumber
Summary: Web Inspector: WebInspector.linkifyStringAsFragment gives wrong typeof lineNu...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-08-02 12:40 PDT by johnjbarton
Modified: 2012-08-06 12:04 PDT (History)
11 users (show)

See Also:

Patch (4.54 KB, patch)
2012-08-02 12:53 PDT, johnjbarton
no flags Details | Formatted Diff | Diff
Patch (5.02 KB, patch)
2012-08-03 09:53 PDT, johnjbarton
no flags Details | Formatted Diff | Diff
Patch (5.02 KB, patch)
2012-08-06 11:31 PDT, johnjbarton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description johnjbarton 2012-08-02 12:40:09 PDT
User reported issue is upstream:
Issue 135493:	[DevTools] Links to source locations from stacktraces do not work.

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.
Comment 1 johnjbarton 2012-08-02 12:53:21 PDT
Created attachment 156144 [details]
Comment 2 Vsevolod Vlasov 2012-08-03 00:26:09 PDT
Comment on attachment 156144 [details]

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.
Comment 3 johnjbarton 2012-08-03 09:53:06 PDT
Created attachment 156403 [details]
Comment 4 Pavel Feldman 2012-08-06 06:20:23 PDT
Comment on attachment 156403 [details]

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.
Comment 5 johnjbarton 2012-08-06 11:31:52 PDT
Created attachment 156730 [details]
Comment 6 WebKit Review Bot 2012-08-06 12:04:47 PDT
Comment on attachment 156730 [details]

Clearing flags on attachment: 156730

Committed r124792: <http://trac.webkit.org/changeset/124792>
Comment 7 WebKit Review Bot 2012-08-06 12:04:51 PDT
All reviewed patches have been landed.  Closing bug.