Open Bug 1651841 Opened 5 years ago

Code string run via setTimeout/Interval has no captured stack data

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: loganfsmyth, Unassigned)

References

(Blocks 1 open bug)

Details

Noticed while looking into https://bugzilla.mozilla.org/show_bug.cgi?id=1196089

Given these two functions:

  1. setTimeout(() => { throw new Error(); }, 5);
  2. setTimeout("throw new Error();", 5);

The first error will have a captured portion of the stack trace pointing to the callsite of setTimeout. The second will not have any captured stack data.

This is happening because passing a function uses the same DOM callback infrastructure used by everything else, whereas the second one is special parse + compile logic that does not capture any async frames.

You need to log in before you can comment on or make changes to this bug.