-
Notifications
You must be signed in to change notification settings - Fork 13k
Get occurrences for 'super' keywords #632
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
Get occurrences for 'super' keywords #632
Conversation
export function getSuperContainer(node: Node): Node { | ||
while (true) { | ||
node = node.parent; | ||
if (!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.
return undefined.
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.
still return undefined :)
you can also make this simpler with just:
while (node) {
switch (node.kind) { ... }
node = node.parent;
}
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.
+1 for the undefined
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 people have spoken, the undefined
has prevailed 😉.
I do not see any tests.. |
9e8f8ce
to
0e93d28
Compare
👍 |
…king Get occurrences for 'super' keywords
No description provided.