You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
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.
let P = local.Promise;
if (P) {
var promiseToString = null;
try {
promiseToString = Object.prototype.toString.call(P.resolve());
} catch(e) {
// silently ignored
}
if (promiseToString === '[object Promise]' && !P.cast){
return;
}
}
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 :