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
Prefer explicit string conversion #620
Conversation
Do this for edge case such as: ES6 Symbols will throw a runtime exception if implicitly coerced into a string
b194394
to
d2bb835
Compare
Thanks! Sorry for letting this sit - did you verify that this fixes the issue for you? |
Yep verified. I probably should've put in a test for it. |
I'd like to test this. Could you include a test or use case that fails before this patch and works after? |
@leebyron I wasn't quite sure how to test this such that: Symbol() + ''; // this throws
String(Symbol()); // but this doesn't throw I added a test case that I was working from; but didn't get far. I added a polyfill, core-js, which may be undesirable. I think an alternative approach to testing would be to mock the String constructor using Jest; but I'm not quite sure how to do this. |
What's the status of this PR? I'm running into the same problem and would like to see this merged. |
Tests look good, just need to rebase and merge. Will get to that shortly. |
This needs more work. I won't be able to look into it for the next few weeks... |
@dashed Can you explain what needs more work? I can lend a hand 👍 |
Yay! Thanks @leebyron ! 🎉 |
Recover my Gmail account reginaladnier50@gmail.com
|
ES6 Symbols will throw a runtime exception if implicitly coerced into a string.
Closes #619
Unsure if this is the right patch.