#ifndef ERROR_OBJECT_H_
#define ERROR_OBJECT_H_
#include "function_object.h"
namespace KJS {
class ErrorInstance : public JSObject {
public:
ErrorInstance(JSObject* prototype);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
class ErrorPrototype : public ErrorInstance {
public:
ErrorPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
};
JSValue* errorProtoFuncToString(ExecState*, JSObject*, const List&);
class ErrorObjectImp : public InternalFunctionImp {
public:
ErrorObjectImp(ExecState*, FunctionPrototype*, ErrorPrototype*);
virtual bool implementsConstruct() const;
virtual JSObject* construct(ExecState*, const List&);
virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
};
class NativeErrorPrototype : public JSObject {
public:
NativeErrorPrototype(ExecState*, ErrorPrototype*, const UString& name, const UString& message);
};
class NativeErrorImp : public InternalFunctionImp {
public:
NativeErrorImp(ExecState*, FunctionPrototype*, NativeErrorPrototype*);
virtual bool implementsConstruct() const;
virtual JSObject* construct(ExecState*, const List&);
virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
virtual void mark();
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
private:
JSObject* proto;
};
}
#endif // ERROR_OBJECT_H_