fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.05k stars 711 forks source link

Version of Babel in transform mismatched with version of Babel in tree view #652

Open jaredp opened 2 years ago

jaredp commented 2 years ago

Describe the bug When the transform panel uses Babel to parse with createParenthesizedExpressions: true and prints the AST to the console, there are no ParenthesizedExpression nodes in the console.

This doesn't match the tree view, which shows a ParenthesizedExpression node in between the ExpressionStatement and the StringLiteralExpression

This suggests the version of @babel/parser available in the transform panel is a different (older?) version than available in the tree view, such that the version in the transform panel doesn't support createParenthesizedExpressions

To Reproduce https://astexplorer.net/#/gist/e7492c62c92b167cbc46e5a58dd28a47/9ad795d751343a625ca8683e0bf644eebbe4434a

Expected behavior The AST printed to the console to have a ParenthesizedExpression node in between the ExpressionStatement and the StringLiteralExpression nodes.

Screenshots Screen Shot 2022-06-08 at 12 01 31 AM Screen Shot 2022-06-08 at 12 01 31 AM

Browser (please complete the following information):

astexplorer settings:

Additional context Add any other context about the problem here.