Re:ES6 generators in depth
by mikewhy on Monday March 30, 2015 @11:40AM
(#9290228)
which is strange, considering the `async` keyword in upcoming versions.
[ Parent
| on HN ]
AFAICT, `async function` is OK, because you combine a keyword with something that is contextually turned into a keyword. With a single non-keyword that isn’t possble. For example, the following code (a hypothetical ES6 anonymous generator expression) could be an ES5 function call followed by a code block.
generator (a, b, c) {
···
}That's why it wasn't included in the ecmascript 6 draft. In es6, "async" and "await" are future-reserved keywords. It's kind of a process of marking variables named "async" as deprecated. The spec authors have to balance compatibility with making the language pleasant to use.
Re:ES6 generators in depth
by tlrobinson on Monday March 30, 2015 @01:59PM
(#9291301)
Is there even any situation where "async function(..." or "generator function(..." is currently valid syntax?