From 74b6802bb463688256c7ba80eb25105a45b3b09a Mon Sep 17 00:00:00 2001 From: Justin Brumley Date: Wed, 24 Jun 2020 03:31:27 -0500 Subject: [PATCH] fix(polyfill): check that window exists before defining CustomEvent (#1855) --- src/polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill.js b/src/polyfill.js index 3c08c3e3e..a234ee5e0 100644 --- a/src/polyfill.js +++ b/src/polyfill.js @@ -1,5 +1,5 @@ (() => { - if ( typeof window.CustomEvent === 'function' ) return; + if ( typeof window !== 'object' || typeof window.CustomEvent === 'function' ) return; const CustomEvent = (( event, params ) => { params = params || { bubbles: false, cancelable: false, detail: null };