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

Fix getBindingIdentifiers in babel-types #5068

Merged
merged 3 commits into from Jan 9, 2017

Conversation

rtsao
Copy link
Contributor

@rtsao rtsao commented Jan 5, 2017

Q A
Patch: Bug Fix? yes
Major: Breaking Change? no
Minor: New Feature? no
Deprecations? no
Spec Compliancy? yes
Tests Added/Pass? yes
Fixed Tickets
License MIT
Doc PR no
Dependency Changes no

Summary of changes:

  • Added passing tests for t.getBindingIdentifiers (the first two tests)
  • Added a test which should pass, but fails without the fix in this PR (the third test)
  • Fixed logic in t.getBindingIdentifiers regarding handling of ExportDeclarations

The correct logic (which is added in this PR) is currently in reflected in the equivalent implementation of getBindingIdentifierPaths function in babel-traverse:

// …
    if (id.isExportDeclaration()) {
      const declaration = id.get("declaration");
      if (declaration.isDeclaration()) {
        search.push(declaration);
      }
      continue;
    }
// …

@codecov-io
Copy link

Current coverage is 89.15% (diff: 100%)

Merging #5068 into master will not change coverage

@@             master      #5068   diff @@
==========================================
  Files           203        203          
  Lines          9821       9821          
  Methods        1072       1072          
  Messages          0          0          
  Branches       2614       2614          
==========================================
  Hits           8756       8756          
  Misses         1065       1065          
  Partials          0          0          

Powered by Codecov. Last update 796c6c0...ae87097

@hzoo hzoo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Jan 9, 2017
@hzoo
Copy link
Member

hzoo commented Jan 9, 2017

Awesome work @rtsao (I see it's your first PR too)! Yeah we need to figure out how to separate babel-types/traverse/core logic better

@hzoo hzoo merged commit 39d1867 into babel:master Jan 9, 2017
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
* Added getBindingIdentifier tests

* Added failing test for getBindingIdentifiers

* Fix babel-types getBindingIdentifiers
@hzoo
Copy link
Member

hzoo commented Jan 20, 2017

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants