Bug 149922 - Web Inspector: Stack trace view doesn't properly display lines without function names
Summary: Web Inspector: Stack trace view doesn't properly display lines without functi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-10-08 04:18 PDT by Nikita Vasilyev
Modified: 2015-10-08 23:02 PDT (History)
8 users (show)

See Also:


Attachments
[HTML] Reduction (601 bytes, text/html)
2015-10-08 04:24 PDT, Nikita Vasilyev
no flags Details
Patch (3.11 KB, patch)
2015-10-08 04:28 PDT, Nikita Vasilyev
timothy: review+
nvasilyev: commit-queue-
Details | Formatted Diff | Diff
Patch (with a test) (5.99 KB, patch)
2015-10-08 22:10 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2015-10-08 04:18:44 PDT
Image: https://bugs.webkit.org/attachment.cgi?id=262414.

Note how the last line of the stack trace didn't get parsed correctly.

Expected:
(anonymous function) - error-prefix.html:27

Actual:
Full path, cannot be clicked.
Comment 1 Radar WebKit Bug Importer 2015-10-08 04:18:59 PDT
<rdar://problem/23028382>
Comment 2 Nikita Vasilyev 2015-10-08 04:24:03 PDT
Created attachment 262686 [details]
[HTML] Reduction
Comment 3 Nikita Vasilyev 2015-10-08 04:28:23 PDT
Created attachment 262687 [details]
Patch
Comment 4 Timothy Hatcher 2015-10-08 07:55:23 PDT
Comment on attachment 262687 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=262687&action=review

> Source/WebInspectorUI/UserInterface/Models/StackTrace.js:65
> +                ({url, lineNumber, columnNumber} = WebInspector.StackTrace._parseLocation(line.slice(atIndex + 1)));

Is the wrapping () needed here?

> Source/WebInspectorUI/UserInterface/Models/StackTrace.js:67
> +                ({url, lineNumber, columnNumber} = WebInspector.StackTrace._parseLocation(line));

Ditto.
Comment 5 Joseph Pecoraro 2015-10-08 11:23:36 PDT
Comment on attachment 262687 [details]
Patch

It looks like this can be tested. Can we write a test for it?
Comment 6 Nikita Vasilyev 2015-10-08 22:08:47 PDT
(In reply to comment #4)
> Comment on attachment 262687 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=262687&action=review
> 
> > Source/WebInspectorUI/UserInterface/Models/StackTrace.js:65
> > +                ({url, lineNumber, columnNumber} = WebInspector.StackTrace._parseLocation(line.slice(atIndex + 1)));
> 
> Is the wrapping () needed here?
> 
> > Source/WebInspectorUI/UserInterface/Models/StackTrace.js:67
> > +                ({url, lineNumber, columnNumber} = WebInspector.StackTrace._parseLocation(line));
> 
> Ditto.

Yes! I was surprised to discover this too.

    var x = 0;
    {x} = {x: 2}; // SyntaxError: Unexpected token '='
    console.info(x);
    
This, however, works as you'd expect:

    var {x} = {x: 2};
    console.info(x); // 2
Comment 7 Nikita Vasilyev 2015-10-08 22:10:57 PDT
Created attachment 262747 [details]
Patch (with a test)
Comment 8 WebKit Commit Bot 2015-10-08 23:02:02 PDT
Comment on attachment 262747 [details]
Patch (with a test)

Clearing flags on attachment: 262747

Committed r190780: <http://trac.webkit.org/changeset/190780>
Comment 9 WebKit Commit Bot 2015-10-08 23:02:07 PDT
All reviewed patches have been landed.  Closing bug.