stepping-async.js (418B)
1 "use strict"; 2 /* exported stuff */ 3 4 async function timer() { 5 return Promise.resolve(); 6 } 7 8 function oops() { 9 return `oops`; 10 } 11 12 async function inner() { 13 oops(); 14 await timer(); 15 Promise.resolve().then(async () => { 16 Promise.resolve().then(() => { 17 oops(); 18 }); 19 oops(); 20 }); 21 oops(); 22 } 23 24 async function stuff() { 25 debugger; 26 const task = inner(); 27 oops(); 28 await task; 29 oops(); 30 debugger; 31 }