#ifndef RUNTIME_ARRAY_H_
#define RUNTIME_ARRAY_H_
#include "Bridge.h"
#include <runtime/ArrayPrototype.h>
namespace JSC {
class RuntimeArray : public JSArray {
public:
RuntimeArray(ExecState*, Bindings::Array*);
virtual ~RuntimeArray();
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void put(ExecState*, unsigned propertyName, JSValue);
virtual bool deleteProperty(ExecState* exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState* exec, unsigned propertyName);
virtual const ClassInfo* classInfo() const { return &s_info; }
unsigned getLength() const { return getConcreteArray()->getLength(); }
Bindings::Array* getConcreteArray() const { return static_cast<Bindings::Array*>(subclassData()); }
static const ClassInfo s_info;
static ArrayPrototype* createPrototype(ExecState*, JSGlobalObject* globalObject)
{
return globalObject->arrayPrototype();
}
private:
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
static JSValue indexGetter(ExecState*, JSValue, unsigned);
};
}
#endif // RUNTIME_ARRAY_H_