3 ms·
which is strange, considering the `async` keyword in upcoming versions.
by mikewhy 12y ago
which is strange, considering the `async` keyword in upcoming versions.
- deleted 12y ago[deleted]
- adrusi 12y agoThat'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.
- tlrobinson 12y agoIs there even any situation where "async function(..." or "generator function(..." is currently valid syntax?
- rauschma 12y agoAFAICT, `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) { ··· }