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 Tree.Prototype.entryById and .getEntry #1731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miachenmtl
Copy link

@miachenmtl miachenmtl commented Oct 2, 2019

I was experiencing a bug where Entry.prototype.path() was not working when a tree entry was fetched using Tree.prototype.entryById. This PR should resolve the bug. I also noticed that entryByPath had the same problem, but in this case, getEntry adds the necessary properties, so I renamed entryByPath to _entryByPath following the same pattern as entryByName and _entryByName.

  • entryById now follows pattern of entryByName and entryByIndex where the parent property is added to the entry. The description notes that it does not recurse.
  • entryByPath renamed to _entryByPath since getEntry should be used instead.
  • Simple test for entryById added.
  • Setup of commits used in test for TreeEntry.walk moved to test setup so getEntry can test searching by path as well.

* entryById now follows pattern of entryByName and entryByIndex where the parent property is added to the entry.
* entryByPath renamed to _entryByPath since getEntry should be used instead.
* Simple test for entryById added.
* Setup of commits used in test for TreeEntry.walk moved to test setup so getEntry can test searching by path as well.
* Tests using Tree.prototype.entryByPath now use Tree.prototype.getEntry.
@miachenmtl miachenmtl changed the title Fix TreeEntry.Prototype.entryById and .getEntry Fix Tree.Prototype.entryById and .getEntry Oct 2, 2019
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

1 participant