C# 클래스 Jurassic.Library.ObjectInstance

상속: System.Runtime.Serialization.IDeserializationCallback
파일 보기 프로젝트 열기: paulbartrum/jurassic 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddProperty bool
CreateRawObject ObjectInstance
CreateRootObject ObjectInstance
FastSetProperties void
FastSetProperty void
GetDeclarativeProperties List
GetNamedPropertyValue object
GetPrimitiveValue object
GetPrimitiveValuePreES6 object
GetPropertyValue object
HasOwnProperty bool
InitializePrototypeProperties void
IsPrototypeOf bool
PropertyIsEnumerable bool
ToLocaleString string
ToStringJS string
ValueOf ObjectInstance
__STUB__HasOwnProperty object
__STUB__IsPrototypeOf object
__STUB__PropertyIsEnumerable object
__STUB__ToLocaleString object
__STUB__ToStringJS object
__STUB__ValueOf object

공개 메소드들

메소드 설명
CallMemberFunction ( string functionName ) : object

Calls the function with the given name. The function must exist on this object or an exception will be thrown.

DefineProperty ( object key, PropertyDescriptor descriptor, bool throwOnError ) : bool

Defines or redefines the value and attributes of a property. The prototype chain is not searched so if the property exists but only in the prototype chain a new property will be created.

Delete ( object key, bool throwOnError ) : bool

Deletes the property with the given name.

Delete ( uint index, bool throwOnError ) : bool

Deletes the property with the given array index.

GetOwnPropertyDescriptor ( object key ) : PropertyDescriptor

Gets a descriptor for the property with the given name.

The prototype chain is not searched.

GetOwnPropertyDescriptor ( uint index ) : PropertyDescriptor

Gets a descriptor for the property with the given array index.

The prototype chain is not searched.

GetPropertyValue ( object key ) : object

Gets the value of the property with the given name.

The prototype chain is searched if the property does not exist directly on this object.

GetPropertyValue ( uint index ) : object

Gets the value of the property with the given array index.

The prototype chain is searched if the property does not exist directly on this object.

HasProperty ( object key ) : bool

Determines if a property with the given name exists.

InlineGetPropertyValue ( string name, int &cachedIndex, object &cacheKey ) : object

Gets the value of the given property plus the information needed to speed up access to the property in future.

InlineSetPropertyValue ( string name, object value, bool throwOnError, int &cachedIndex, object &cacheKey ) : void

Sets the value of the given property plus retrieves the information needed to speed up access to the property in future. If a property with the given name does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.

InlineSetPropertyValueIfExists ( string name, object value, bool throwOnError, int &cachedIndex, object &cacheKey ) : bool

Sets the value of the given property plus retrieves the information needed to speed up access to the property in future. If a property with the given name exists, but only in the prototype chain, then a new property is created (unless the property is a setter, in which case the setter is called and no property is created). If the property does not exist at all, then no property is created and the method returns false.

SetPropertyValue ( object key, object value, bool throwOnError ) : void

Sets the value of the property with the given name. If a property with the given name does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.

SetPropertyValue ( uint index, object value, bool throwOnError ) : void

Sets the value of the property with the given array index. If a property with the given index does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.

SetPropertyValueIfExists ( object key, object value, bool throwOnError ) : bool

Sets the value of the given property. If a property with the given name exists, but only in the prototype chain, then a new property is created (unless the property is a setter, in which case the setter is called and no property is created). If the property does not exist at all, then no property is created and the method returns false. This method is used to set the value of a variable reference within a with statement.

ToString ( ) : string

Returns a string representing this object.

TryCallMemberFunction ( object &result, object key ) : bool

Calls the function with the given name.

this ( int index ) : object

Gets or sets the value of an array-indexed property.

this ( object key ) : object

Gets or sets the value of a named property.

this ( uint index ) : object

Gets or sets the value of an array-indexed property.

보호된 메소드들

메소드 설명
GetMissingPropertyValue ( object key ) : object

Retrieves the value of a property which doesn't exist on the object. This method can be overridden to effectively construct properties on the fly. The default behavior is to return undefined.

When overriding, call the base class implementation only if you want to revert to the default behavior.

