#ifndef NUMBER_OBJECT_H_
#define NUMBER_OBJECT_H_
#include "function_object.h"
namespace KJS {
class NumberInstance : public JSObject {
public:
NumberInstance(JSObject *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
class NumberPrototype : public NumberInstance {
public:
NumberPrototype(ExecState *exec,
ObjectPrototype *objProto,
FunctionPrototype *funcProto);
};
class NumberProtoFunc : public InternalFunctionImp {
public:
NumberProtoFunc(ExecState*, FunctionPrototype*, int i, int len, const Identifier&);
virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, ToLocaleString, ValueOf, ToFixed, ToExponential, ToPrecision };
private:
int id;
};
class NumberObjectImp : public InternalFunctionImp {
public:
NumberObjectImp(ExecState *exec,
FunctionPrototype *funcProto,
NumberPrototype *numberProto);
virtual bool implementsConstruct() const;
virtual JSObject *construct(ExecState *exec, const List &args);
virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
JSValue *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 &);
JSObject *construct(const List &);
};
}
#endif