|
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 "JSXMLHttpRequestException.h" |
|
23 |
|
24 #include "KURL.h" |
|
25 #include "XMLHttpRequestException.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(JSXMLHttpRequestException); |
|
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 JSXMLHttpRequestExceptionTableValues[5] = |
|
45 { |
|
46 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionConstructor), (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 JSXMLHttpRequestExceptionTable = { 10, 7, JSXMLHttpRequestExceptionTableValues, 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 JSXMLHttpRequestExceptionConstructorTableValues[3] = |
|
63 { |
|
64 { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionABORT_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 JSXMLHttpRequestExceptionConstructorTable = { 4, 3, JSXMLHttpRequestExceptionConstructorTableValues, 0 }; |
|
71 class JSXMLHttpRequestExceptionConstructor : public DOMConstructorObject { |
|
72 public: |
|
73 JSXMLHttpRequestExceptionConstructor(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 JSXMLHttpRequestExceptionConstructor::s_info = { "XMLHttpRequestExceptionConstructor", 0, &JSXMLHttpRequestExceptionConstructorTable, 0 }; |
|
88 |
|
89 JSXMLHttpRequestExceptionConstructor::JSXMLHttpRequestExceptionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
90 : DOMConstructorObject(JSXMLHttpRequestExceptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
91 { |
|
92 putDirect(exec->propertyNames().prototype, JSXMLHttpRequestExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
93 } |
|
94 |
|
95 bool JSXMLHttpRequestExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
96 { |
|
97 return getStaticValueSlot<JSXMLHttpRequestExceptionConstructor, DOMObject>(exec, &JSXMLHttpRequestExceptionConstructorTable, this, propertyName, slot); |
|
98 } |
|
99 |
|
100 bool JSXMLHttpRequestExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
101 { |
|
102 return getStaticValueDescriptor<JSXMLHttpRequestExceptionConstructor, DOMObject>(exec, &JSXMLHttpRequestExceptionConstructorTable, 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 JSXMLHttpRequestExceptionPrototypeTableValues[4] = |
|
113 { |
|
114 { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
115 { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
116 { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsXMLHttpRequestExceptionPrototypeFunctionToString), (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 JSXMLHttpRequestExceptionPrototypeTable = { 8, 7, JSXMLHttpRequestExceptionPrototypeTableValues, 0 }; |
|
122 static const HashTable* getJSXMLHttpRequestExceptionPrototypeTable(ExecState* exec) |
|
123 { |
|
124 return getHashTableForGlobalData(exec->globalData(), &JSXMLHttpRequestExceptionPrototypeTable); |
|
125 } |
|
126 const ClassInfo JSXMLHttpRequestExceptionPrototype::s_info = { "XMLHttpRequestExceptionPrototype", 0, 0, getJSXMLHttpRequestExceptionPrototypeTable }; |
|
127 |
|
128 JSObject* JSXMLHttpRequestExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
129 { |
|
130 return getDOMPrototype<JSXMLHttpRequestException>(exec, globalObject); |
|
131 } |
|
132 |
|
133 bool JSXMLHttpRequestExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
134 { |
|
135 return getStaticPropertySlot<JSXMLHttpRequestExceptionPrototype, JSObject>(exec, getJSXMLHttpRequestExceptionPrototypeTable(exec), this, propertyName, slot); |
|
136 } |
|
137 |
|
138 bool JSXMLHttpRequestExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
139 { |
|
140 return getStaticPropertyDescriptor<JSXMLHttpRequestExceptionPrototype, JSObject>(exec, getJSXMLHttpRequestExceptionPrototypeTable(exec), this, propertyName, descriptor); |
|
141 } |
|
142 |
|
143 static const HashTable* getJSXMLHttpRequestExceptionTable(ExecState* exec) |
|
144 { |
|
145 return getHashTableForGlobalData(exec->globalData(), &JSXMLHttpRequestExceptionTable); |
|
146 } |
|
147 const ClassInfo JSXMLHttpRequestException::s_info = { "XMLHttpRequestException", 0, 0, getJSXMLHttpRequestExceptionTable }; |
|
148 |
|
149 JSXMLHttpRequestException::JSXMLHttpRequestException(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<XMLHttpRequestException> impl) |
|
150 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
151 , m_impl(impl) |
|
152 { |
|
153 } |
|
154 |
|
155 JSXMLHttpRequestException::~JSXMLHttpRequestException() |
|
156 { |
|
157 forgetDOMObject(this, impl()); |
|
158 } |
|
159 |
|
160 JSObject* JSXMLHttpRequestException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
161 { |
|
162 return new (exec) JSXMLHttpRequestExceptionPrototype(globalObject, JSXMLHttpRequestExceptionPrototype::createStructure(globalObject->objectPrototype())); |
|
163 } |
|
164 |
|
165 bool JSXMLHttpRequestException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
166 { |
|
167 return getStaticValueSlot<JSXMLHttpRequestException, Base>(exec, getJSXMLHttpRequestExceptionTable(exec), this, propertyName, slot); |
|
168 } |
|
169 |
|
170 bool JSXMLHttpRequestException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
171 { |
|
172 return getStaticValueDescriptor<JSXMLHttpRequestException, Base>(exec, getJSXMLHttpRequestExceptionTable(exec), this, propertyName, descriptor); |
|
173 } |
|
174 |
|
175 JSValue jsXMLHttpRequestExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) |
|
176 { |
|
177 JSXMLHttpRequestException* castedThis = static_cast<JSXMLHttpRequestException*>(asObject(slotBase)); |
|
178 UNUSED_PARAM(exec); |
|
179 XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(castedThis->impl()); |
|
180 JSValue result = jsNumber(exec, imp->code()); |
|
181 return result; |
|
182 } |
|
183 |
|
184 JSValue jsXMLHttpRequestExceptionName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
185 { |
|
186 JSXMLHttpRequestException* castedThis = static_cast<JSXMLHttpRequestException*>(asObject(slotBase)); |
|
187 UNUSED_PARAM(exec); |
|
188 XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(castedThis->impl()); |
|
189 JSValue result = jsString(exec, imp->name()); |
|
190 return result; |
|
191 } |
|
192 |
|
193 JSValue jsXMLHttpRequestExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
194 { |
|
195 JSXMLHttpRequestException* castedThis = static_cast<JSXMLHttpRequestException*>(asObject(slotBase)); |
|
196 UNUSED_PARAM(exec); |
|
197 XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(castedThis->impl()); |
|
198 JSValue result = jsString(exec, imp->message()); |
|
199 return result; |
|
200 } |
|
201 |
|
202 JSValue jsXMLHttpRequestExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
203 { |
|
204 JSXMLHttpRequestException* domObject = static_cast<JSXMLHttpRequestException*>(asObject(slotBase)); |
|
205 return JSXMLHttpRequestException::getConstructor(exec, domObject->globalObject()); |
|
206 } |
|
207 JSValue JSXMLHttpRequestException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
208 { |
|
209 return getDOMConstructor<JSXMLHttpRequestExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
210 } |
|
211 |
|
212 EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestExceptionPrototypeFunctionToString(ExecState* exec) |
|
213 { |
|
214 JSValue thisValue = exec->hostThisValue(); |
|
215 if (!thisValue.inherits(&JSXMLHttpRequestException::s_info)) |
|
216 return throwVMTypeError(exec); |
|
217 JSXMLHttpRequestException* castedThis = static_cast<JSXMLHttpRequestException*>(asObject(thisValue)); |
|
218 XMLHttpRequestException* imp = static_cast<XMLHttpRequestException*>(castedThis->impl()); |
|
219 |
|
220 |
|
221 JSC::JSValue result = jsString(exec, imp->toString()); |
|
222 return JSValue::encode(result); |
|
223 } |
|
224 |
|
225 // Constant getters |
|
226 |
|
227 JSValue jsXMLHttpRequestExceptionNETWORK_ERR(ExecState* exec, JSValue, const Identifier&) |
|
228 { |
|
229 return jsNumber(exec, static_cast<int>(101)); |
|
230 } |
|
231 |
|
232 JSValue jsXMLHttpRequestExceptionABORT_ERR(ExecState* exec, JSValue, const Identifier&) |
|
233 { |
|
234 return jsNumber(exec, static_cast<int>(102)); |
|
235 } |
|
236 |
|
237 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, XMLHttpRequestException* object) |
|
238 { |
|
239 return getDOMObjectWrapper<JSXMLHttpRequestException>(exec, globalObject, object); |
|
240 } |
|
241 XMLHttpRequestException* toXMLHttpRequestException(JSC::JSValue value) |
|
242 { |
|
243 return value.inherits(&JSXMLHttpRequestException::s_info) ? static_cast<JSXMLHttpRequestException*>(asObject(value))->impl() : 0; |
|
244 } |
|
245 |
|
246 } |