-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Extend property method range and loc to include params (fixes #36)
This is jquery/esprima#1036 ported to Espree. Previously, the range and loc for get, set, and shorthand methods inside object literal properties included only the method body, meaning a method's parameters were outside the range of their parent `FunctionExpression` node. This was happening because the marker for the `FunctionExpression` node wasn't being created until `parsePropertyFunction` was called, by which point the mothod's parameters had already been parsed. This PR solves the issue by creating the marker for the start of the `FunctionExpression` node as soon as it determines that the property is a get, set, or shorthand method, then passing the marker into `parsePropertyFunction`. Though #36 only describes the specific case of generator shorthand methods, the same bug is present on get, set, and shorthand property methods, and this PR fixes all three cases.
- Loading branch information
Showing
18 changed files
with
109 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.