Skip to content

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

Merged

Conversation

DanielRosenwasser
Copy link
Member

No description provided.

export function getSuperContainer(node: Node): Node {
while (true) {
node = node.parent;
if (!node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

return undefined.

Copy link
Contributor

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;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for the undefined

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 people have spoken, the undefined has prevailed 😉.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 9, 2014

I do not see any tests..

@DanielRosenwasser DanielRosenwasser force-pushed the getOccurrencesSuperThanksForAsking branch from 9e8f8ce to 0e93d28 Compare September 9, 2014 19:43
@mhegazy
Copy link
Contributor

mhegazy commented Sep 9, 2014

👍

DanielRosenwasser added a commit that referenced this pull request Sep 9, 2014
…king

Get occurrences for 'super' keywords
@DanielRosenwasser DanielRosenwasser merged commit e1f8aa7 into getOccurrences Sep 9, 2014
@DanielRosenwasser DanielRosenwasser deleted the getOccurrencesSuperThanksForAsking branch September 9, 2014 21:25
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants