jsaddle-0.2.0.4: High level interface for webkit-javascriptcore

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

Propery Reference

data JSPropRef Source

A reference to a property. Implemented as a reference to an object and something to find the property.

Constructors

JSPropRef JSObjectRef JSStringRef

Object and property name.

JSPropIndexRef JSObjectRef Index

Object and property index.

Instances

MakePropRef JSPropRef

If we already have a JSPropRef we are fine

MakeObjectRef JSPropRef

We can use a property as an object.

MakeArgRefs JSPropRef

We can pass a property as the only paramter to a function.

MakeValueRef JSPropRef

We can use a property as a value.

class MakePropRef this where Source

Anything that can be used to make a JavaScript property reference

Methods

makePropRef :: this -> JSM JSPropRef Source

Instances

MakePropRef JSPropRef

If we already have a JSPropRef we are fine

MakePropRef prop => MakePropRef (JSM prop)

JSPropRef can be made by evaluating a function in JSM as long as it returns something we can make into a JSPropRef.

Getting Property Values

objGetPropertyByName Source

Arguments

:: MakeStringRef name 
=> JSObjectRef

object to find the property on.

-> name

name of the property.

-> JSValueRefRef

exception if one is raised.

-> JSM JSValueRef

returns the property value.

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

objGetPropertyAtIndex Source

Arguments

:: JSObjectRef

object to find the property on.

-> Index

index of the property.

-> JSValueRefRef

exception if one is raised.

-> JSM JSValueRef

returns the property value.

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

objGetProperty Source

Arguments

:: JSPropRef

property reference.

-> JSM JSValueRef

returns the property value.

Gets the value of a property given a JSPropRef.

objGetProperty' Source

Arguments

:: JSPropRef

property reference.

-> JSM (JSObjectRef, JSValueRef)

returns the object and property value.

This version of objGetProperty is handy when you also need to perform. another operation on the object the property is on.

Setting Property Values

objSetPropertyByName Source

Arguments

:: (MakeStringRef name, MakeValueRef val) 
=> JSObjectRef

object to set the property on.

-> name

name of the property.

-> val

new value to set the property to.

-> JSPropertyAttributes

property attributes to give the property.

-> JSValueRefRef

exception if one is raised.

-> JSM () 

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

objSetPropertyAtIndex Source

Arguments

:: MakeValueRef val 
=> JSObjectRef

object to find property on.

-> Index

index of the property.

-> val

new value to set the property to.

-> JSValueRefRef

exception if one is raised.

-> JSM () 

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

objSetProperty Source

Arguments

:: MakeValueRef val 
=> JSPropRef

property reference.

-> val

new value to set the property to.

-> JSM () 

Sets the value of a property given a JSPropRef.