Closed Bug 1280228 Opened 8 years ago Closed 6 years ago

Async stack trace with multiple promises hides some frames

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jsnajdr, Unassigned)

References

Details

Steps to reproduce: run the following JS code: function step(count) { if (count == 0) { console.trace(); } else if (count % 2 == 0) { step(count - 1); } else { Promise.resolve(count - 1).then(step); } } step(3); Expected result: console.trace() reports all stack frames, i.e., alternating sync/async calls to step(): step() (Async: promise resolver) step() step() (Async: promise resolver) step() Actual result: The sync frames between the two async's are missing: step() (Async: promise resolver) step() (Async: promise resolver) step() This seems to happen only for promises: if I use setTimeout instead: setTimeout(() => step.bind(null, count - 1), 0); // replace the Promise.resolve call with this Then there is a step() frame between the two (Async: setTimeout handler) ones.
Product: Firefox → DevTools
This looks fixed to me. I'm not sure how the fix was introduced though
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.