Simo Costa (2019-04-01T10:59:54.000Z)
andrysimo1997 at gmail.com (2019-04-01T13:04:37.985Z)
Currently the following illustrative syntax is forbidden: ```js let obj = { async*[Symbol.asyncIterator]() { const res = await yield; // do stuff with res } } ``` Used in this way (simple example): ```js const ait = obj[Symbol.asyncIterator](); ait.next(); ait.next(p); // p is a Promise ``` We cannot directly write `await yield`. Is there any particular reason? We have to write: ```js let obj = { async*[Symbol.asyncIterator]() { const res = await (yield); // do stuff with res } } ```
andrysimo1997 at gmail.com (2019-04-01T12:44:59.076Z)
Currently the following illustrative syntax is forbidden: ```js let obj = { async*[Symbol.asyncIterator]() { const res = await yield; // do stuff with res } } ``` Used in this way (simple example): ```js const ait = obj[Symbol.asyncIterator](); ait.next(); ait.next(p); // p is a Promise ``` We cannot directly write `await yield`. Is there any particular reason? We have to write: ```js let obj = { async*[Symbol.asyncIterator]() { const p = yield; const res = await p; // do stuff with res } } ```
andrysimo1997 at gmail.com (2019-04-01T11:13:50.305Z)
Currently the following illustrative syntax is forbidden: ```js obj = { async*[Symbol.asyncIterator]() { const res = await yield; // do stuff with res } } ``` Used in this way (simple example): ```js const ait = obj[Symbol.asyncIterator](); ait.next(); ait.next(p); // p is a Promise ``` We cannot directly write `await yield`. Is there any particular reason? We have to write: ```js obj = { async*[Symbol.asyncIterator]() { const p = yield; const res = await p; // do stuff with res } } ```
andrysimo1997 at gmail.com (2019-04-01T11:06:49.634Z)
Currently the following illustrative syntax is forbidden: ```js obj = { async*[Symbol.asyncIterator]() { const res = await yield; // do stuff with res } } ``` Used in this way (simple example): ```js const ait = [Symbol.asyncIterator](); ait.next(); ait.next(p); // p is a Promise ``` We cannot directly write `await yield`. Is there any particular reason? We have to write: ```js obj = { async*[Symbol.asyncIterator]() { const p = yield; const res = await p; // do stuff with res } } ```