diff --git a/lib/common/utils.ts b/lib/common/utils.ts index e7bbed307..0af2559b6 100644 --- a/lib/common/utils.ts +++ b/lib/common/utils.ts @@ -158,6 +158,11 @@ export function patchProperty(obj: any, prop: string, prototype?: any) { return; } + const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched'); + if (obj[onPropPatchedSymbol]) { + // return; + } + // A property descriptor cannot have getter/setter and be writable // deleting the writable and value properties avoids this error: // @@ -240,6 +245,8 @@ export function patchProperty(obj: any, prop: string, prototype?: any) { }; ObjectDefineProperty(obj, prop, desc); + + obj[onPropPatchedSymbol] = true; } export function patchOnProperties(obj: any, properties: string[]|null, prototype?: any) {