{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE BangPatterns #-}
module GHCJS.Types ( JSVal
, WouldBlockException(..)
, JSException(..)
, IsJSVal
, jsval
, isNull
, isUndefined
, nullRef
, JSString
, mkRef
, Ref#
, JSRef
) where
import Data.JSString.Internal.Type (JSString)
import GHCJS.Internal.Types
import GHCJS.Prim
import GHC.Int
import GHC.Types
import GHC.Prim
import GHC.Ptr
import GHC.IORef
import GHC.IO.Unsafe (unsafePerformIO)
import Control.DeepSeq
import Unsafe.Coerce
type Ref# = IORef Int64
mkRef :: Ref# -> JSVal
mkRef :: Ref# -> JSVal
mkRef = Ref# -> JSVal
JSVal
{-# INLINE mkRef #-}
nullRef :: JSVal
nullRef :: JSVal
nullRef = Ref# -> JSVal
JSVal (Ref# -> JSVal) -> (IO Ref# -> Ref#) -> IO Ref# -> JSVal
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO Ref# -> Ref#
forall a. IO a -> a
unsafePerformIO (IO Ref# -> JSVal) -> IO Ref# -> JSVal
forall a b. (a -> b) -> a -> b
$ JSValueRef -> IO Ref#
forall a. a -> IO (IORef a)
newIORef JSValueRef
0
{-# NOINLINE nullRef #-}
type JSRef a = JSVal
{-# DEPRECATED JSRef "Use JSVal instead, or a more specific newtype wrapper of JSVal " #-}