vscode-firefox-debug icon indicating copy to clipboard operation
vscode-firefox-debug copied to clipboard

Support await from debug console

Open bxantus opened this issue 3 years ago • 1 comments

I can't use await from the debug console in vscode. It shows the following error:

await 1
SyntaxError: await is only valid in async functions, async generators and modules

But this works from the debug console in firefox.

It would be really nice if we could use await expressions in vscode too, as without them it's not so easy to inspect results of async functions.

bxantus avatar Jun 21 '21 10:06 bxantus

In Firefox, we transform the expression to its async-iife equivalent under the hood, so it can be evaluated. It's not something very elegant, and we're probably having issues depending on the expression, so I wouldn't try to do the same thing here. In https://bugzilla.mozilla.org/show_bug.cgi?id=1839588 we're waiting for a special mode that would be implemented in Spidermonkey in which we would have a few nice-to-have, including top-level await

nchevobbe avatar Jan 22 '24 10:01 nchevobbe