Fixes AwilixResolutionError throwing TypeError if resolution stack contains symbols.#205
Merged
jeffijoe merged 2 commits intojeffijoe:masterfrom Oct 23, 2020
astephens25:master
Merged
Fixes AwilixResolutionError throwing TypeError if resolution stack contains symbols.#205jeffijoe merged 2 commits intojeffijoe:masterfrom astephens25:master
jeffijoe merged 2 commits intojeffijoe:masterfrom
astephens25:master
Conversation
Owner
|
Thanks for the PR! I think this will fail if you have a symbol and a regular string where the symbol name and the string are the same since you EDIT: Hmm weird, a few lines above I already do EDIT2: Nevermind, I am blind 😂 |
jeffijoe
reviewed
Oct 23, 2020
src/errors.ts
Outdated
| } | ||
| resolutionStack = resolutionStack.slice() | ||
| resolutionStack = resolutionStack | ||
| .slice() |
Owner
There was a problem hiding this comment.
Since you do a map you can remove slice.
Contributor
Author
There was a problem hiding this comment.
Good catch. Total face-palm on my part. I just pushed that change.
1 similar comment
Owner
|
Released in v4.2.7 🥳 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I use symbols heavily in resolution so they may exist on multiple levels. I found the AwilixResolutionError was throwing another error: "TypeError: Cannot convert a Symbol value to a string". The symbol "names" in the resolution stack were failing on the array join. I added a test to cover this scenario.
Code coverage: 100%
Linting Passes
Please let me know if there is anything else you would like me to do.