News for hackers. Stuff that matters.
Re:ES6 generators in depth by 15155 on Monday March 30, 2015 @01:00PM (#9290841)
What about the "yield" keyword?
Re:ES6 generators in depth by adrusi on Monday March 30, 2015 @01:15PM (#9290937)
It's only valid as a keyword within the `function*` block, so the parser can treat it as an identifier elsewhere. I haven't read the detailed spec, so I'm not sure that this is the standard behavior, but this would be a way to preserve complete backward compatability.
Re:ES6 generators in depth by rauschma on Monday March 30, 2015 @04:04PM (#9292197)
Yes, that’s how it works. `yield` is only reserved in ES5 strict mode. But due to it only being a keyword inside generators, there are no problems in non-strict mode.