esprima icon indicating copy to clipboard operation
esprima copied to clipboard

get wrong range for ArrowFunctionExpression.body

Open wangyu0air opened this issue 6 years ago • 0 comments

Get wrong range for ArrowFunctionExpression.body when the body is AssignmentExpression and has bracket around

Steps to reproduce

esprima.parse('e => ({ property: 42 })')

Expected output

range of ArrowFunctionExpression.body should be [5, 23], that is , the body is "({ property: 42 })"

Actual output

got range of ArrowFunctionExpression.body [6, 22], missing left and right bracket, only "{ property: 42 }" is left

Relevant references

wangyu0air avatar Aug 10 '18 08:08 wangyu0air