Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 28, 2017

Fixes #16078
@aozgaa may be interested in poking holes in this.

In resolveNameHelper, we climb up looking for a name, and we keep track of both the current location and the last location. If we got a symbol from the locals of the current location, and it's lastLocation, that means that we are inside lastLocation looking up a name, and getting that node itself -- meaning it is a self-reference and should not be counted when considering --noUnusedLocals.

@ghost ghost requested a review from sheetalkamat July 28, 2017 21:40
@aozgaa
Copy link
Contributor

aozgaa commented Aug 4, 2017

LGTM

@sheetalkamat
Copy link
Member

@Andy-MS looks good. Nit: can you please update the comment at the change location to what you have in the description of this PR. that comment there is not that clear to understand.

@ghost ghost merged commit 94518e8 into master Aug 8, 2017
@ghost ghost deleted the dontReferenceMe branch August 8, 2017 18:18
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
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.

noUnusedLocals: Don't count self-call in recursive function

3 participants