1 // -*- c-basic-offset: 2 -*-
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef ERROR_OBJECT_H_
23 #define ERROR_OBJECT_H_
25 #include "function_object.h"
29 class ErrorInstance
: public JSObject
{
31 ErrorInstance(JSObject
*proto
);
33 virtual const ClassInfo
*classInfo() const { return &info
; }
34 static const ClassInfo info
;
37 class ErrorPrototype
: public JSObject
{
39 ErrorPrototype(ExecState
*exec
,
40 ObjectPrototype
*objectProto
,
41 FunctionPrototype
*funcProto
);
44 class ErrorProtoFunc
: public InternalFunctionImp
{
46 ErrorProtoFunc(ExecState
*, FunctionPrototype
*, const Identifier
&);
47 virtual JSValue
*callAsFunction(ExecState
*exec
, JSObject
*thisObj
, const List
&args
);
50 class ErrorObjectImp
: public InternalFunctionImp
{
52 ErrorObjectImp(ExecState
*exec
, FunctionPrototype
*funcProto
,
53 ErrorPrototype
*errorProto
);
55 virtual bool implementsConstruct() const;
56 virtual JSObject
*construct(ExecState
*exec
, const List
&args
);
58 virtual JSValue
*callAsFunction(ExecState
*exec
, JSObject
*thisObj
, const List
&args
);
61 class NativeErrorPrototype
: public JSObject
{
63 NativeErrorPrototype(ExecState
*exec
, ErrorPrototype
*errorProto
,
64 ErrorType et
, UString name
, UString message
);
69 class NativeErrorImp
: public InternalFunctionImp
{
71 NativeErrorImp(ExecState
*exec
, FunctionPrototype
*funcProto
,
74 virtual bool implementsConstruct() const;
75 virtual JSObject
*construct(ExecState
*exec
, const List
&args
);
76 virtual JSValue
*callAsFunction(ExecState
*exec
, JSObject
*thisObj
, const List
&args
);
80 virtual const ClassInfo
*classInfo() const { return &info
; }
81 static const ClassInfo info
;