ObjectInstance ( ObjectInstance prototype ) : System

Called by derived classes to create a new object instance.

ObjectInstance ( ScriptEngine engine ) : System

Creates an Object with the default prototype.

ObjectInstance ( ScriptEngine engine, ObjectInstance prototype ) : System

Called by derived classes to create a new object instance.

PopulateFields ( ) : void

Populates the object with properties by searching a .NET type for fields marked with the [JSField] attribute. Should be called only once at startup.

PopulateFields ( Type type ) : void

Populates the object with properties by searching a .NET type for fields marked with the [JSField] attribute. Should be called only once at startup.

PopulateFunctions ( ) : void

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.

PopulateFunctions ( Type type ) : void

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.

PopulateFunctions ( Type type, BindingFlags bindingFlags ) : void

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.

비공개 메소드들

메소드 설명
AddProperty ( object key, object value, PropertyAttributes attributes, bool throwOnError ) : bool

Adds a property to this object. The property must not already exist.

CreateRawObject ( ObjectInstance prototype ) : ObjectInstance

Creates an Object instance (use ObjectConstructor.Construct rather than this).

CreateRootObject ( ScriptEngine engine ) : ObjectInstance

Creates an Object with no prototype to serve as the base prototype of all objects.

FastSetProperties ( IEnumerable properties ) : void

Sets up multiple properties at once.

FastSetProperty ( object key, object value, PropertyAttributes attributes = PropertyAttributes.Sealed, bool overwriteAttributes = false ) : void

Sets a property value and attributes, or adds a new property if it doesn't already exist. Any existing attributes are ignored (and not modified).

GetDeclarativeProperties ( ScriptEngine engine ) : List
GetNamedPropertyValue ( object key, ObjectInstance thisValue ) : object

Gets the value of the property with the given name. The name cannot be an array index.

The prototype chain is searched if the property does not exist directly on this object.

GetPrimitiveValue ( PrimitiveTypeHint typeHint ) : object

Returns a primitive value that represents the current object. Used by the addition and equality operators.

GetPrimitiveValuePreES6 ( PrimitiveTypeHint typeHint ) : object

Returns a primitive value that represents the current object, without using the @@toPrimitive symbol.

GetPropertyValue ( uint index, ObjectInstance thisValue ) : object

Gets the value of the property with the given array index.

The prototype chain is searched if the property does not exist directly on this object.

HasOwnProperty ( ScriptEngine engine, object thisObject, object key ) : bool
InitializePrototypeProperties ( ObjectInstance obj, ObjectConstructor constructor ) : void

Initializes the prototype properties.

IsPrototypeOf ( ScriptEngine engine, object thisObject, object obj ) : bool
PropertyIsEnumerable ( ScriptEngine engine, object thisObject, object key ) : bool
ToLocaleString ( ) : string
ToStringJS ( ScriptEngine engine, object thisObject ) : string
ValueOf ( ) : ObjectInstance
__STUB__HasOwnProperty ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__IsPrototypeOf ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__PropertyIsEnumerable ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToLocaleString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToStringJS ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ValueOf ( ScriptEngine engine, object thisObj, object args ) : object

메소드 상세

CallMemberFunction() 공개 메소드

Calls the function with the given name. The function must exist on this object or an exception will be thrown.
public CallMemberFunction ( string functionName ) : object
functionName string The name of the function to call.
리턴 object

DefineProperty() 공개 메소드

Defines or redefines the value and attributes of a property. The prototype chain is not searched so if the property exists but only in the prototype chain a new property will be created.
public DefineProperty ( object key, PropertyDescriptor descriptor, bool throwOnError ) : bool
key object The property key of the property to modify.
descriptor PropertyDescriptor The property value and attributes.
throwOnError bool true to throw an exception if the property could not /// be set. This can happen if the property is not configurable or the object is sealed.
리턴 bool

Delete() 공개 메소드

Deletes the property with the given name.
public Delete ( object key, bool throwOnError ) : bool
key object The property key of the property to delete.
throwOnError bool true to throw an exception if the property could not /// be set because the property was marked as non-configurable.
리턴 bool

Delete() 공개 메소드

