Debuggers and async/await should work together better: I have testcases.

# Alex Vincent (6 years ago)

A few minutes ago, I released version 0.8.2 of the es7-membrane project. [1] I've been using Mozilla Firefox primarily to debug it as I go, and I find the built-in JavaScript debugger has a few quirks when asynchronous functions come into the mix...

Most notably, when I step over an "await" statement, the debugger treats it as if I'm exiting the function altogether.

Also, exceptions thrown within the async functions after an await tend not to show up when I'm stepping through the code.

I know I should be filing this in Bugzilla, and I will this weekend... I'm posting this here for all JS engine & debugging tools teams, as a heads-up: when it comes to async functions, the step-through-code user experience is subpar.

As for tests people can step through to see what I'm talking about: see [1] for the source under docs/gui/tests. To run the tests, type |npm run gui-tests|. I use Karma to implement the tests. The karma.conf.js file in the root directory has a "singleRun" setting that developers can change to false for debugging purposes (attaching breakpoints to a test, for example).

If it's on a weekend, I can be available to demonstrate what I'm referring to, or to show people how to reproduce these behaviors.

Thanks!

Alex Vincent Hayward, CA, U.S.A.

[1] ajvincent/es7

# T.J. Crowder (6 years ago)

On Fri, Dec 1, 2017 at 9:27 AM, Alex Vincent <ajvincent at gmail.com> wrote:

I know I should be filing this in Bugzilla, and I will this weekend... I'm posting this here for all JS engine & debugging tools teams, as a heads-up: when it comes to async functions, the step-through-code user experience is subpar.

Maybe on Firefox (just verified), not on Chrome. The experience in Chrome (so, the combination of Chrome's devtools and V8's support) is very good indeed. Stepping over await just steps over it. Stepping into it steps into it. Extremely natural. Haven't tried Edge's F12.

So a Bugzilla report may be appropriate, although I suspect there's one already there and/or that they're already on it.

-- T.J. Crowder

# Jason Orendorff (6 years ago)

Alex,

I asked around, and our debugger folks say that stepping over await should work in current shipping Firefox. Haven't checked out your test case yet, but someone here will.

In any case, please do report a bug! Instead of Bugzilla, report it here: devtools-html/debugger.html/issues

If you don't mind Slack, you can hop on this one (and ping @yulia or @jorendorff) to talk more about async debugging: devtools-html.slack.com, devtools-html-slack.herokuapp.com <-- to sign up

# Alex Vincent (6 years ago)

As requested, I've filed devtools-html/debugger.html#4853 . Thanks for the help in advance!

Alex