Safe Haskell | None |
---|
JSC monad keeps track of the JavaScript context
- type JSC = ReaderT JSContextRef IO
- type JSContextRef = Ptr OpaqueJSContext
- catchval :: (JSValueRefRef -> JSC a) -> (JSValueRef -> JSC a) -> JSC a
- catch :: (MonadIO m, Exception e) => ReaderT r IO b -> (e -> ReaderT r IO b) -> ReaderT r m b
Types
type JSC = ReaderT JSContextRef IO
The JSC
monad keeps track of the JavaScript context.
Given a JSC
function and a JSContextRef
you can run the
function like this...
runReaderT jscFunction javaScriptContext
For an example of how to set up WebKitGTK+ see tests/TestJSC.hs
type JSContextRef = Ptr OpaqueJSContext
Exception Handling
catchval :: (JSValueRefRef -> JSC a) -> (JSValueRef -> JSC a) -> JSC a
Handle JavaScriptCore functions that take a JSValueRefRef in order to throw exceptions.