-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
td.when breaks after td.replace on objects methods generators #275
Comments
Pre 3.2, generators were naively replaced like any other function, but they don't really behave like regular functions, so 3.2.2 formally drops support (it no longer attempts to replace them until such a time as we can provide proper, well-thought-out support. I'm not sure how valid your example would be for actually specifying real-world behavior of a generator function. Could you expand on it to show how the pre-3.2 behavior was providing real value to you? I don't have much experience with generators, but I can't see it. |
Tracking the enhancment in #276 |
The reason why I'm using generators is because I'm stuck with Koa 1.x (Koa v2 uses async/await but requires node > 7.6 while I'm still on node v6). function* myAsyncFn () {
let data = yield Promise.resolve('ok'); // yeld supports generators, promises, callbacks, arrays, ...
return data;
} As I'm in a generators world, I'm using them for nearly all modules with async operations: function* getData () {
const data = yield myAsyncFn();
console.log(data);
}
// you can use co to try it out
co(getData); So td pre v3.2 was working because I just need to replace |
Possibly related to #271.
Running example: https://runkit.com/albertogasparin/595b9e9a08f4860012b4af3e
It works fine in pre 3.2
The text was updated successfully, but these errors were encountered: