This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Variables goes out of scope prematurely #123
Comments
Thanks for filing. Beware that this module is essentially unmaintained currently. Happy to leave this open, but it probably won't get fixed. You may want to take a look at https://www.npmjs.com/package/fast-async |
@loganfsmyth Thanks for the tip! I siwtched to |
mikirejf
pushed a commit
to mikirejf/kneden
that referenced
this issue
Nov 23, 2017
@TheGrandmother var cid, resp;
return Promise.resolve().then(function () {
return getCid(slackUsername);
}).then(function (_resp) {
cid = _resp;
return replyFn(`Creating time report for ${year} ${month} and ${cid}`);
}).then(function () {
return request.post(config.apiUrl + `/create-time-report/${cid}/${year}/${month}`);
}).then(function (_resp) {
resp = _resp;
}); |
Getting this as well. Transpiling to ES5 for this to work is a major bummer, as my target is Node 6. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I had this code:
And I got this strange error that
cid
was undefined on line 3, but it was defined properly on line 2.After a lot of crying i looked into the generated code and i found that it had been transpiled to:
As is clear from the transpiled code
cid
goes out of scope prematurely.I am running version 1.0.5 of async-to-promises.
The text was updated successfully, but these errors were encountered: