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

Commit 8119564

Browse files
committed
fix repatch
1 parent 066a247 commit 8119564

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/common/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ export function patchMicroTask(
431431

432432
export function attachOriginToPatched(patched: Function, original: any) {
433433
(patched as any)[zoneSymbol('OriginalDelegate')] = original;
434+
(original as any)[zoneSymbol('patchedDelegate')] = patched;
434435
}
435436

436437
let isDetectedIEOrEdge = false;
@@ -469,9 +470,9 @@ export function generateUnPatchAndRePatch(patches: [{target: any, methods: strin
469470
patches.forEach(patch => {
470471
patch.methods.forEach(m => {
471472
const method = patch.target[m];
472-
const originalDelegate = method && method[zoneSymbol(m)];
473-
if (originalDelegate) {
474-
patch.target[m] = originalDelegate;
473+
const patched = method && method[zoneSymbol('patchedDelegate')];
474+
if (patched) {
475+
patch.target[m] = patched;
475476
}
476477
});
477478
});

0 commit comments

Comments
 (0)