Skip to content

Commit

Permalink
Fix syntax for ghc js backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrb committed May 14, 2024
1 parent b35a3ab commit cb580ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions JavaScript/Web/AnimationFrame.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE JavaScriptFFI #-}
{-# LANGUAGE InterruptibleFFI #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE CPP #-}

{- |
Animation frames are the browser's mechanism for smooth animation.
Expand Down Expand Up @@ -64,7 +65,11 @@ cancelAnimationFrame h = js_cancelAnimationFrame h

foreign import javascript unsafe "(() => { return { handle: null, callback: null }; })"
js_makeAnimationFrameHandle :: IO AnimationFrameHandle
#ifdef __GHCJS__
foreign import javascript unsafe "(() => { return { handle: null, callback: $1 }; })"
#else
foreign import javascript unsafe "(($1) => { return { handle: null, callback: $1 }; })"
#endif
js_makeAnimationFrameHandleCallback :: JSVal -> IO AnimationFrameHandle
foreign import javascript unsafe "h$animationFrameCancel"
js_cancelAnimationFrame :: AnimationFrameHandle -> IO ()
Expand Down

0 comments on commit cb580ae

Please sign in to comment.