#ifndef _ARRAY_OBJECT_H_
#define _ARRAY_OBJECT_H_
#include "internal.h"
#include "function_object.h"
namespace KJS {
class ArrayPrototypeImp : public ArrayInstanceImp {
public:
ArrayPrototypeImp(ExecState *exec,
ObjectPrototypeImp *objProto);
Value get(ExecState *exec, const Identifier &p) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
class ArrayProtoFuncImp : public InternalFunctionImp {
public:
ArrayProtoFuncImp(ExecState *exec, int i, int len);
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
enum { ToString, ToLocaleString, Concat, Join, Pop, Push,
Reverse, Shift, Slice, Sort, Splice, UnShift };
private:
int id;
};
class ArrayObjectImp : public InternalFunctionImp {
public:
ArrayObjectImp(ExecState *exec,
FunctionPrototypeImp *funcProto,
ArrayPrototypeImp *arrayProto);
virtual bool implementsConstruct() const;
virtual Object construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
};
};
#endif