Deletes the property with the given array index.
public Delete ( uint index, bool throwOnError ) : bool
index uint The array index of the property to delete.
throwOnError bool true to throw an exception if the property could not /// be set because the property was marked as non-configurable.
리턴 bool

GetMissingPropertyValue() 보호된 메소드

Retrieves the value of a property which doesn't exist on the object. This method can be overridden to effectively construct properties on the fly. The default behavior is to return undefined.
When overriding, call the base class implementation only if you want to revert to the default behavior.
protected GetMissingPropertyValue ( object key ) : object
key object The property key of the missing property.
리턴 object

GetOwnPropertyDescriptor() 공개 메소드

Gets a descriptor for the property with the given name.
The prototype chain is not searched.
public GetOwnPropertyDescriptor ( object key ) : PropertyDescriptor
key object The property key (either a string or a Symbol).
리턴 PropertyDescriptor

GetOwnPropertyDescriptor() 공개 메소드

Gets a descriptor for the property with the given array index.
The prototype chain is not searched.
public GetOwnPropertyDescriptor ( uint index ) : PropertyDescriptor
index uint The array index of the property.
리턴 PropertyDescriptor

GetPropertyValue() 공개 메소드

Gets the value of the property with the given name.
The prototype chain is searched if the property does not exist directly on this object.
public GetPropertyValue ( object key ) : object
key object The property key (either a string or a Symbol).
리턴 object

GetPropertyValue() 공개 메소드

Gets the value of the property with the given array index.
The prototype chain is searched if the property does not exist directly on this object.
public GetPropertyValue ( uint index ) : object
index uint The array index of the property.
리턴 object

HasProperty() 공개 메소드

Determines if a property with the given name exists.
public HasProperty ( object key ) : bool
key object The property key (either a string or a Symbol).
리턴 bool

InlineGetPropertyValue() 공개 메소드

Gets the value of the given property plus the information needed to speed up access to the property in future.
public InlineGetPropertyValue ( string name, int &cachedIndex, object &cacheKey ) : object
name string The name of the property.
cachedIndex int Set to a zero-based index that can be used to get or set the /// property value in future (provided the cache key doesn't change).
cacheKey object Set to a value that can be compared with the CacheKey property /// to determine if the cached index needs to be refreshed. Can be set to null to /// prohibit caching.
리턴 object

InlineSetPropertyValue() 공개 메소드

Sets the value of the given property plus retrieves the information needed to speed up access to the property in future. If a property with the given name does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.
public InlineSetPropertyValue ( string name, object value, bool throwOnError, int &cachedIndex, object &cacheKey ) : void
name string The name of the property to set.
value object The desired value of the property.
throwOnError bool true to throw an exception if the property could not /// be set (i.e. if the property is read-only or if the object is not extensible and a new /// property needs to be created).
cachedIndex int Set to a zero-based index that can be used to get or set the /// property value in future (provided the cache key doesn't change).
cacheKey object Set to a value that can be compared with the CacheKey property /// to determine if the cached index needs to be refreshed. Can be set to null to /// prohibit caching.
리턴 void

InlineSetPropertyValueIfExists() 공개 메소드

Sets the value of the given property plus retrieves the information needed to speed up access to the property in future. If a property with the given name exists, but only in the prototype chain, then a new property is created (unless the property is a setter, in which case the setter is called and no property is created). If the property does not exist at all, then no property is created and the method returns false.
public InlineSetPropertyValueIfExists ( string name, object value, bool throwOnError, int &cachedIndex, object &cacheKey ) : bool
name string The name of the property to set.
value object The desired value of the property. This must be a javascript /// primitive (double, string, etc) or a class derived from .
throwOnError bool true to throw an exception if the property could not /// be set (i.e. if the property is read-only or if the object is not extensible and a new /// property needs to be created).
cachedIndex int Set to a zero-based index that can be used to get or set the /// property value in future (provided the cache key doesn't change).
cacheKey object Set to a value that can be compared with the CacheKey property /// to determine if the cached index needs to be refreshed. Can be set to null to /// prohibit caching.
리턴 bool

ObjectInstance() 보호된 메소드

Called by derived classes to create a new object instance.
protected ObjectInstance ( ObjectInstance prototype ) : System
prototype ObjectInstance The next object in the prototype chain. Cannot be null.
리턴 System

