Skip to content

Commit

Permalink
Fix callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Feb 4, 2024
1 parent c64b07a commit 632ff5a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GHCJS/Foreign/Callback.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,19 @@ asyncCallback3 x = js_asyncCallbackApply 3 (unsafeCoerce x)

-- ----------------------------------------------------------------------------

foreign import javascript unsafe "h$makeCallback(h$runSync, [$1], $2)"
foreign import javascript unsafe "(($1,$2) => { return h$makeCallback(h$runSync, [$1], $2)); })"
js_syncCallback :: Bool -> Exts.Any -> IO (Callback (IO b))
foreign import javascript unsafe "h$makeCallback(h$run, [], $1)"
foreign import javascript unsafe "(($1) => { return h$makeCallback(h$run, [], $1); })"
js_asyncCallback :: Exts.Any -> IO (Callback (IO b))
foreign import javascript unsafe "h$makeCallback(h$runSyncReturn, [false], $1)"
foreign import javascript unsafe "(($1) => { return h$makeCallback(h$runSyncReturn, [false], $1); })"
js_syncCallbackReturn :: Exts.Any -> IO (Callback (IO JSVal))

foreign import javascript unsafe "h$makeCallbackApply($2, h$runSync, [$1], $3)"
foreign import javascript unsafe "(($1,$2,$3) => { return h$makeCallbackApply($2, h$runSync, [$1], $3); })"
js_syncCallbackApply :: Bool -> Int -> Exts.Any -> IO (Callback b)
foreign import javascript unsafe "h$makeCallbackApply($1, h$run, [], $2)"
foreign import javascript unsafe "(($1,$2) => { return h$makeCallbackApply($1, h$run, [], $2); })"
js_asyncCallbackApply :: Int -> Exts.Any -> IO (Callback b)
foreign import javascript unsafe
"h$makeCallbackApply($1, h$runSyncReturn, [false], $2)"
"(($1,$2) => { return h$makeCallbackApply($1, h$runSyncReturn, [false], $2); })"
js_syncCallbackApplyReturn :: Int -> Exts.Any -> IO (Callback b)

foreign import javascript unsafe "h$release"
Expand Down

0 comments on commit 632ff5a

Please sign in to comment.