Waldemar Horwat (2013-11-25T23:19:17.000Z)
On 11/25/2013 02:03 PM, Kevin Smith wrote:
> Apologies for this remedial question, but I find the new grammar parameterized around [Yield] to be confusing.  If I understand correctly, this is to allow yield within non-strict generators.  If that's correct, then why are non-strict generators a good idea?
>
> Thanks!

It's easier to grammatically distinguish between being inside and outside a generator than it is to distinguish strict vs. non-strict.

To tell whether you're a strict function or not you need to lex the input.  To lex you need to parse it.  To parse it you need to figure out how to parse yield.  Hence you get an obnoxious circularity.

Think of cases such as the following non-strict code snippet:

function(a = yield+b) {
   "use strict";
}

     Waldemar
domenic at domenicdenicola.com (2013-12-10T01:12:45.050Z)
On 11/25/2013 02:03 PM, Kevin Smith wrote:
> Apologies for this remedial question, but I find the new grammar parameterized around [Yield] to be confusing.  If I understand correctly, this is to allow yield within non-strict generators.  If that's correct, then why are non-strict generators a good idea?

It's easier to grammatically distinguish between being inside and outside a generator than it is to distinguish strict vs. non-strict.

To tell whether you're a strict function or not you need to lex the input.  To lex you need to parse it.  To parse it you need to figure out how to parse yield.  Hence you get an obnoxious circularity.

Think of cases such as the following non-strict code snippet:

```js
function(a = yield+b) {
   "use strict";
}
```