ObjectInstance() 보호된 메소드

Creates an Object with the default prototype.
protected ObjectInstance ( ScriptEngine engine ) : System
engine ScriptEngine The script engine associated with this object.
리턴 System

ObjectInstance() 보호된 메소드

Called by derived classes to create a new object instance.
protected ObjectInstance ( ScriptEngine engine, ObjectInstance prototype ) : System
engine ScriptEngine The script engine associated with this object.
prototype ObjectInstance The next object in the prototype chain. Can be null.
리턴 System

PopulateFields() 보호된 메소드

Populates the object with properties by searching a .NET type for fields marked with the [JSField] attribute. Should be called only once at startup.
protected PopulateFields ( ) : void
리턴 void

PopulateFields() 보호된 메소드

Populates the object with properties by searching a .NET type for fields marked with the [JSField] attribute. Should be called only once at startup.
protected PopulateFields ( Type type ) : void
type System.Type The type to search for fields.
리턴 void

PopulateFunctions() 보호된 메소드

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.
protected PopulateFunctions ( ) : void
리턴 void

PopulateFunctions() 보호된 메소드

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.
protected PopulateFunctions ( Type type ) : void
type System.Type The type to search for methods.
리턴 void

PopulateFunctions() 보호된 메소드

Populates the object with functions by searching a .NET type for methods marked with the [JSFunction] attribute. Should be called only once at startup. Also automatically populates properties marked with the [JSProperty] attribute.
protected PopulateFunctions ( Type type, BindingFlags bindingFlags ) : void
type System.Type The type to search for methods.
bindingFlags BindingFlags The binding flags to use to search for properties and methods.
리턴 void

SetPropertyValue() 공개 메소드

Sets the value of the property with the given name. If a property with the given name does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.
public SetPropertyValue ( object key, object value, bool throwOnError ) : void
key object The property key of the property to set.
value object The value to set the property to. This must be a javascript /// primitive (double, string, etc) or a class derived from .
throwOnError bool true to throw an exception if the property could not /// be set (i.e. if the property is read-only or if the object is not extensible and a new /// property needs to be created).
리턴 void

SetPropertyValue() 공개 메소드

Sets the value of the property with the given array index. If a property with the given index does not exist, or exists in the prototype chain (and is not a setter) then a new property is created.
public SetPropertyValue ( uint index, object value, bool throwOnError ) : void
index uint The array index of the property to set.
value object The value to set the property to. This must be a javascript /// primitive (double, string, etc) or a class derived from .
throwOnError bool true to throw an exception if the property could not /// be set. This can happen if the property is read-only or if the object is sealed.
리턴 void

SetPropertyValueIfExists() 공개 메소드

Sets the value of the given property. If a property with the given name exists, but only in the prototype chain, then a new property is created (unless the property is a setter, in which case the setter is called and no property is created). If the property does not exist at all, then no property is created and the method returns false. This method is used to set the value of a variable reference within a with statement.
public SetPropertyValueIfExists ( object key, object value, bool throwOnError ) : bool
key object The property key (either a string or a Symbol). Cannot be an array index.
value object The desired value of the property. This must be a javascript /// primitive (double, string, etc) or a class derived from .
throwOnError bool true to throw an exception if the property could not /// be set (i.e. if the property is read-only or if the object is not extensible and a new /// property needs to be created).
리턴 bool

ToString() 공개 메소드

Returns a string representing this object.
public ToString ( ) : string
리턴 string

TryCallMemberFunction() 공개 메소드

Calls the function with the given name.
public TryCallMemberFunction ( object &result, object key ) : bool
result object The result of calling the function.
key object The name or symbol of the function to call.
리턴 bool

this() 공개 메소드

Gets or sets the value of an array-indexed property.
public this ( int index ) : object
index int The index of the property to retrieve.
리턴 object

this() 공개 메소드

Gets or sets the value of a named property.
public this ( object key ) : object
key object The property key (either a string or a Symbol).
리턴 object

this() 공개 메소드

Gets or sets the value of an array-indexed property.
public this ( uint index ) : object
index uint The index of the property to retrieve.
리턴 object