[Webkit-unassigned] [Bug 80383] New: Web Inspector: "Skip this Frame" Feature

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 5 23:11:51 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=80383

           Summary: Web Inspector: "Skip this Frame" Feature
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Web Inspector
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: wycats at gmail.com
                CC: timothy at apple.com, rik at webkit.org, keishi at webkit.org,
                    pmuellr at yahoo.com, joepeck at webkit.org,
                    pfeldman at chromium.org, yurys at chromium.org,
                    bweinstein at apple.com, apavlov at chromium.org,
                    loislo at chromium.org


In web frameworks, it's common to have methods whose sole purpose is to dispatch to another method.

Imagine a simple event dispatcher like this:

    var hub = {
      events: {},
      bind: function(name, fn) {
        var events = this.events[name] = this.events[name] || [];
        events.push(fn);
      },

      trigger: function(name) {
        var events = this.events[name] || [];
        events.forEach(function(fn) { fn(); });
      }
    };

When an event is triggered, the code path will go through the `trigger` method and into each callback. However, when debugging code, having to manually walk across and down the trigger frame can be extremely annoying. In the absence of an exception in the trigger method, it simply doesn't matter.

Other common examples of this pattern:

* `get` and `set` methods in Ember.js that end up in "computed properties". From the perspective of the person debugging code, they want to jump directly from the `get` call site into the computed property.
* `super` in Ember.js and jQuery UI: Super can be implemented via a wrapper around a method dispatch that sets a `_super` property on the object and removes it once the dispatch is done. This means that calling into a method must first walk through the wrapper code. Again, this code is irrelevant.

I'm most familiar with the Ember.js cases, but almost every framework has some code (often event dispatching) that is used purely for internal dispatching and is irrelevant from the perspective of the framework consumer (unless an exception happens inside that code).

I would like to propose that frameworks be able to mark frames as skippable (maybe something like `fn.skipInDebugger = true`), which would cause the debugger to step through them when stepping was used. For advanced users, perhaps there could be an option to disable frame skipping.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list