This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 407
ZoneAwarePromise does not validate other Promise polyfills tests #499
Comments
Ran into the same issue recently, when loaded third-party module with es6-promise. Can anyone look at this one please? |
@krassx , I will check it. thank you |
Cool, thank you. |
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Apr 12, 2017
mhevery
pushed a commit
that referenced
this issue
Apr 21, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
0.6.25
Problem
Many external libraries already include a Promise polyfill in their source code, which tests support for Promise before adding their own implementation. The problem is that the test are very specific and ZoneAwarePromise does not validate all of them.
For example, I have this very popular Promise polyfill in one of my lazyloaded dependencies : https://github.com/stefanpenner/es6-promise
The test used to detect Promise support is:
With ZoneAwarePromise,
Object.prototype.toString.call(P.resolve());
returns[object Object]
which makes the test failing. So ZoneAwarePromise is replaced by the polyfill implementation, and change detection does not work anymore after promise resolution.Is there anything you can do to make this test pass ?
Workaround
Currently the only ugly workaround I found is to monkey-patch
Object.prototype.toString
:The text was updated successfully, but these errors were encountered: