fix: should also allow subclass Promise without Symbol.species (#34533)

PR Close #34533
This commit is contained in:
JiaLiPassion
2019-12-22 13:15:08 +09:00
committed by Misko Hevery
parent 60018d265f
commit 58b29f1503
2 changed files with 10 additions and 3 deletions

View File

@ -384,7 +384,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
null): Promise<TResult1|TResult2> {
let C = (this.constructor as any)[Symbol.species];
if (!C || typeof C !== 'function') {
C = ZoneAwarePromise;
C = this.constructor || ZoneAwarePromise;
}
const chainPromise: Promise<TResult1|TResult2> = new (C as typeof ZoneAwarePromise)(noop);
const zone = Zone.current;