From b4ac2f9125918c55ea4783f0e5ff3e93c6e6c08c Mon Sep 17 00:00:00 2001 From: amesgen Date: Thu, 24 Oct 2024 23:54:25 +0200 Subject: [PATCH] Files: use `globalThis` --- jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs b/jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs index 8dc3b7d..7f7fdf6 100644 --- a/jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs +++ b/jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs @@ -330,10 +330,10 @@ runBatch send sendSync = "\ \ inCallback--;\n\ \ };\n\ \ if(batch[1] && (initialSyncDepth || 0) === 0) {\n\ - \ window.requestAnimationFrame(processBatch);\n\ + \ globalThis.requestAnimationFrame(processBatch);\n\ \ }\n\ \ else {\n\ - \ processBatch(window.performance ? window.performance.now() : null);\n\ + \ processBatch(globalThis.performance ? globalThis.performance.now() : null);\n\ \ }\n\ \ };\n\ \ runBatch(batch);\n\ @@ -444,7 +444,7 @@ ghcjsHelpers = "\ \ };\n\ \}\n\ \function h$newByteArrayFromBase64String(base64) {\n\ - \ var bin = window.atob(base64);\n\ + \ var bin = globalThis.atob(base64);\n\ \ var ba = h$newByteArray(bin.length);\n\ \ var u8 = ba.u8;\n\ \ for (var i = 0; i < bin.length; i++) {\n\ @@ -459,6 +459,6 @@ ghcjsHelpers = "\ \ for (var i = off; i < end; i++) {\n\ \ bin += String.fromCharCode(u8[i]);\n\ \ }\n\ - \ return window.btoa(bin);\n\ + \ return globalThis.btoa(bin);\n\ \}\n\ \"