don't double count binding references (#3465)
When, for example, a function is moved between from one place to another we recrawl and end up double counting any references it holds to the upper scope. This protects against that. (The same thing is done for constant violations in the `reassign` method)
This commit is contained in:
parent
330071e59d
commit
109d99bb5e
@ -82,6 +82,9 @@ export default class Binding {
|
||||
*/
|
||||
|
||||
reference(path: NodePath) {
|
||||
if (this.referencePaths.indexOf(path) !== -1) {
|
||||
return;
|
||||
}
|
||||
this.referenced = true;
|
||||
this.references++;
|
||||
this.referencePaths.push(path);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user