Thanks for brining this up -- it's a good point. Unlike ES5 strict and 'yield', the cat is not yet out of the bag. We need to commit, though.

/be

Kevin Smith <mailto:[email protected]>
December 11, 2013 1:00 PM
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
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to