-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
window.onunhandledrejection called twice #760
Comments
I close the issue because this might have been caused by a hack we had to force usage of core-js Promise polyfill even on modern Browsers ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, in a browser environment, we have a callback defined as:
window.onunhandledrejection = ...
In case of unhandled promise rejection, our callback is called twice.
We inspected core-js source code and the problem seems to be in
es.promise.js
:Indeed, it seems in modern browser implementations
global.dispatchEvent(event);
calls thewindow.onunhandledrejection
callback if the event type isunhandledrejection
.Two lines after,
if (handler = global['on' + name]) handler(event);
calls the exact same callback, asglobal == window
and'on' + name == onunhandledrejection
.Did I miss something? Is it a
core-js
bug?The text was updated successfully, but these errors were encountered: