-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Reconciliate Zone.js promises with core-js #319
Comments
See https://tc39.github.io/ecma262/#sec-promise.prototype.then and https://tc39.github.io/ecma262/#sec-speciesconstructor |
@loganfsmyth right. Anyway, |
@loganfsmyth Thanks for the hint and the links, that's helpful. |
My application has just hit this as well. There was an issue filed in the zone.js repo but it got closed and the repo was archived. I filed a new issue in the Angular repo to address this: angular/angular#33989. The workaround we ended up using was to just conditionally load the polyfill:
Another option we considered was telling the host application to save a reference to the Promise and then restore it after our script was executed. |
The title of the issue is a bit abstract. Here is the situation:
Zone.js script, used notably by Angular framework, overrides Promise implementation with so called ZoneAwarePromise.
Now, if you load a library which relies on core-js/es6/promise, Zone promises are not considered compliant by core-js check. As a consequence, the Zone promises are replaced, but that leads to fatal consequences for the application.
Here is a fiddle including both zone and core-js unminified scripts: demo
I am aware that it might be something to change on Zone side, but I'm first raising the issue here as I want to understand what's going on with core-js check. Below is the relevant part:
The above "@@species test" materialised by
promise.then(empty) instanceof FakePromise;
returns false.Could you please elaborate on what Zone is missing to pass this test?
The text was updated successfully, but these errors were encountered: