Skip to content

Instantly share code, notes, and snippets.

@jimblandy
Created March 27, 2019 21:32
Show Gist options
  • Save jimblandy/f63d37e0bfb4a2a512d904226cfe7459 to your computer and use it in GitHub Desktop.
Save jimblandy/f63d37e0bfb4a2a512d904226cfe7459 to your computer and use it in GitHub Desktop.
This should print two completions before 'callback', right???
let g = newGlobal({newCompartment: true});
g.eval(`
async function f() {
debugger;
await Promise.resolve(3);
return "ok";
}
`);
let dbg = Debugger(g);
dbg.onDebuggerStatement = frame => {
frame.onPop = completion => {
print(`completion: ${uneval(completion)}`);
};
};
g.dis(g.f);
g.f().then(value => { print(`callback`); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment