PiotrDabkowski / pyjsparser

Fast JavaScript parser for Python.
MIT License
246 stars 37 forks source link

AttributeError when parsing lambdas #25

Closed PetterS closed 5 years ago

PetterS commented 5 years ago

Repro:

function f() {
    (a, b) => true;
}

Gives the following error:

<long stack trace removed>

File "/home/petter/.local/share/virtualenvs/ledev-ZDcxcYku/lib/python3.6/site-packages/pyjsparser/parser.py", line 1925, in parseAssignmentExpression
    if (expr.type == PlaceHolders.ArrowParameterPlaceHolder or self.match('=>')):
AttributeError: 'dict' object has no attribute 'type'

I realize this syntax is not supported, but this AttributeError seems like a bug.

PiotrDabkowski commented 5 years ago

this is now fixed

PetterS commented 5 years ago

Thanks!