Open
Bug 1523893
Opened 6 years ago
Updated 2 years ago
Stepping out from an async function that is not on the stack anymore doesn't work correctly
Categories
(DevTools :: Debugger, enhancement, P3)
DevTools
Debugger
Tracking
(Not tracked)
NEW
People
(Reporter: Honza, Unassigned)
References
(Blocks 1 open bug)
Details
Initial state: foo calls sleep and the user is paused at the debugger keyword at line 3
1. async function sleep(n) {
2. await new Promise(r => setTimeout(r, n));
3. debugger; // step out from here
4. return new Promise(r => setTimeout(r, n));
5. }
6.
7. async function foo() {
8. const s = sleep(1000);
9. s.then(callback);
10. }
11.
12. function callback() {
13. console.log("callback");
14. }
STR:
- The user is paused at line 3
- The user steps out of the sleep function. Note that the sleep function isn’t on the stack anymore (since the await at line 2)
- BUG => The execution should resume since there is no parent frame on the stack where the execution could pause.
- Expected: Chrome parity
This is not working as expected, the execution breaks at the end of the function (last bracket), just before leaving the frame. Also, there was a suggestion to pause the execution at line 13 after step out from the sleep function (open for discussion).
Online example #3:
https://statuesque-cover.glitch.me/
Other browsers:
- Edge pauses at line 13 (in the callback)
- Chrome pauses in what seems to be top-level evaluated code
Reporter | ||
Updated•6 years ago
|
Blocks: dbg-async-step-out
Reporter | ||
Updated•6 years ago
|
Priority: -- → P2
Updated•5 years ago
|
Type: defect → enhancement
Priority: P2 → P3
Updated•5 years ago
|
Whiteboard: [debugger-mvp]
Reporter | ||
Updated•5 years ago
|
Priority: P3 → P2
Updated•5 years ago
|
Whiteboard: [debugger-mvp]
Updated•5 years ago
|
Priority: P2 → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•