Fwd: Precedence of yield operator

Bruno Jouhier bjouhier at gmail.com
Fri Jun 14 15:50:54 PDT 2013


> I don’t know if a similar thing is possible in EcmaScript. But I believe
> that a low-precedence yield as a substitute for a high-precedence await is
> problematic: you never want “yield a + yield b” to mean “yield (a + (yield
> b))”: the things you await – Task, Promises, Futures, whatever you call
> them – just don’t have operators defined on them, and it would be silly to
> parse them as if they might and then give errors (at runtime in EcmaScript,
> at compile time in e.g. TypeScript).****
>

This is exactly the problem I ran into: yield does the job of await but the
syntax rule feels a bit silly.

This is not too dramatic because the errors are either detected at compile
time (yield a + yield b) or at runtime by my little library (yield a + b).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130615/feb0a29d/attachment.html>


More information about the es-discuss mailing list