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

popScopesTill broken in version 8 #384

Closed
kuhnroyal opened this issue Oct 23, 2024 · 8 comments
Closed

popScopesTill broken in version 8 #384

kuhnroyal opened this issue Oct 23, 2024 · 8 comments

Comments

@kuhnroyal
Copy link
Contributor

Hello @escamoteur

The changes in commit 7d2d4bb lead to popScopeTill(inclusive: true) always popping all scopes until the base scope. The while loop exit condition does not trigger when inclusive == true.

@kuhnroyal
Copy link
Contributor Author

I added tests in #385 for now

@escamoteur
Copy link
Collaborator

escamoteur commented Oct 23, 2024 via email

@kuhnroyal
Copy link
Contributor Author

Yea, I think I fixed it.

while (hasScope(scopeName) && inclusive
        ? (poppedScopeName != scopeName)
        : (nextScopeToPop.name != scopeName))

This lead to the else branch running even if hasScope returned false.

Additionally I found a secondary problem if the passed scopeName is the top scope and inclusive == false which would always have popped the first scope because of the used do() while loop.

Changes are on the same PR.

@kuhnroyal
Copy link
Contributor Author

Fixed by #385

@kuhnroyal
Copy link
Contributor Author

@escamoteur Can you please cut a release when you get a chance, thanks!

@escamoteur
Copy link
Collaborator

escamoteur commented Oct 28, 2024 via email

@escamoteur
Copy link
Collaborator

escamoteur commented Oct 30, 2024 via email

@kuhnroyal
Copy link
Contributor Author

Thanks a lot!

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

No branches or pull requests

2 participants