<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: cannot set breakpoints in IIFE closures via GUI"
   href="https://bugs.webkit.org/show_bug.cgi?id=143577">143577</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Web Inspector: cannot set breakpoints in IIFE closures via GUI
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>528+ (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>joey&#64;kidfixit.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>graouts&#64;webkit.org, joepeck&#64;webkit.org, jonowells&#64;apple.com, 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>Occasionally I need to tear into readonly remote-hosted JS code to isolate and report bugs on webapps I use.

Single-page-application sites now commonly enclose their entire app code into an IIFE, adding nothing to the global scope that can be probed using the console.
  (function () { true; }() )
or
  !function(){ true; }()

Web Inspector will let me click to set breakpoints inside IIFEs but they will never fire when the site feature that was breakpointed is engaged.
Breakpointing the same lines in Chrome, Opera and Firefox works and provides console access to the stack inside the IIFE closure.

It makes no difference whether the script file was minified (and subsequently prettified by Web Inspector) or not.
None of the sites I am debugging have source-maps available.

The only way I can currently debug such sites on Safari is by saving a WebArchive and manually editing scripts' WebResourceData to insert `debugger;` statements: webarchive-vim is a python script I wrote to streamline this.</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>