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

Do not count class names and method names as undeclared #1

Merged
merged 3 commits into from Feb 24, 2019
Merged

Conversation

danez
Copy link
Contributor

@danez danez commented Feb 23, 2019

This adds support for correctly detecting classes

class A {
  method() {}
}

This example right now would return A and method as undeclared identifiers.

This PR fixes this and correctly detects them as binding identifiers/methods.

This issue came up with packd which uses browserify internally. For example:
https://bundle.run/@babel/plugin-proposal-class-properties@7.3.3
This failed bundling because @babel/generator defines a class called Buffer: https://unpkg.com/@babel/generator@7.3.3/lib/buffer.js

Hopefully with this fix it should work.

If this PR is okay and merged, it would be nice if you could create a new patch release, so I can forward this fix to packd.
Thanks in advance.

I also added some tests for super() inside classes which seems to work fine.

Copy link
Owner

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

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

super, thanks!

@goto-bus-stop goto-bus-stop merged commit 854b6ae into goto-bus-stop:master Feb 24, 2019
@goto-bus-stop
Copy link
Owner

📦 1.1.3

@danez danez deleted the classes branch February 24, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants