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

Commit

Permalink
staging
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion committed Apr 29, 2018
1 parent 6a7e1ae commit 43f61e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/common/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
});
return wrapped.then(onResolve, onReject);
};
Ctor.prototype['__zone_symbol__patchedThen'] = Ctor.prototype.then;
(Ctor as any)[symbolThenPatched] = true;
}

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

// This is not part of public API, but it is useful for tests, so we expose it.
(Promise as any)[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
return {
unPatchFn: function() {
global['__zone_symbol__ZoneAwarePromise'] = NativePromise;
NativePromise.prototype.then = NativePromise.prototype[symbolThen];
},
rePatchFn: function() {
global['__zone_symbol__ZoneAwarePromise'] = ZoneAwarePromise;
NativePromise.prototype.then = NativePromise.prototype['__zone_symbol__patchedThen'];
}
};
});

0 comments on commit 43f61e3

Please sign in to comment.