git.iko.soy/typeable/entropy
on main help sign in
Merge pull request #65 from obsidiansystems/aa/nonwindow-contexts

ghcjs: Use globalThis instead of window

commitfaf34fd5c202110a2c7baf0ff562252057114d3b authorThomas M. DuBuisson <thomas.dubuisson@gmail.com> dateSun 21 Aug 2022, 19:07 (4 years ago) parent2aca9efddda007
2 files changed+4−4
System/EntropyGhcjs.hs+3−3 entropy.cabal+1−1
System/EntropyGhcjs.hs+3−3
@@ -19,7 +19,7 @@ import Data.ByteString as B
1919import GHCJS.DOM.Crypto as Crypto
2020import GHCJS.DOM.Types (ArrayBufferView (..), fromJSValUnchecked)
2121import GHCJS.DOM.GlobalCrypto (getCrypto)
22−import GHCJS.DOM (currentWindowUnchecked)
22+import GHCJS.DOM (globalThisUnchecked)
2323import Language.Javascript.JSaddle.Object as JS
2424
2525
@@ -36,8 +36,8 @@ hardwareRandom _ = pure Nothing
3636-- |Open a `CryptHandle`
3737openHandle :: IO CryptHandle
3838openHandle = do
39− w <- currentWindowUnchecked
40− CH <$> getCrypto w
39+ this <- globalThisUnchecked
40+ CH <$> getCrypto this
4141
4242-- |Close the `CryptHandle`
4343closeHandle :: CryptHandle -> IO ()
entropy.cabal+1−1
@@ -56,7 +56,7 @@ library
5656 default-language: Haskell2010
5757
5858 if impl(ghcjs) || os(ghcjs) {
59− build-depends: ghcjs-dom
59+ build-depends: ghcjs-dom >= 0.9.5.0 && < 1
6060 , jsaddle
6161 }
6262 else {