-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Conversation
vigneshshanmugam
commented
May 14, 2018
•
edited
Loading
edited
- fix 0.4.2 breaks - passes invalid data to babel-helper-evaluate-path #845
- fix Something went wrong when updating #844
declaration.parentPath.isSwitchCase() | ||
t.isIfStatement(declaration.parentPath) || | ||
t.isLoop(declaration.parentPath) || | ||
t.isSwitchCase(declaration.parentPath) |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.