-
Notifications
You must be signed in to change notification settings - Fork 43
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
Check whether it is an expression before accessing the expression properties #80
Check whether it is an expression before accessing the expression properties #80
Conversation
var lastArgument = route.expression.arguments[route.expression.arguments.length-1]; | ||
if (types.FunctionExpression.check(lastArgument)) { | ||
traverseExpressions(lastArgument.body.body); | ||
if (route.expression) { |
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.
Can you also check if the AST type is a CallExpression
with if (types.CallExpression.check(route.expression)) {
?
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.
👍
Looks good, can you add a test covering this issue? |
32a5f7d
to
d809d02
Compare
d809d02
to
9700acd
Compare
Shall i include the test for normal route structure also? or this is enough? @marcioj |
Check whether it is an expression before accessing the expression properties
This is good to go, we have other tests with more common scenarios. Thank you for your contribution! |
👍 |
Need to check whether the node is a
expression
before getting theexpression properties
Found while testing the issue #79
Feel free to reject the PR if not needed.