Skip to content

Commit

Permalink
Use JSaddle.Warp.debug when run from GHCI (#770)
Browse files Browse the repository at this point in the history
* Use `JSaddle.Warp.debug` when run from GHCI

* Fix GHCJS runner

* Move import
  • Loading branch information
georgefst authored Feb 21, 2025
1 parent ff4f759 commit cada710
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Miso/Runner.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
module Miso.Runner (run) where

#if defined(wasm32_HOST_ARCH)
import qualified Language.Javascript.JSaddle.Wasm as J
#else
import qualified Language.Javascript.JSaddle.Warp as J
import System.Environment
#endif

import Language.Javascript.JSaddle
Expand All @@ -15,5 +17,11 @@ run :: JSM () -> IO ()
run = J.run
#else
run :: JSM () -> IO ()
#ifndef ghcjs_HOST_OS
run x = getProgName >>= \case
"<interactive>" -> J.debug 8008 x
_ -> J.run 8008 x
#else
run = J.run 8008
#endif
#endif

0 comments on commit cada710

Please sign in to comment.