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

visitor keys for ClassPrivateMethod type do not match the structure of ClassPrivateMethod nodes #11972

Closed
1 task done
piranna opened this issue Aug 17, 2020 · 4 comments · Fixed by #11973
Closed
1 task done
Labels
area: eslint i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@piranna
Copy link

piranna commented Aug 17, 2020

Originally reported at eslint/eslint#13575.

Bug Report

  • I would like to work on a fix!

Current behavior

Using @babel/eslint-parser to parse some code with a private method declaration, eslint crashes:

Oops! Something went wrong! :(

ESLint: 7.7.0

TypeError: Cannot read property 'type' of undefined
Occurred while linting /home/piranna/Trabajo/Veedeo.me/kurento-utils-js/src/WebRtcPeerCore.js:30
    at collectUnusedVariables (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/rules/no-unused-vars.js:569:50)
    at collectUnusedVariables (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/rules/no-unused-vars.js:603:17)
    at collectUnusedVariables (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/rules/no-unused-vars.js:603:17)
    at collectUnusedVariables (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/rules/no-unused-vars.js:603:17)
    at Program:exit (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/rules/no-unused-vars.js:615:36)
    at /home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (/home/piranna/Trabajo/Veedeo.me/kurento-utils-js/node_modules/eslint/lib/linter/node-event-generator.js:283:22)

Expected behavior

Parsing should be done flawlessly.

Babel Configuration

  • Filename: babel.config.js
module.exports = {
  presets: ['@babel/preset-env'],
  plugins: [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-private-methods"
  ]
}

Environment

  System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
  Binaries:
    Node: 14.4.0 - /usr/bin/node
    npm: 6.14.5 - /usr/bin/npm
  • Babel version(s): 7.10.5
  • Monorepo: no
  • How you are using Babel: cli

Possible Solution

Add parent field to ClassPrivateMethod nodes

Additional context

Originally reported (and with more info) at eslint/eslint#13575

@babel-bot
Copy link
Collaborator

Hey @piranna! 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."

@JLHwung
Copy link
Contributor

JLHwung commented Aug 17, 2020

@piranna Sorry I went ahead and filed a PR before I realize you want to work on a fix. Can you take a review at #11973?

@piranna
Copy link
Author

piranna commented Aug 17, 2020

Reviewed and aproved :-)

@JLHwung
Copy link
Contributor

JLHwung commented Aug 20, 2020

Fixed in @babel/eslint-parser@7.11.4.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 20, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: eslint i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants