Waldemar Horwat (2013-11-26T20:53:14.000Z)
domenic at domenicdenicola.com (2013-12-10T01:23:34.847Z)
On 11/25/2013 04:48 PM, Brendan Eich wrote: > Well, we can handle it. We know due to lack of * after function that yield, whether reserved (due to "use strict"; in body prologue) or not, can't be yield-the-operator. So it's either an identifier (no "use strict";) or a reserved word (and an error due to lack of * after function). > > So we parse it as an identifier, just as we parse duplicate formal parameters. Then if we see "use strict", we must post-process the parse tree and throw an error. Kind of a shame, but there it is. > > At least reserving 'let' in ES5 strict did some good! For another example of why keying off generator/non-generator instead of strict mode for the parsing of yield is the right thing to do: ```js function*(a = yield/b/g) { a = yield/b/g; } ``` One of these is a regexp. The other is a couple divisions. Get this wrong and you can introduce security problems.