schmidtk / opensphere-jscodeshift

Scripts designed to migrate OpenSphere code toward ES6 modules, by performing abstract syntax tree (AST) transforms on JavaScript.
Apache License 2.0
1 stars 1 forks source link

Leading comments inserted inside of parenthesized expression #1

Open schmidtk opened 6 years ago

schmidtk commented 6 years ago

Open this AST Explorer example.

The ObjectExpression returned by the function has both leadingComments defined and "parenthesizedExpression": true. When the CallExpression for goog.isDef is replaced, the pretty printer writes the leading comments inside the parentheses for the object expression.

schmidtk commented 6 years ago

This seems to be unexpected behavior in jscodeshift, so I opened an issue here: facebook/jscodeshift/issues/258

schmidtk commented 6 years ago

Added code to detect this problem and log a warning so developers can correct it more easily. Leaving this open in case it can be fixed.

schmidtk commented 6 years ago

Opened benjamn/recast/issues/508 and benjamn/recast/issues/509 to see if these can be fixed.