jshint/jshint — pull request #1989 by jugglinmike (2014-11-18 22:14:05+00:00)
Title: Fat arrow args 5

In gh-1984, @caitp proposed a quick solution to gh-1983. This is an attempt to resolve the same issue in a more fundamental way. It includes an additional test that demonstrates how this approach addresses a more fundamental issue.

I reused @caitp's commit to preserve the unit test, refactored the parenthesis-balancing logic, and included the fix itself in a separate commit. Here's the message for that last commit:

> Re-use code to parse "fat arrow" function params
>
> Prior to this commit, JSHint parsed "fat arrow" function parameters as though they were expressions in a list. This had unintended side-effects relating to:
>
> 1. the scope of the declared variables. This problem was only partially addressed through manual modification of the data structure for global variables.
> 2. the syntax accepted within the arguments list. Most significantly, "default parameters" expressions were misinterpreted.
>
> By re-using the `doFunction` function, the same logic can be used when parsing parameters of both "traditional" functions and "fat arrow functions".
>
> This change requires supplying additional context to `doFunction` because the parser may have already consumed certain tokens depending on the form of the expression.
>
> Fixes gh-1983