Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle non array statements in evaluate helper #846

Merged
merged 4 commits into from
May 14, 2018
Merged

Conversation

vigneshshanmugam
Copy link
Member

@vigneshshanmugam vigneshshanmugam commented May 14, 2018

@vigneshshanmugam vigneshshanmugam changed the title fix: remove babel types and handle tdz binding fix: handle non array statements in evaluate helper May 14, 2018
declaration.parentPath.isSwitchCase()
t.isIfStatement(declaration.parentPath) ||
t.isLoop(declaration.parentPath) ||
t.isSwitchCase(declaration.parentPath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be declaration.parentPath.node.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with that is it would fail if node is removed, so I went with this check which we do already when binding is of kind "var"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. so isRemoved should be the first check. I think there is a difference between using t.is methods on a path and a node.

Copy link
Member Author

@vigneshshanmugam vigneshshanmugam May 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back to using path.isCheck since its wrong to use types check for path as you mentioned.

@boopathi boopathi added the Tag: Bug Fix Pull Request fixes a bug label May 14, 2018
@boopathi boopathi merged commit 91ed362 into master May 14, 2018
@boopathi boopathi deleted the fix-844 branch May 14, 2018 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tag: Bug Fix Pull Request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.4.2 breaks - passes invalid data to babel-helper-evaluate-path Something went wrong when updating
2 participants