Closed Bug 1145747 Opened 5 years ago Closed 7 months ago

Debugger step functions are sensitive to whitespace


(DevTools :: Debugger, defect)

Not set


(Not tracked)



(Reporter: callahad, Unassigned)


(Blocks 1 open bug)


If you set a breakpoint on the first line of foo(), then click "step in" on each line, the debugger takes a different number of steps to reach the bar() function depending on whitespace in the function arguments.

    function foo() {
      var a = bar('one step to bar', { foo: 1, bar: 2, baz: { qux: true } });

      var b = bar('three steps to bar', {
        foo: 1, bar: 2, baz: { qux: true }

      var c = bar('four steps to bar', {
        foo: 1, bar: 2, baz: {
          qux: true

    function bar(subject, opts) {
      return true;

I find this somewhat confusing and unintuitive -- the code is syntactically identical, but the debugger behaves different in each case.
For easy testing, the above code can be found at
See Also: → 1370641
In essence the idea here would be either to column-step through the arguments,
or not to emit line notes for the arguments.

I'm not sure where I come down on this.  For "obvious" arguments, there seems to
be no point in stepping through them -- it's not as though one can inspect the
intermediate values created while stepping anyway.

Abstractly my preferred approach to line-notes would be to emit them at user-visible
spots only, and not for intermediate calculations.

However, an otherwise innocuous-looking intermediate expression might involve
a getter or other non-obvious behavior, and this isn't generally known
during bytecode emission, and one might want to be made aware of this
while stepping.
Product: Firefox → DevTools

Dan, I think we fixed this with a feature we call breakpoint specificity a couple of months ago where we cleaned up all of the possible locations you could step to. Would you mind re-testing?

Ever confirmed: false
Flags: needinfo?(callahad)
Blocks: dbg-control
Type: enhancement → defect

This does indeed appear to be fixed!

Closed: 7 months ago
Flags: needinfo?(callahad)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.