|
|
Javascript Array class, implements arrays of items
| JsArray (GenObject* context, Mutex* mtx = 0)
| JsArray |
Constructor for an empty array with prototype
Parameters:
| context | Script context from which Array prototype is obtainend |
| mtx | Pointer to the mutex that serializes this object |
| inline JsArray (Mutex* mtx, const char* name, bool frozen = false)
| JsArray |
Constructor for an empty array
Parameters:
| mtx | Pointer to the mutex that serializes this object |
| name | Full name of the object |
| frozen | True if the object is to be frozen from creation |
| inline int32_t length ()
| length |
[const]
Retrieve the length of the array
Returns: Number of numerically indexed objects in array
| inline void setLength (int32_t len)
| setLength |
Set the internal length to a specific value
Parameters:
| len | Length of array to set |
| void push (ExpOperation* item)
| push |
Add an item at the end of the array
Parameters:
| item | Item to add to array |
| JsObject* copy (Mutex* mtx)
| copy |
[const virtual]
Deep copy method
Parameters:
| mtx | Pointer to the mutex that serializes the copied array |
Returns: New object instance, does not keep references to old array
Reimplemented from JsObject.
| bool runAssign (ObjList& stack, const ExpOperation& oper, GenObject* context)
| runAssign |
[virtual]
Try to assign a value to a single field if object is not frozen and update array length. Reimplemented from JsObject
Parameters:
| stack | Evaluation stack in use |
| oper | Field to assign to, contains the field name and new value |
| context | Pointer to arbitrary object passed from evaluation methods |
Returns: True if assignment succeeded
Reimplemented from JsObject.
| bool runField (ObjList& stack, const ExpOperation& oper, GenObject* context)
| runField |
[virtual]
Try to evaluate a single field
Parameters:
| stack | Evaluation stack in use, field value must be pushed on it |
| oper | Field to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
Returns: True if evaluation succeeded
Reimplemented from JsObject.
| void initConstructor (JsFunction* construct)
| initConstructor |
[virtual]
Array constructor initialization
Parameters:
| construct | The Array function |
Reimplemented from JsObject.
| JsObject* runConstructor (ObjList& stack, const ExpOperation& oper, GenObject* context)
| runConstructor |
[virtual]
Array object constructor, it's run on the prototype
Parameters:
| stack | Evaluation stack in use |
| oper | Constructor function to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
Returns: New created and populated Javascript Array object
Reimplemented from JsObject.
| JsObject* clone (const char* name)
| clone |
[protected const virtual]
Clone and rename method
Parameters:
| name | Name of the cloned object |
Returns: New object instance
Reimplemented from JsObject.
| bool runNative (ObjList& stack, const ExpOperation& oper, GenObject* context)
| runNative |
[protected]
Try to evaluate a single native method
Parameters:
| stack | Evaluation stack in use, parameters are popped off this stack and results are pushed back on stack |
| oper | Function to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
Returns: True if evaluation succeeded
Reimplemented from JsObject.
| Generated by: paulc on bussard on Thu Jul 24 18:41:02 2014, using kdoc 2.0a54. |