Bug 163378

Summary: Web Inspector: Stepping highlight for dot/bracket expressions in if statements highlights subset of the expression
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, joepeck, keith_miller, mark.lam, mattbaker, msaboff, nvasilyev, saam, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

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.