[jsdbg2] Debugger.Frames for async calls should provide promise of return value
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox73 | --- | fixed |
People
(Reporter: jimb, Assigned: loganfsmyth)
References
Details
Attachments
(1 file)
Given a Debugger.Frame object referring to an asynchronous function call, the Debugger API currently provides no way to obtain the promise of the call's return value that was originally returned to the caller of the async function.
Being able to obtain a Debugger.Object referring to the promise of an async call's resolution would be one step in allowing the devtools server to include awaiter->awaitee links in stack traces.
A Debugger.Frame for an async call should have an accessor that consults its GeneratorInfo object, and if the underlying generator is an AsyncFunctionGeneratorObject, returns a Debugger.Object referring to the promise in its PROMISE_SLOT. That slot should always hold a PromiseObject.
We'll also need a way to get from a promise to Debugger.Frames for async calls awaiting the promise's resolution, but that's a separate bug.
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
If you're in an async generator, do we want to also allow frame.promise to be the promise that will be resolved by the next yield? Seems like that would be nice.
| Assignee | ||
Comment 2•6 years ago
|
||
| Reporter | ||
Comment 3•6 years ago
|
||
(In reply to Logan Smyth [:loganfsmyth] from comment #1)
If you're in an async generator, do we want to also allow
frame.promiseto be the promise that will be resolved by the nextyield? Seems like that would be nice.
Yes, definitely. That would mean that, if you've got a for await loop consuming the values from the generator, that could appear as the awaiter of the generator when it is awaiting something else, right?
Updated•6 years ago
|
Updated•6 years ago
|
Comment 5•6 years ago
|
||
| bugherder | ||
Description
•