|
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 #include "config.h" |
|
22 |
|
23 #include "JSRangeException.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "RangeException.h" |
|
28 |
|
29 using namespace KJS; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 /* Hash table */ |
|
34 |
|
35 static const HashEntry JSRangeExceptionTableEntries[] = |
|
36 { |
|
37 { "constructor", JSRangeException::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
38 }; |
|
39 |
|
40 static const HashTable JSRangeExceptionTable = |
|
41 { |
|
42 2, 1, JSRangeExceptionTableEntries, 1 |
|
43 }; |
|
44 |
|
45 /* Hash table for constructor */ |
|
46 |
|
47 static const HashEntry JSRangeExceptionConstructorTableEntries[] = |
|
48 { |
|
49 { "BAD_BOUNDARYPOINTS_ERR", RangeException::BAD_BOUNDARYPOINTS_ERR, DontDelete|ReadOnly, 0, 0 }, |
|
50 { "INVALID_NODE_TYPE_ERR", RangeException::INVALID_NODE_TYPE_ERR, DontDelete|ReadOnly, 0, 0 } |
|
51 }; |
|
52 |
|
53 static const HashTable JSRangeExceptionConstructorTable = |
|
54 { |
|
55 2, 2, JSRangeExceptionConstructorTableEntries, 2 |
|
56 }; |
|
57 |
|
58 class JSRangeExceptionConstructor : public DOMObject { |
|
59 public: |
|
60 JSRangeExceptionConstructor(ExecState* exec) |
|
61 { |
|
62 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
63 putDirect(exec->propertyNames().prototype, JSRangeExceptionPrototype::self(exec), None); |
|
64 } |
|
65 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); |
|
66 JSValue* getValueProperty(ExecState*, int token) const; |
|
67 virtual const ClassInfo* classInfo() const { return &info; } |
|
68 static const ClassInfo info; |
|
69 |
|
70 virtual bool implementsHasInstance() const { return true; } |
|
71 }; |
|
72 |
|
73 const ClassInfo JSRangeExceptionConstructor::info = { "RangeExceptionConstructor", 0, &JSRangeExceptionConstructorTable, 0 }; |
|
74 |
|
75 bool JSRangeExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
76 { |
|
77 return getStaticValueSlot<JSRangeExceptionConstructor, DOMObject>(exec, &JSRangeExceptionConstructorTable, this, propertyName, slot); |
|
78 } |
|
79 |
|
80 JSValue* JSRangeExceptionConstructor::getValueProperty(ExecState*, int token) const |
|
81 { |
|
82 // The token is the numeric value of its associated constant |
|
83 return jsNumber(token); |
|
84 } |
|
85 |
|
86 /* Hash table for prototype */ |
|
87 |
|
88 static const HashEntry JSRangeExceptionPrototypeTableEntries[] = |
|
89 { |
|
90 { "BAD_BOUNDARYPOINTS_ERR", RangeException::BAD_BOUNDARYPOINTS_ERR, DontDelete|ReadOnly, 0, 0 }, |
|
91 { "INVALID_NODE_TYPE_ERR", RangeException::INVALID_NODE_TYPE_ERR, DontDelete|ReadOnly, 0, 0 } |
|
92 }; |
|
93 |
|
94 static const HashTable JSRangeExceptionPrototypeTable = |
|
95 { |
|
96 2, 2, JSRangeExceptionPrototypeTableEntries, 2 |
|
97 }; |
|
98 |
|
99 const ClassInfo JSRangeExceptionPrototype::info = { "RangeExceptionPrototype", 0, &JSRangeExceptionPrototypeTable, 0 }; |
|
100 |
|
101 JSObject* JSRangeExceptionPrototype::self(ExecState* exec) |
|
102 { |
|
103 return KJS::cacheGlobalObject<JSRangeExceptionPrototype>(exec, "[[JSRangeException.prototype]]"); |
|
104 } |
|
105 |
|
106 bool JSRangeExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
107 { |
|
108 return getStaticValueSlot<JSRangeExceptionPrototype, JSObject>(exec, &JSRangeExceptionPrototypeTable, this, propertyName, slot); |
|
109 } |
|
110 |
|
111 JSValue* JSRangeExceptionPrototype::getValueProperty(ExecState*, int token) const |
|
112 { |
|
113 // The token is the numeric value of its associated constant |
|
114 return jsNumber(token); |
|
115 } |
|
116 |
|
117 const ClassInfo JSRangeException::info = { "RangeException", 0, &JSRangeExceptionTable, 0 }; |
|
118 |
|
119 JSRangeException::JSRangeException(ExecState* exec, RangeException* impl) |
|
120 : m_impl(impl) |
|
121 { |
|
122 setPrototype(JSRangeExceptionPrototype::self(exec)); |
|
123 } |
|
124 |
|
125 JSRangeException::~JSRangeException() |
|
126 { |
|
127 ScriptInterpreter::forgetDOMObject(m_impl.get()); |
|
128 } |
|
129 |
|
130 bool JSRangeException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
131 { |
|
132 return getStaticValueSlot<JSRangeException, KJS::DOMObject>(exec, &JSRangeExceptionTable, this, propertyName, slot); |
|
133 } |
|
134 |
|
135 JSValue* JSRangeException::getValueProperty(ExecState* exec, int token) const |
|
136 { |
|
137 switch (token) { |
|
138 case ConstructorAttrNum: |
|
139 return getConstructor(exec); |
|
140 } |
|
141 return 0; |
|
142 } |
|
143 |
|
144 JSValue* JSRangeException::getConstructor(ExecState* exec) |
|
145 { |
|
146 return KJS::cacheGlobalObject<JSRangeExceptionConstructor>(exec, "[[RangeException.constructor]]"); |
|
147 } |
|
148 KJS::JSValue* toJS(KJS::ExecState* exec, RangeException* obj) |
|
149 { |
|
150 return KJS::cacheDOMObject<RangeException, JSRangeException>(exec, obj); |
|
151 } |
|
152 RangeException* toRangeException(KJS::JSValue* val) |
|
153 { |
|
154 return val->isObject(&JSRangeException::info) ? static_cast<JSRangeException*>(val)->impl() : 0; |
|
155 } |
|
156 |
|
157 } |