From a3b1d832e3aeec8d55094ba75f290f60346a08e3 Mon Sep 17 00:00:00 2001 From: Wojciech Pawlik Date: Fri, 7 Jan 2022 15:05:04 +0100 Subject: [PATCH] Shim `EventTarget` to support Node 14 --- packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts b/packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts index 4cc89cc..a75cdf2 100644 --- a/packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts +++ b/packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts @@ -3,6 +3,8 @@ // The listeners don't actually matter because the state of these permissions // is constant and mocked as Node.js has all doors open. +(globalThis as any).EventTarget ??= require("events").EventTarget ?? null; + export class PermissionStatus extends EventTarget implements Deno.PermissionStatus { onchange: ((this: PermissionStatus, ev: Event) => any) | null = null;