jsaddle-0.9.2.0: Interface for JavaScript that works with GHCJS and GHC

Safe HaskellNone
LanguageHaskell2010

Language.Javascript.JSaddle.Properties

Contents

Description

Low level JavaScript object property access. In most cases you should use Language.Javascript.JSaddle.Object instead.

This module is mostly here to implement functions needed to use JSPropRef.

Synopsis

Getting Property Values

getProp :: JSString -> Object -> JSM JSVal Source #

get a property from an object. If accessing the property results in an exception, the exception is converted to a JSException. Since exception handling code prevents some optimizations in some JS engines, you may want to use unsafeGetProp instead

objGetPropertyByName Source #

Arguments

:: ToJSString name 
=> Object

object to find the property on.

-> name

name of the property.

-> JSM JSVal

returns the property value.

Get a property value given the object and the name of the property.

objGetPropertyAtIndex Source #

Arguments

:: Object

object to find the property on.

-> Int

index of the property.

-> JSM JSVal

returns the property value.

Get a property value given the object and the index of the property.

Setting Property Values

objSetPropertyByName Source #

Arguments

:: (ToJSString name, ToJSVal val) 
=> Object

object to set the property on.

-> name

name of the property.

-> val

new value to set the property to.

-> JSM () 

Set a property value given the object and the name of the property.

objSetPropertyAtIndex Source #

Arguments

:: ToJSVal val 
=> Object

object to find property on.

-> Int

index of the property.

-> val

new value to set the property to.

-> JSM () 

Set a property value given the object and the index of the property.