Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 43f61e3

Browse files
committed
staging
1 parent 6a7e1ae commit 43f61e3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/common/promise.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
494494
});
495495
return wrapped.then(onResolve, onReject);
496496
};
497+
Ctor.prototype['__zone_symbol__patchedThen'] = Ctor.prototype.then;
497498
(Ctor as any)[symbolThenPatched] = true;
498499
}
499500

@@ -522,4 +523,14 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
522523

523524
// This is not part of public API, but it is useful for tests, so we expose it.
524525
(Promise as any)[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
526+
return {
527+
unPatchFn: function() {
528+
global['__zone_symbol__ZoneAwarePromise'] = NativePromise;
529+
NativePromise.prototype.then = NativePromise.prototype[symbolThen];
530+
},
531+
rePatchFn: function() {
532+
global['__zone_symbol__ZoneAwarePromise'] = ZoneAwarePromise;
533+
NativePromise.prototype.then = NativePromise.prototype['__zone_symbol__patchedThen'];
534+
}
535+
};
525536
});

0 commit comments

Comments
 (0)