jshint/jshint — pull request #1109 by usrbincc (2013-05-29 21:25:54+00:00)
Title: Parse yield expressions.

Most of this patch consists of code to determine whether or not Mozilla needs parens around `yield` in a given situation. Mozilla `yield` parsing has some serious quirks, and I can't be certain I got them all.

Mozilla needing parens for `yield` seems to be only partially based on precedence. The rest of it seems to be based on some semi-random sense of aesthetics. It makes me curious as to what their parsing code is actually doing. Not quite curious enough to check, but almost.

----

Fixes #387. The bug there was that jshint was only checking for the end of expression once, and not per-loop. There was some incompleteness in the checking condition, too. Hopefully I got everything.

----

Fixes #1108. Comma expressions were using the default whitespace checking for `infix`, which in addition to being wrong, also conflicted with the comma-specific whitespace checking. Fixed by moving all comma whitespace checking over to comma-specific code.

jshint currently has no comprehensive tests of whitespace checking, which is how this bug sneaked in in the first place. I'll do this in a follow-up pull.

----

Sorry about combining these separate bugfixes into one pull request. The #1108 fix could have conceivably been done separately, but it would have been impossible to parse yield expressions properly without the #387 fix.