jsc-0.1.0.0: High level interface for webkit-javascriptcore

Safe HaskellNone

Language.Javascript.JSC.Properties

Contents

Description

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

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

Synopsis

Propery Reference

data JSPropRef

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 CUInt

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

Anything that can be used to make a JavaScript property reference

Methods

makePropRef :: this -> JSC JSPropRef

Instances

MakePropRef JSPropRef

If we already have a JSPropRef we are fine

MakePropRef prop => MakePropRef (JSC prop)

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

Getting Property Values

objGetPropertyByName

Arguments

:: MakeStringRef name 
=> JSObjectRef

object to find the property on.

-> name

name of the property.

-> JSValueRefRef

exception if one is raised.

-> JSC JSValueRef

returns the property value.

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

objGetPropertyAtIndex

Arguments

:: JSObjectRef

object to find the property on.

-> CUInt

index of the property.

-> JSValueRefRef

exception if one is raised.

-> JSC JSValueRef

returns the property value.

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

objGetProperty

Arguments

:: JSPropRef

property reference.

-> JSC JSValueRef

returns the property value.

Gets the value of a property given a JSPropRef.

objGetProperty'

Arguments

:: JSPropRef

property reference.

-> JSC (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

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.

-> JSC () 

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

objSetPropertyAtIndex

Arguments

:: MakeValueRef val 
=> JSObjectRef

object to find property on.

-> CUInt

index of the property.

-> val

new value to set the property to.

-> JSValueRefRef

exception if one is raised.

-> JSC () 

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

objSetProperty

Arguments

:: MakeValueRef val 
=> JSPropRef

property reference.

-> val

new value to set the property to.

-> JSC () 

Sets the value of a property given a JSPropRef.