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

Commit

Permalink
feat: add an option __zone_symbol__disableDatePatching to allow disab…
Browse files Browse the repository at this point in the history
…le patching global.Date (#1203)
  • Loading branch information
JiaLiPassion authored and vikerman committed Mar 20, 2019
1 parent a5fe09b commit c378f87
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/zone-spec/fake-async-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,15 @@ class FakeAsyncTestZoneSpec implements ZoneSpec {
}

static patchDate() {
if (!!global[Zone.__symbol__('disableDatePatching')]) {
// we don't want to patch global Date
// because in some case, global Date
// is already being patched, we need to provide
// an option to let user still use their
// own version of Date.
return;
}

if (global['Date'] === FakeDate) {
// already patched
return;
Expand Down

0 comments on commit c378f87

Please sign in to comment.