module JavaScript.Object.Internal
( Object(..)
, create
, listProps
, getProp
, unsafeGetProp
, setProp
, unsafeSetProp
) where
import Language.Javascript.JSaddle.Types (JSM, JSVal, Object(..), JSString)
import Language.Javascript.JSaddle.Native.Internal
(newEmptyObject, propertyNames, getPropertyByName, setPropertyByName)
create :: JSM Object
create = newEmptyObject
{-# INLINE create #-}
listProps :: Object -> JSM [JSString]
listProps = propertyNames
{-# INLINE listProps #-}
getProp :: JSString -> Object -> JSM JSVal
getProp = unsafeGetProp
{-# INLINE getProp #-}
unsafeGetProp :: JSString -> Object -> JSM JSVal
unsafeGetProp = getPropertyByName
{-# INLINE unsafeGetProp #-}
setProp :: JSString -> JSVal -> Object -> JSM ()
setProp = unsafeSetProp
{-# INLINE setProp #-}
unsafeSetProp :: JSString -> JSVal -> Object -> JSM ()
unsafeSetProp = setPropertyByName
{-# INLINE unsafeSetProp #-}