|
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 #include "JSRangeException.h" |
|
23 |
|
24 #include "KURL.h" |
|
25 #include "RangeException.h" |
|
26 #include <runtime/Error.h> |
|
27 #include <runtime/JSNumberCell.h> |
|
28 #include <runtime/JSString.h> |
|
29 #include <wtf/GetPtr.h> |
|
30 |
|
31 using namespace JSC; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 ASSERT_CLASS_FITS_IN_CELL(JSRangeException); |
|
36 |
|
37 /* Hash table */ |
|
38 #if ENABLE(JIT) |
|
39 #define THUNK_GENERATOR(generator) , generator |
|
40 #else |
|
41 #define THUNK_GENERATOR(generator) |
|
42 #endif |
|
43 |
|
44 static const HashTableValue JSRangeExceptionTableValues[5] = |
|
45 { |
|
46 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSRangeExceptionTable = { 10, 7, JSRangeExceptionTableValues, 0 }; |
|
55 /* Hash table for constructor */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSRangeExceptionConstructorTableValues[3] = |
|
63 { |
|
64 { "BAD_BOUNDARYPOINTS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionBAD_BOUNDARYPOINTS_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { "INVALID_NODE_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionINVALID_NODE_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
67 }; |
|
68 |
|
69 #undef THUNK_GENERATOR |
|
70 static JSC_CONST_HASHTABLE HashTable JSRangeExceptionConstructorTable = { 4, 3, JSRangeExceptionConstructorTableValues, 0 }; |
|
71 class JSRangeExceptionConstructor : public DOMConstructorObject { |
|
72 public: |
|
73 JSRangeExceptionConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
74 |
|
75 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
76 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
77 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
78 static const JSC::ClassInfo s_info; |
|
79 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
80 { |
|
81 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
82 } |
|
83 protected: |
|
84 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
85 }; |
|
86 |
|
87 const ClassInfo JSRangeExceptionConstructor::s_info = { "RangeExceptionConstructor", 0, &JSRangeExceptionConstructorTable, 0 }; |
|
88 |
|
89 JSRangeExceptionConstructor::JSRangeExceptionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
90 : DOMConstructorObject(JSRangeExceptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
91 { |
|
92 putDirect(exec->propertyNames().prototype, JSRangeExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
93 } |
|
94 |
|
95 bool JSRangeExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
96 { |
|
97 return getStaticValueSlot<JSRangeExceptionConstructor, DOMObject>(exec, &JSRangeExceptionConstructorTable, this, propertyName, slot); |
|
98 } |
|
99 |
|
100 bool JSRangeExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
101 { |
|
102 return getStaticValueDescriptor<JSRangeExceptionConstructor, DOMObject>(exec, &JSRangeExceptionConstructorTable, this, propertyName, descriptor); |
|
103 } |
|
104 |
|
105 /* Hash table for prototype */ |
|
106 #if ENABLE(JIT) |
|
107 #define THUNK_GENERATOR(generator) , generator |
|
108 #else |
|
109 #define THUNK_GENERATOR(generator) |
|
110 #endif |
|
111 |
|
112 static const HashTableValue JSRangeExceptionPrototypeTableValues[4] = |
|
113 { |
|
114 { "BAD_BOUNDARYPOINTS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionBAD_BOUNDARYPOINTS_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
115 { "INVALID_NODE_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRangeExceptionINVALID_NODE_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
116 { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsRangeExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
117 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
118 }; |
|
119 |
|
120 #undef THUNK_GENERATOR |
|
121 static JSC_CONST_HASHTABLE HashTable JSRangeExceptionPrototypeTable = { 8, 7, JSRangeExceptionPrototypeTableValues, 0 }; |
|
122 const ClassInfo JSRangeExceptionPrototype::s_info = { "RangeExceptionPrototype", 0, &JSRangeExceptionPrototypeTable, 0 }; |
|
123 |
|
124 JSObject* JSRangeExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
125 { |
|
126 return getDOMPrototype<JSRangeException>(exec, globalObject); |
|
127 } |
|
128 |
|
129 bool JSRangeExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
130 { |
|
131 return getStaticPropertySlot<JSRangeExceptionPrototype, JSObject>(exec, &JSRangeExceptionPrototypeTable, this, propertyName, slot); |
|
132 } |
|
133 |
|
134 bool JSRangeExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
135 { |
|
136 return getStaticPropertyDescriptor<JSRangeExceptionPrototype, JSObject>(exec, &JSRangeExceptionPrototypeTable, this, propertyName, descriptor); |
|
137 } |
|
138 |
|
139 const ClassInfo JSRangeException::s_info = { "RangeException", 0, &JSRangeExceptionTable, 0 }; |
|
140 |
|
141 JSRangeException::JSRangeException(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<RangeException> impl) |
|
142 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
143 , m_impl(impl) |
|
144 { |
|
145 } |
|
146 |
|
147 JSRangeException::~JSRangeException() |
|
148 { |
|
149 forgetDOMObject(this, impl()); |
|
150 } |
|
151 |
|
152 JSObject* JSRangeException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
153 { |
|
154 return new (exec) JSRangeExceptionPrototype(globalObject, JSRangeExceptionPrototype::createStructure(globalObject->objectPrototype())); |
|
155 } |
|
156 |
|
157 bool JSRangeException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
158 { |
|
159 return getStaticValueSlot<JSRangeException, Base>(exec, &JSRangeExceptionTable, this, propertyName, slot); |
|
160 } |
|
161 |
|
162 bool JSRangeException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
163 { |
|
164 return getStaticValueDescriptor<JSRangeException, Base>(exec, &JSRangeExceptionTable, this, propertyName, descriptor); |
|
165 } |
|
166 |
|
167 JSValue jsRangeExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) |
|
168 { |
|
169 JSRangeException* castedThis = static_cast<JSRangeException*>(asObject(slotBase)); |
|
170 UNUSED_PARAM(exec); |
|
171 RangeException* imp = static_cast<RangeException*>(castedThis->impl()); |
|
172 JSValue result = jsNumber(exec, imp->code()); |
|
173 return result; |
|
174 } |
|
175 |
|
176 JSValue jsRangeExceptionName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
177 { |
|
178 JSRangeException* castedThis = static_cast<JSRangeException*>(asObject(slotBase)); |
|
179 UNUSED_PARAM(exec); |
|
180 RangeException* imp = static_cast<RangeException*>(castedThis->impl()); |
|
181 JSValue result = jsString(exec, imp->name()); |
|
182 return result; |
|
183 } |
|
184 |
|
185 JSValue jsRangeExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
186 { |
|
187 JSRangeException* castedThis = static_cast<JSRangeException*>(asObject(slotBase)); |
|
188 UNUSED_PARAM(exec); |
|
189 RangeException* imp = static_cast<RangeException*>(castedThis->impl()); |
|
190 JSValue result = jsString(exec, imp->message()); |
|
191 return result; |
|
192 } |
|
193 |
|
194 JSValue jsRangeExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
195 { |
|
196 JSRangeException* domObject = static_cast<JSRangeException*>(asObject(slotBase)); |
|
197 return JSRangeException::getConstructor(exec, domObject->globalObject()); |
|
198 } |
|
199 JSValue JSRangeException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
200 { |
|
201 return getDOMConstructor<JSRangeExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
202 } |
|
203 |
|
204 EncodedJSValue JSC_HOST_CALL jsRangeExceptionPrototypeFunctionToString(ExecState* exec) |
|
205 { |
|
206 JSValue thisValue = exec->hostThisValue(); |
|
207 if (!thisValue.inherits(&JSRangeException::s_info)) |
|
208 return throwVMTypeError(exec); |
|
209 JSRangeException* castedThis = static_cast<JSRangeException*>(asObject(thisValue)); |
|
210 RangeException* imp = static_cast<RangeException*>(castedThis->impl()); |
|
211 |
|
212 |
|
213 JSC::JSValue result = jsString(exec, imp->toString()); |
|
214 return JSValue::encode(result); |
|
215 } |
|
216 |
|
217 // Constant getters |
|
218 |
|
219 JSValue jsRangeExceptionBAD_BOUNDARYPOINTS_ERR(ExecState* exec, JSValue, const Identifier&) |
|
220 { |
|
221 return jsNumber(exec, static_cast<int>(1)); |
|
222 } |
|
223 |
|
224 JSValue jsRangeExceptionINVALID_NODE_TYPE_ERR(ExecState* exec, JSValue, const Identifier&) |
|
225 { |
|
226 return jsNumber(exec, static_cast<int>(2)); |
|
227 } |
|
228 |
|
229 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, RangeException* object) |
|
230 { |
|
231 return getDOMObjectWrapper<JSRangeException>(exec, globalObject, object); |
|
232 } |
|
233 RangeException* toRangeException(JSC::JSValue value) |
|
234 { |
|
235 return value.inherits(&JSRangeException::s_info) ? static_cast<JSRangeException*>(asObject(value))->impl() : 0; |
|
236 } |
|
237 |
|
238 } |