Skip to content
Open

Patch 2 #69794

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/zone.js/lib/browser/event-target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

export function eventTargetPatch(_global: any, api: _ZonePrivate) {
if ((Zone as any)[api.symbol('patchEventTarget')]) {
const patchSym = api.symbol('patchEventTarget');
if ((Zone as any).hasOwnProperty(patchSym) && (Zone as any)[patchSym]) {
// EventTarget is already patched.
return;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/zone.js/lib/common/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,11 @@ export function patchEventTarget(

const compare = patchOptions?.diff || compareTaskCallbackVsDelegate;

const unpatchedEvents: string[] = (Zone as any)[zoneSymbol('UNPATCHED_EVENTS')];
const unpatchedSymbol = zoneSymbol('UNPATCHED_EVENTS');
const unpatchedEvents: string[] = (Zone as any).hasOwnProperty(unpatchedSymbol)
? (Zone as any)[unpatchedSymbol]
: [];

const passiveEvents: string[] = _global[zoneSymbol('PASSIVE_EVENTS')];

function copyEventListenerOptions(options: any) {
Expand Down
Loading