-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Promise.reject(reason) often fires and ignores exceptions -- not debug friendly #144
Comments
By spec a promise rejection reason can technically be a non-error like a string or a number or other absurd value but the non-spec extensions like I guess notEnumerableProp could add a check to avoid throwing for that case |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The docs say "Promise.reject(dynamic reason) -> Promise" but the code does this:
So if "reason" is undefined or something that can't have a property defined like a string literal, then it throws and ignores it.
This doesn't crash, but if you're using "pause on all exceptions" in Chrome, it's annoying. Also, then the "isAsync" property won't exist... does that cause problems later?
If you like the existing behavior, then the docs should change to say that "reason" needs to be an object.
The text was updated successfully, but these errors were encountered: