KJS
KJS::ArrayInstance Class Reference
#include <array_instance.h>

Detailed Description
Definition at line 30 of file array_instance.h.
Public Member Functions | |
| ArrayInstance (JSObject *proto, unsigned initialLength) | |
| ArrayInstance (JSObject *proto, const List &initialValues) | |
| ~ArrayInstance () | |
| virtual bool | getOwnPropertySlot (ExecState *, const Identifier &, PropertySlot &) |
| virtual bool | getOwnPropertySlot (ExecState *, unsigned, PropertySlot &) |
| virtual void | put (ExecState *exec, const Identifier &propertyName, JSValue *value, int attr=None) |
| virtual void | put (ExecState *exec, unsigned propertyName, JSValue *value, int attr=None) |
| virtual bool | deleteProperty (ExecState *exec, const Identifier &propertyName) |
| virtual bool | deleteProperty (ExecState *exec, unsigned propertyName) |
| virtual void | getPropertyNames (ExecState *, PropertyNameArray &) |
| virtual void | mark () |
| virtual const ClassInfo * | classInfo () const |
| unsigned | getLength () const |
| JSValue * | getItem (unsigned) const |
| void | sort (ExecState *exec) |
| void | sort (ExecState *exec, JSObject *compareFunction) |
Static Public Attributes | |
| static const ClassInfo | info = {"Array", 0, 0, 0} |
Constructor & Destructor Documentation
| ArrayInstance::ArrayInstance | ( | JSObject * | proto, | |
| unsigned | initialLength | |||
| ) |
Definition at line 81 of file array_object.cpp.
Definition at line 89 of file array_object.cpp.
| ArrayInstance::~ArrayInstance | ( | ) |
Definition at line 102 of file array_object.cpp.
Member Function Documentation
| bool ArrayInstance::getOwnPropertySlot | ( | ExecState * | exec, | |
| const Identifier & | propertyName, | |||
| PropertySlot & | slot | |||
| ) | [virtual] |
Reimplemented from KJS::JSObject.
Reimplemented in KJS::ArrayPrototype.
Definition at line 122 of file array_object.cpp.
| bool ArrayInstance::getOwnPropertySlot | ( | ExecState * | exec, | |
| unsigned | index, | |||
| PropertySlot & | slot | |||
| ) | [virtual] |
| void ArrayInstance::put | ( | ExecState * | exec, | |
| const Identifier & | propertyName, | |||
| JSValue * | value, | |||
| int | attr = None | |||
| ) | [virtual] |
Sets the specified property.
See ECMA 8.6.2.2
- Parameters:
-
exec The current execution state propertyName The name of the property to set propertyValue The value to set
Reimplemented from KJS::JSObject.
Definition at line 165 of file array_object.cpp.
| bool ArrayInstance::deleteProperty | ( | ExecState * | exec, | |
| const Identifier & | propertyName | |||
| ) | [virtual] |
Removes the specified property from the object.
See ECMA 8.6.2.5
- Parameters:
-
exec The current execution state propertyName The name of the property to delete
- Returns:
- true if the property was successfully deleted or did not exist on the object. false if deleting the specified property is not allowed.
Reimplemented from KJS::JSObject.
Definition at line 213 of file array_object.cpp.
| void ArrayInstance::getPropertyNames | ( | ExecState * | exec, | |
| PropertyNameArray & | propertyNames | |||
| ) | [virtual] |
| void ArrayInstance::mark | ( | ) | [virtual] |
| virtual const ClassInfo* KJS::ArrayInstance::classInfo | ( | ) | const [inline, virtual] |
A pointer to a ClassInfo struct for this class.
This provides a basic facility for run-time type information, and can be used to check an object's class an inheritance (see inherits()). This should always return a statically declared pointer, or 0 to indicate that there is no class information.
This is primarily useful if you have application-defined classes that you wish to check against for casting purposes.
For example, to specify the class info for classes FooImp and BarImp, where FooImp inherits from BarImp, you would add the following in your class declarations:
class BarImp : public JSObject { virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; // ... }; class FooImp : public JSObject { virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; // ... };
And in your source file:
const ClassInfo BarImp::info = {"Bar", 0, 0, 0}; // no parent class const ClassInfo FooImp::info = {"Foo", &BarImp::info, 0, 0};
- See also:
- inherits()
Reimplemented from KJS::JSObject.
Reimplemented in KJS::ArrayPrototype.
Definition at line 46 of file array_instance.h.
| unsigned KJS::ArrayInstance::getLength | ( | ) | const [inline] |
Definition at line 49 of file array_instance.h.
| JSValue * ArrayInstance::getItem | ( | unsigned | i | ) | const |
Definition at line 107 of file array_object.cpp.
| void ArrayInstance::sort | ( | ExecState * | exec | ) |
Definition at line 336 of file array_object.cpp.
Definition at line 403 of file array_object.cpp.
Member Data Documentation
const ClassInfo ArrayInstance::info = {"Array", 0, 0, 0} [static] |
The documentation for this class was generated from the following files:
KDE 4.0 API Reference