Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
It doesn't decide the whole problem. Because what to do with built-in api which returns promises (like `fetch`)? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Алексей
I think it should not be hard to implement at least for explicitely async functions. Of course it will miss non-async that return promises. But you can mark them as async. For example we are doing on each function that could return promise even if it doesn't use await. But even without it that

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
I’m not sure that it will be simply to implement. Because not all possible to analyze without execution. I offer to use `nowait` there where calls will return promise, but it i’m not sure that promises always can detect just via parsing of source code.

Re: Proposal to add keyword "nowait"

2018-02-12 Thread Michał Wadas
I would solve such issue by having transpile step that inserts assertions everywhere in dev enviroment (and don't add them in production env). On Mon, Feb 12, 2018 at 6:41 AM, Александр Ефремов wrote: > Sometimes when create the async functions forget to add await and later

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
Hm, yes, you are right. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread T.J. Crowder
On Mon, Feb 12, 2018 at 10:28 AM, Александр Ефремов wrote: > Hm, yes, you are right. > That’s https://eslint.org/docs/rules/require-await > Thank you very much. > In the next I will be more dig. > That just warns you if you've made a function `async` pointlessly (which may

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
Hm, yes, you are right. That’s https://eslint.org/docs/rules/require-await Thank you very much. In the next I will be more dig.___ es-discuss mailing list es-discuss@mozilla.org

Re: Proposal to add keyword "nowait"

2018-02-12 Thread Alan Plum
You could have a rule that could enforce always using `return await` in try/catch blocks in async functions. The `nowait` equivalent would be disabling that rule for that line. For the `nobreak` example I gave this actually exists (the rule is called `no-fallthrough` and could be disabled per

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
Sorry, I didn’t read it yet. But will be later of course. And I understood about actual proposal. Thanks. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread T.J. Crowder
@Александр Ефремов - Have you read through the previous discussion I linked? https://esdiscuss.org/topic/async-await-await-async-a-simpler-less-error-prone-async-syntax It seems to me it's exactly what you're describing (other than the keywords involved). Not sure there's much to gain from

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
Maybe it should be separate safely mode (similar to `use strict;` for example). Where should includes such proposes and maybe more. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Proposal to add keyword "nowait"

2018-02-12 Thread Александр Ефремов
I don’t understand how you offer to decide it via eslint. Because without additional keyword (`nowait`) it’s impossible to controlling. But if doesn’t add `nowait` keyword to spec then anyone should to remove it (i.e. babel transpiling for example). I wanted that it was part spec. And `nobreak`

Re: Proposal to add keyword "nowait"

2018-02-12 Thread Alan Plum
It sounds like what you want is basically a built-in syntax requirement that replaces what should be an eslint rule. For consistency this would mean JS should also have the keyword `nobreak` to prevent accidental switch/case fallthrough. Or you could just write an eslint rule for this (if one

Re: Proposal to add keyword "nowait"

2018-02-11 Thread Александр Ефремов
I just considered this proposal in a context of `node.js` environment. I write microservices which execute requests to database and other microservices. All such requests are asynchronous. Therefore I execute them in body of async function. And sometimes I forget to add `await` for such

Re: Proposal to add keyword "nowait"

2018-02-11 Thread Александр Ефремов
Yes, I was mistaken. That is possible only to do via type checking systems. it's not work of javascript of the interpreter. Thanks for explanations. > 12 февр. 2018 г., в 10:32, T.J. Crowder > написал(а): > > Previous discussion: >

Re: Proposal to add keyword "nowait"

2018-02-11 Thread T.J. Crowder
Previous discussion: https://esdiscuss.org/topic/async-await-await-async-a-simpler-less-error-prone-async-syntax -- T.J. Crowder On Mon, Feb 12, 2018 at 6:29 AM, Александр Ефремов wrote: > Sorry, but I didn’t understand you sentence. And I have knowledge in the > promises

Re: Proposal to add keyword "nowait"

2018-02-11 Thread Александр Ефремов
Sorry, but I didn’t understand you sentence. And I have knowledge in the promises of course. > 12 февр. 2018 г., в 9:59, Isiah Meadows написал(а): > > Yeah, and given it's the default, I'm not persuaded of the benefit to be > gained here. > > (Most feature requests

Re: Proposal to add keyword "nowait"

2018-02-11 Thread Isiah Meadows
Yeah, and given it's the default, I'm not persuaded of the benefit to be gained here. (Most feature requests like these in my experience come from such users who use `async`/`await` without learning promises first. Without that knowledge, people typically don't get that it's merely syntax sugar

Re: Re: Proposal to add keyword "nowait"

2018-02-11 Thread Александр Ефремов
Yes, agree that it doesn't backwards compatible. But type checking systems (like typescript and flow) it's overhead for fast development. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal to add keyword "nowait"

2018-02-11 Thread Peter Jaszkowiak
This certainly doesn't sound backwards compatible. Also, this is something that type checking systems (like typescript and flow) are very good at catching. On Feb 11, 2018 22:41, "Александр Ефремов" wrote: > Sometimes when create the async functions forget to add await and