Skip to content
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

referencePaths #10299

Open
yuyaryshev opened this issue Aug 4, 2019 · 3 comments

Comments

@yuyaryshev
Copy link

commented Aug 4, 2019

Bug Report

Current Behavior
An identifier is not counted in referencePaths for variable assingnment.
Reference from line 2 in example below is missing.

Input Code

        let a = 1;
        a = 2;
        console.log('a=', a);

Expected behavior/code
referencePaths for binding "a" to contain 3 references.

Environment

  • Babel version(s): 7.5.5
@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Aug 4, 2019

Hey @yuyaryshev! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

I would expect only the second like and the third line to count as references; the fiesta line is a binding.

@JLHwung

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2019

True, and it seems that

// yes: left = NODE;
// no: NODE = right;
case "AssignmentExpression":
return parent.right === node;

does not conform to §6.2.4

the left-hand operand of an assignment is expected to produce a reference.

@JLHwung JLHwung removed the i: needs triage label Aug 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.