millermedeiros / rocambole

Recursively walk and transform EcmaScript AST
171 stars 12 forks source link

Ignore TryStatement's "handlers" property in favor of "handler" #28

Closed wbinnssmith closed 9 years ago

wbinnssmith commented 9 years ago

I'm making this change because espree@2.x removes handlers entirely, so CatchClauses wouldn't be processed. Also, [estree has adopted handler in favor of handlers] https://github.com/eslint/eslint/issues/1930).

Esprima 2.1 and above (and pre-2.x espree) introduce handler while maintaining the old handlers array, so we can use it there too but must ignore handlers.

Flipping the ignore to the list, which would only have the one handler anyway, makes this all possible.