<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Stepping through code should point to the next thing that will execute and not skip function calls that can be stepped into"
   href="https://bugs.webkit.org/show_bug.cgi?id=161660">161660</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Web Inspector: Stepping through code should point to the next thing that will execute and not skip function calls that can be stepped into
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Inspector
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>joepeck&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bburg&#64;apple.com, joepeck&#64;webkit.org, mattbaker&#64;apple.com, nvasilyev&#64;apple.com, timothy&#64;apple.com, webkit-bug-importer&#64;group.apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Summary:
Stepping through code should point to the next thing that will execute.

Test:
1. &lt;script&gt;
2. function foo(a, b) { return a + b; }
3. function a() { return 1; }
4. function b() { return 2; }
5. var x = 1;
6. foo(
7.   a(),
8.   b()
9. );

Steps to Reproduce:
1. Inspect test page
2. Set a breakpoint on line 5
3. Reload
  =&gt; Pause on breakpoint
4. Step through the code (step-over)
  =&gt; Can be confusing what is about to execute

Notes:
When stepping through code in different debugger environments we get different behavior:

  - WebKit: will stop at lines [5, 6] =&gt; &quot;x = 1&quot;, &quot;foo(...)&quot;
  - Chrome: will stop at lines [5, 6] =&gt; &quot;x = 1&quot;, &quot;foo(...)&quot;
  - Firefox: still stop at lines [5, 6, 7, 8, 6] =&gt; &quot;x = 1&quot;, &quot;foo(...)&quot;, &quot;a()&quot;, &quot;b()&quot;, &quot;foo(...)&quot;
  - lldb: would stop at lines [5, 7, 8, 6] =&gt; &quot;x = 1&quot;, &quot;a()&quot;, &quot;b()&quot;, &quot;foo(...)&quot;

I think the lldb approach makes the most sense. It is the smartest. In WebKit/Chrome you may not realize that you could step into &quot;a()&quot; or &quot;b()&quot;. In lldb it is very clear that those will execute and you are given the opportunity to step over or into them. Firefox is close, but it is unclear what the first stop on line 6 mean given the stop at 7 and 8 happen before returning to and really executing line 6.

Proposed stepping locations:

  - Proposed stop at lines [5, 7, 8, 6] =&gt; &quot;x = 1&quot;, &quot;a()&quot;, &quot;b()&quot;, &quot;foo(...)&quot;

Reasoning:

  - Stop at any location where the developer should be offered the choice to step over or into
    - this means function calls in execution order. foo(a(), b()) stops first at a(), then b(), then foo()</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>