C# Class Jurassic.Library.PropertyDescriptor

Represents either a named data property, or a named accessor property.
显示文件 Open project: paulbartrum/jurassic Class Usage Examples

Public Methods

Method Description
FromObject ( ObjectInstance obj, PropertyDescriptor defaults ) : PropertyDescriptor

Creates a property descriptor from an object containing any of the following properties: configurable, writable, enumerable, value, get, set.

PropertyDescriptor ( FunctionInstance getter, FunctionInstance setter, PropertyAttributes attributes ) : System

Creates a new PropertyDescriptor instance with a getter function and, optionally, a setter function.

PropertyDescriptor ( object value, PropertyAttributes attributes ) : System

Creates a new PropertyDescriptor instance.

ToObject ( ScriptEngine engine ) : ObjectInstance

Populates an object with the following properties: configurable, writable, enumerable, value, get, set.

ToString ( ) : string

Gets the property value, calling the get accessor, if present.

Returns a string representing the current object.

Method Details

FromObject() public static method

Creates a property descriptor from an object containing any of the following properties: configurable, writable, enumerable, value, get, set.
public static FromObject ( ObjectInstance obj, PropertyDescriptor defaults ) : PropertyDescriptor
obj ObjectInstance The object to get the property values from.
defaults PropertyDescriptor The values to use if the relevant value is not specified.
return PropertyDescriptor

PropertyDescriptor() public method

Creates a new PropertyDescriptor instance with a getter function and, optionally, a setter function.
public PropertyDescriptor ( FunctionInstance getter, FunctionInstance setter, PropertyAttributes attributes ) : System
getter FunctionInstance The function to call to retrieve the property value.
setter FunctionInstance The function to call to set the property value.
attributes PropertyAttributes The property attributes (whether the property is writable or /// not is implied by whether there is a setter function).
return System

PropertyDescriptor() public method

Creates a new PropertyDescriptor instance.
public PropertyDescriptor ( object value, PropertyAttributes attributes ) : System
value object The initial value for the property.
attributes PropertyAttributes The property attributes.
return System

ToObject() public method

Populates an object with the following properties: configurable, writable, enumerable, value, get, set.
public ToObject ( ScriptEngine engine ) : ObjectInstance
engine ScriptEngine The script engine used to create a new object.
return ObjectInstance

ToString() public method

Gets the property value, calling the get accessor, if present. Returns a string representing the current object.
public ToString ( ) : string
return string