Bug 163378 - Web Inspector: Stepping highlight for dot/bracket expressions in if statements highlights subset of the expression
Summary: Web Inspector: Stepping highlight for dot/bracket expressions in if statement...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-12 21:53 PDT by Joseph Pecoraro
Modified: 2016-10-13 15:23 PDT (History)
11 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (15.97 KB, patch)
2016-10-12 21:58 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-10-12 21:53:25 PDT
Summary:
Stepping highlight for dot/bracket expressions in if statements highlights subset of the expression

Test:
<script>
var obj = {condition: true};
debugger;
if (obj.condition)
    true;
if (obj["condition"])
    true;
</script>

Steps to Reproduce:
1. Inspect test page
2. Reload to pause at debugger statement
3. Step through
  => Weird highlights

Notes:
- Currently we are getting pause locations that look like:

    if (obj|.condition)
    if (obj|["condition"])

But what I would expect is:

    if (|obj.condition)
    if (|obj["condition"])

It seems the DotAccessNode and BracketAccessNode we create in these cases points to the location of the dot/bracket.
Comment 1 Radar WebKit Bug Importer 2016-10-12 21:53:53 PDT
<rdar://problem/28749376>
Comment 2 Joseph Pecoraro 2016-10-12 21:58:43 PDT
Created attachment 291454 [details]
[PATCH] Proposed Fix

I ran a pretty heavy load of js tests and changing these Node's location didn't fail anything. In any case this gets us the better position for breakpoints / stepping.
Comment 3 Saam Barati 2016-10-13 15:00:21 PDT
Comment on attachment 291454 [details]
[PATCH] Proposed Fix

r=me
Comment 4 WebKit Commit Bot 2016-10-13 15:23:00 PDT
Comment on attachment 291454 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 291454

Committed r207312: <http://trac.webkit.org/changeset/207312>
Comment 5 WebKit Commit Bot 2016-10-13 15:23:04 PDT
All reviewed patches have been landed.  Closing bug.