#ifndef _NUMBER_OBJECT_H_
#define _NUMBER_OBJECT_H_
#include "internal.h"
#include "function_object.h"
namespace KJS {
class NumberInstanceImp : public ObjectImp {
public:
NumberInstanceImp(ObjectImp *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
class NumberPrototypeImp : public NumberInstanceImp {
public:
NumberPrototypeImp(ExecState *exec,
ObjectPrototypeImp *objProto,
FunctionPrototypeImp *funcProto);
};
class NumberProtoFuncImp : public InternalFunctionImp {
public:
NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
int i, int len);
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
enum { ToString, ToLocaleString, ValueOf, ToFixed, ToExponential, ToPrecision };
private:
int id;
};
class NumberObjectImp : public InternalFunctionImp {
public:
NumberObjectImp(ExecState *exec,
FunctionPrototypeImp *funcProto,
NumberPrototypeImp *numberProto);
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);
Value get(ExecState *exec, const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
Completion execute(const List &);
Object construct(const List &);
};
};
#endif