I'm having spotty debugging experiences when I try to debug code with async/await using transform-async-to-generator
babel plugin ( although I've tried almost every other combination ).
Essentially code with a await will skip to the end of the method and then go into the compiled code. video
export class Cat {
async meow(){
let p = await this.bat(); // <<<< this line runs
this.fart(); // <<<< then skips this line
return p; // <<<< and goes to this line ( always last line in fn )
}
}
If you take a look at the generated code for that function:
meow() {
var _this = this;
return _asyncToGenerator(function* () {
let p = yield _this.bat();
_this.fart();
return p;
})();
}
its no wonder regarding the results but source maps should handle this, right?
I've tried this with a variety of setups ( require hook / babel-node / babel cli / gulp babel ) and get same issue. I'm using: Node 5.3.0 and Babel 6.3
I've created a demo project on github. I've also posted the question on the babel thread.
EDIT: The question was posed to source-maps project as I do not feel this is a babel issue. The team acknowledged the issue as a debugger issue. For more details see: github issue
fart()
does get called, right? – Epicalyx