I think we should at least consider for a moment reserving `await` within
the body of arrow functions.  Consider the following event handling
scenario, where lexical `this` is an important feature:

    this.button.on("click", $=> {
        this.getDataAsync().then(data => {
            this.showData(data);
        });
    });

If JS gets async functions, then users will naturally want to express such
a construct with await:

    this.button.on("click", $=> {
        let data = await this.getDataAsync();
        this.showData(data);
    });

If we get async functions, then I think that we will want an arrow form.
 It would be a shame to have to invent new syntax to support it.

Thoughts?
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to