-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Unhandled promise rejection with a symbol crashes node #11637
Comments
The correct code would be to use What I'm more worried about is that we might have to conduct a comprehensive audit for template string usage in the code base for possibility of symbols, since it's possible that they are going to blow up as well. |
Cool. I was thinking |
@apexskier, that wouldn't work in cases like |
The unhandled promise rejection warning uses a template literal and prints the reason a promise was rejected. If rejecting with a symbol, the symbol failed to convert to a string and the process crashed. Now, symbols are casted to strings and the process does not crash. Fixes: #11637 PR-URL: #11640 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The unhandled promise rejection warning uses a template literal and prints the reason a promise was rejected. If rejecting with a symbol, the symbol failed to convert to a string and the process crashed. Now, symbols are casted to strings and the process does not crash. Fixes: #11637 PR-URL: #11640 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The unhandled promise rejection warning uses a template literal and prints the reason a promise was rejected. If rejecting with a symbol, the symbol failed to convert to a string and the process crashed. Now, symbols are casted to strings and the process does not crash. Fixes: #11637 PR-URL: #11640 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The unhandled promise rejection warning uses a template literal and prints the reason a promise was rejected. If rejecting with a symbol, the symbol failed to convert to a string and the process crashed. Now, symbols are casted to strings and the process does not crash. Fixes: #11637 PR-URL: #11640 Reviewed-By: Anna Henningsen <anna@addaleax.net>
node: v8.1.4
|
What does InvalidValueError look like? |
@muhammadfaizan Try Node.js 8.5.0. It should be fixed in #13784. |
Rejecting a promise with a Symbol will crash node. I'd expect it to handle this, or at least to crash in a different way. The traceback indicates node is unable to convert a Symbol to a string, though this is possible both in the REPL and when using
.toString()
.A simple demo session:
Chrome (V8) handles this as I'd expect:
The text was updated successfully, but these errors were encountered: