Open Bug 1848682 Opened 9 months ago Updated 9 months ago

Handle outparams when a function returns a Promise

Categories

(Core :: XPConnect, enhancement)

enhancement

Tracking

()

People

(Reporter: enndeakin, Unassigned)

References

(Blocks 1 open bug)

Details

nsIAuthPrompt added a method with a signature:

Promise asyncPromptPassword(..., inout wstring pwd);

The implementation is in LoginManagerAuthPrompter.sys.mjs.

This function returns a Promise. The xpcom layer handles and coverts the out parameters when the Promise is returned, which is the first use of 'await' within the function, even though the implementation function isn't actually finished.

Currently, this isn't an issue as the out parameter is assigned before the use of await. However, with bug 1846036, an earlier 'await' is added, and the function when complete ends up with a null value for the out parameter 'pwd'.

It would be ideal if this could somehow be handled, rather than having to convert the out parameters to something that is returned via the promise when it resolves.

The severity field is not set for this bug.
:farre, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(afarre)
Blocks: 1846334
Severity: -- → S3
Type: defect → enhancement
Flags: needinfo?(afarre)
You need to log in before you can comment on or make changes to this bug.