Closed olebedev closed 6 years ago
It looks like babel is applying it's own async transform before using fast-async. I'm not a babel expert, but what happens if you re-order your devDependencies, eg:
"devDependencies": {
"fast-async": "^6.3.0",
"babel-cli": "^6.26.0",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1"
}
@olebedev I'm guessing you found a resolution to this issue, so I'll close for now. Please re-open if necessary
However, [this](http://nodent.mailed.me.uk/#async%20function%20on(id%2C%20cbk)%20%7B%0A%20%20%20%20if%20(!id%20%7C%7C%20!cbk)%20%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20for%20(const%20sub%20of%20this.subs)%20%7B%7D%0A%20%20%20%20%2F%2F%20%20%20if%20(sub.id%20%3D%3D%3D%20id%20%26%26%20sub.cbk%20%3D%3D%3D%20cbk)%20return%20sub%3B%0A%20%20%20%20const%20sub%20%3D%20new%20Subscription(this%2C%20id%2C%20cbk)%3B%0A%20%20%20%20this.subs.push(sub)%3B%0A%20%20%20%20await%20sub.on()%3B%0A%20%20%20%20return%20sub%3B%0A%7D~options~%7B%22mode%22%3A%22promises%22%2C%22promiseType%22%3A%22Zousan%22%2C%22noRuntime%22%3Atrue%2C%22es6target%22%3Afalse%2C%22wrapAwait%22%3Atrue%2C%22spec%22%3Atrue%7D) code is valid. I don't know why, but my own local setup doesn't compile it.
Content of
package.json
:Content of
.babelrc
:Content of
src/index.js
:And the output is:
What I am doing wrong?
I've added workaround into
babel-generator
and the result we surprised for me. Here to finction above, complied by babel in command line:Compare it with nodent.mailed.me.uk's result, the difference is a huge. The question is, why so? And, how to setup babel to have a nice output like from nodent.mailed.me.uk ?
/cc @MatAtBread