1/*
2    This file is part of the WebKit open source project.
3    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public License
16    along with this library; see the file COPYING.LIB.  If not, write to
17    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18    Boston, MA 02110-1301, USA.
19*/
20
21#ifndef JSTestException_h
22#define JSTestException_h
23
24#include "JSDOMWrapper.h"
25#include "TestException.h"
26#include <runtime/ErrorPrototype.h>
27
28namespace WebCore {
29
30class JSTestException : public JSDOMWrapper {
31public:
32    typedef JSDOMWrapper Base;
33    static JSTestException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestException> impl)
34    {
35        JSTestException* ptr = new (NotNull, JSC::allocateCell<JSTestException>(globalObject->vm().heap)) JSTestException(structure, globalObject, impl);
36        ptr->finishCreation(globalObject->vm());
37        return ptr;
38    }
39
40    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
41    static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
42    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
43    static void destroy(JSC::JSCell*);
44    ~JSTestException();
45
46    DECLARE_INFO;
47
48    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
49    {
50        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
51    }
52
53    static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
54    TestException& impl() const { return *m_impl; }
55    void releaseImpl() { m_impl->deref(); m_impl = 0; }
56
57    void releaseImplIfNotNull()
58    {
59        if (m_impl) {
60            m_impl->deref();
61            m_impl = 0;
62        }
63    }
64
65private:
66    TestException* m_impl;
67protected:
68    JSTestException(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestException>);
69
70    void finishCreation(JSC::VM& vm)
71    {
72        Base::finishCreation(vm);
73        ASSERT(inherits(info()));
74    }
75
76    static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
77};
78
79class JSTestExceptionOwner : public JSC::WeakHandleOwner {
80public:
81    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
82    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
83};
84
85inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestException*)
86{
87    DEPRECATED_DEFINE_STATIC_LOCAL(JSTestExceptionOwner, jsTestExceptionOwner, ());
88    return &jsTestExceptionOwner;
89}
90
91inline void* wrapperContext(DOMWrapperWorld& world, TestException*)
92{
93    return &world;
94}
95
96JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException*);
97TestException* toTestException(JSC::JSValue);
98
99
100} // namespace WebCore
101
102#endif
103