136
148
bool JSXMLHttpRequest::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
138
return getStaticValueSlot<JSXMLHttpRequest, Base>(exec, &JSXMLHttpRequestTable, this, propertyName, slot);
141
JSValuePtr jsXMLHttpRequestOnabort(ExecState* exec, const Identifier&, const PropertySlot& slot)
143
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
144
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onabort())) {
145
if (JSObject* listenerObj = listener->listenerObj())
151
JSValuePtr jsXMLHttpRequestOnerror(ExecState* exec, const Identifier&, const PropertySlot& slot)
153
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
154
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onerror())) {
155
if (JSObject* listenerObj = listener->listenerObj())
161
JSValuePtr jsXMLHttpRequestOnload(ExecState* exec, const Identifier&, const PropertySlot& slot)
163
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
164
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onload())) {
165
if (JSObject* listenerObj = listener->listenerObj())
171
JSValuePtr jsXMLHttpRequestOnloadstart(ExecState* exec, const Identifier&, const PropertySlot& slot)
173
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
174
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onloadstart())) {
175
if (JSObject* listenerObj = listener->listenerObj())
181
JSValuePtr jsXMLHttpRequestOnprogress(ExecState* exec, const Identifier&, const PropertySlot& slot)
183
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
184
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onprogress())) {
185
if (JSObject* listenerObj = listener->listenerObj())
191
JSValuePtr jsXMLHttpRequestOnreadystatechange(ExecState* exec, const Identifier&, const PropertySlot& slot)
193
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
194
if (JSUnprotectedEventListener* listener = static_cast<JSUnprotectedEventListener*>(imp->onreadystatechange())) {
195
if (JSObject* listenerObj = listener->listenerObj())
201
JSValuePtr jsXMLHttpRequestReadyState(ExecState* exec, const Identifier&, const PropertySlot& slot)
203
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
150
return getStaticValueSlot<JSXMLHttpRequest, Base>(exec, getJSXMLHttpRequestTable(exec), this, propertyName, slot);
153
bool JSXMLHttpRequest::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
155
return getStaticValueDescriptor<JSXMLHttpRequest, Base>(exec, getJSXMLHttpRequestTable(exec), this, propertyName, descriptor);
158
JSValue jsXMLHttpRequestOnabort(ExecState* exec, const Identifier&, const PropertySlot& slot)
160
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
162
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
163
if (EventListener* listener = imp->onabort()) {
164
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
170
JSValue jsXMLHttpRequestOnerror(ExecState* exec, const Identifier&, const PropertySlot& slot)
172
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
174
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
175
if (EventListener* listener = imp->onerror()) {
176
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
182
JSValue jsXMLHttpRequestOnload(ExecState* exec, const Identifier&, const PropertySlot& slot)
184
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
186
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
187
if (EventListener* listener = imp->onload()) {
188
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
194
JSValue jsXMLHttpRequestOnloadstart(ExecState* exec, const Identifier&, const PropertySlot& slot)
196
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
198
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
199
if (EventListener* listener = imp->onloadstart()) {
200
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
206
JSValue jsXMLHttpRequestOnprogress(ExecState* exec, const Identifier&, const PropertySlot& slot)
208
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
210
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
211
if (EventListener* listener = imp->onprogress()) {
212
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
218
JSValue jsXMLHttpRequestOnreadystatechange(ExecState* exec, const Identifier&, const PropertySlot& slot)
220
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
222
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
223
if (EventListener* listener = imp->onreadystatechange()) {
224
if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
230
JSValue jsXMLHttpRequestReadyState(ExecState* exec, const Identifier&, const PropertySlot& slot)
232
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
234
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
204
235
return jsNumber(exec, imp->readyState());
207
JSValuePtr jsXMLHttpRequestUpload(ExecState* exec, const Identifier&, const PropertySlot& slot)
209
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
210
return toJS(exec, WTF::getPtr(imp->upload()));
213
JSValuePtr jsXMLHttpRequestResponseText(ExecState* exec, const Identifier&, const PropertySlot& slot)
215
return static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->responseText(exec);
218
JSValuePtr jsXMLHttpRequestResponseXML(ExecState* exec, const Identifier&, const PropertySlot& slot)
220
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
221
return toJS(exec, WTF::getPtr(imp->responseXML()));
224
JSValuePtr jsXMLHttpRequestStatus(ExecState* exec, const Identifier&, const PropertySlot& slot)
226
ExceptionCode ec = 0;
227
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
228
JSC::JSValuePtr result = jsNumber(exec, imp->status(ec));
229
setDOMException(exec, ec);
233
JSValuePtr jsXMLHttpRequestStatusText(ExecState* exec, const Identifier&, const PropertySlot& slot)
235
ExceptionCode ec = 0;
236
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()))->impl());
237
JSC::JSValuePtr result = jsString(exec, imp->statusText(ec));
238
setDOMException(exec, ec);
242
void JSXMLHttpRequest::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
244
lookupPut<JSXMLHttpRequest, Base>(exec, propertyName, value, &JSXMLHttpRequestTable, this, slot);
247
void setJSXMLHttpRequestOnabort(ExecState* exec, JSObject* thisObject, JSValuePtr value)
249
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
250
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
253
imp->setOnabort(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
256
void setJSXMLHttpRequestOnerror(ExecState* exec, JSObject* thisObject, JSValuePtr value)
258
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
259
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
262
imp->setOnerror(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
265
void setJSXMLHttpRequestOnload(ExecState* exec, JSObject* thisObject, JSValuePtr value)
267
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
268
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
271
imp->setOnload(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
274
void setJSXMLHttpRequestOnloadstart(ExecState* exec, JSObject* thisObject, JSValuePtr value)
276
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
277
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
280
imp->setOnloadstart(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
283
void setJSXMLHttpRequestOnprogress(ExecState* exec, JSObject* thisObject, JSValuePtr value)
285
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
286
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
289
imp->setOnprogress(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
292
void setJSXMLHttpRequestOnreadystatechange(ExecState* exec, JSObject* thisObject, JSValuePtr value)
294
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
295
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
298
imp->setOnreadystatechange(globalObject->findOrCreateJSUnprotectedEventListener(exec, value, true));
301
JSValuePtr jsXMLHttpRequestPrototypeFunctionOpen(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
303
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
238
JSValue jsXMLHttpRequestWithCredentials(ExecState* exec, const Identifier&, const PropertySlot& slot)
240
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
242
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
243
return jsBoolean(imp->withCredentials());
246
JSValue jsXMLHttpRequestUpload(ExecState* exec, const Identifier&, const PropertySlot& slot)
248
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
250
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
251
return toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->upload()));
254
JSValue jsXMLHttpRequestResponseText(ExecState* exec, const Identifier&, const PropertySlot& slot)
256
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
257
return castedThis->responseText(exec);
260
JSValue jsXMLHttpRequestResponseXML(ExecState* exec, const Identifier&, const PropertySlot& slot)
262
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
264
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
265
return toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->responseXML()));
268
JSValue jsXMLHttpRequestStatus(ExecState* exec, const Identifier&, const PropertySlot& slot)
270
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
271
ExceptionCode ec = 0;
272
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
273
JSC::JSValue result = jsNumber(exec, imp->status(ec));
274
setDOMException(exec, ec);
278
JSValue jsXMLHttpRequestStatusText(ExecState* exec, const Identifier&, const PropertySlot& slot)
280
JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
281
ExceptionCode ec = 0;
282
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
283
JSC::JSValue result = jsString(exec, imp->statusText(ec));
284
setDOMException(exec, ec);
288
void JSXMLHttpRequest::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
290
lookupPut<JSXMLHttpRequest, Base>(exec, propertyName, value, getJSXMLHttpRequestTable(exec), this, slot);
293
void setJSXMLHttpRequestOnabort(ExecState* exec, JSObject* thisObject, JSValue value)
296
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
297
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
300
imp->setOnabort(globalObject->createJSAttributeEventListener(value));
303
void setJSXMLHttpRequestOnerror(ExecState* exec, JSObject* thisObject, JSValue value)
306
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
307
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
310
imp->setOnerror(globalObject->createJSAttributeEventListener(value));
313
void setJSXMLHttpRequestOnload(ExecState* exec, JSObject* thisObject, JSValue value)
316
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
317
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
320
imp->setOnload(globalObject->createJSAttributeEventListener(value));
323
void setJSXMLHttpRequestOnloadstart(ExecState* exec, JSObject* thisObject, JSValue value)
326
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
327
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
330
imp->setOnloadstart(globalObject->createJSAttributeEventListener(value));
333
void setJSXMLHttpRequestOnprogress(ExecState* exec, JSObject* thisObject, JSValue value)
336
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
337
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
340
imp->setOnprogress(globalObject->createJSAttributeEventListener(value));
343
void setJSXMLHttpRequestOnreadystatechange(ExecState* exec, JSObject* thisObject, JSValue value)
346
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
347
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());
350
imp->setOnreadystatechange(globalObject->createJSAttributeEventListener(value));
353
void setJSXMLHttpRequestWithCredentials(ExecState* exec, JSObject* thisObject, JSValue value)
355
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(static_cast<JSXMLHttpRequest*>(thisObject)->impl());
356
ExceptionCode ec = 0;
357
imp->setWithCredentials(value.toBoolean(exec), ec);
358
setDOMException(exec, ec);
361
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionOpen(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
364
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
304
365
return throwError(exec, TypeError);
305
366
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
306
367
return castedThisObj->open(exec, args);
309
JSValuePtr jsXMLHttpRequestPrototypeFunctionSetRequestHeader(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
370
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionSetRequestHeader(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
311
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
373
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
312
374
return throwError(exec, TypeError);
313
375
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
314
376
return castedThisObj->setRequestHeader(exec, args);
317
JSValuePtr jsXMLHttpRequestPrototypeFunctionSend(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
379
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionSend(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
319
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
382
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
320
383
return throwError(exec, TypeError);
321
384
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
322
385
return castedThisObj->send(exec, args);
325
JSValuePtr jsXMLHttpRequestPrototypeFunctionAbort(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
388
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionAbort(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
327
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
391
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
328
392
return throwError(exec, TypeError);
329
393
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
330
394
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThisObj->impl());
333
397
return jsUndefined();
336
JSValuePtr jsXMLHttpRequestPrototypeFunctionGetAllResponseHeaders(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
400
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionGetAllResponseHeaders(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
338
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
403
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
339
404
return throwError(exec, TypeError);
340
405
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
341
406
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThisObj->impl());
342
407
ExceptionCode ec = 0;
345
JSC::JSValuePtr result = jsStringOrUndefined(exec, imp->getAllResponseHeaders(ec));
410
JSC::JSValue result = jsStringOrUndefined(exec, imp->getAllResponseHeaders(ec));
346
411
setDOMException(exec, ec);
350
JSValuePtr jsXMLHttpRequestPrototypeFunctionGetResponseHeader(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
415
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionGetResponseHeader(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
352
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
418
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
353
419
return throwError(exec, TypeError);
354
420
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
355
421
return castedThisObj->getResponseHeader(exec, args);
358
JSValuePtr jsXMLHttpRequestPrototypeFunctionOverrideMimeType(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
424
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionOverrideMimeType(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
360
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
427
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
361
428
return throwError(exec, TypeError);
362
429
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
363
430
return castedThisObj->overrideMimeType(exec, args);
366
JSValuePtr jsXMLHttpRequestPrototypeFunctionAddEventListener(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
433
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionAddEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
368
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
436
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
369
437
return throwError(exec, TypeError);
370
438
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
371
439
return castedThisObj->addEventListener(exec, args);
374
JSValuePtr jsXMLHttpRequestPrototypeFunctionRemoveEventListener(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
442
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionRemoveEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
376
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
445
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
377
446
return throwError(exec, TypeError);
378
447
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
379
448
return castedThisObj->removeEventListener(exec, args);
382
JSValuePtr jsXMLHttpRequestPrototypeFunctionDispatchEvent(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
451
JSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionDispatchEvent(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
384
if (!thisValue->isObject(&JSXMLHttpRequest::s_info))
454
if (!thisValue.inherits(&JSXMLHttpRequest::s_info))
385
455
return throwError(exec, TypeError);
386
456
JSXMLHttpRequest* castedThisObj = static_cast<JSXMLHttpRequest*>(asObject(thisValue));
387
457
XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThisObj->impl());
388
458
ExceptionCode ec = 0;
389
Event* evt = toEvent(args.at(exec, 0));
392
JSC::JSValuePtr result = jsBoolean(imp->dispatchEvent(evt, ec));
459
Event* evt = toEvent(args.at(0));
462
JSC::JSValue result = jsBoolean(imp->dispatchEvent(evt, ec));
393
463
setDOMException(exec, ec);
397
467
// Constant getters
399
JSValuePtr jsXMLHttpRequestUNSENT(ExecState* exec, const Identifier&, const PropertySlot&)
469
JSValue jsXMLHttpRequestUNSENT(ExecState* exec, const Identifier&, const PropertySlot&)
401
471
return jsNumber(exec, static_cast<int>(0));
404
JSValuePtr jsXMLHttpRequestOPENED(ExecState* exec, const Identifier&, const PropertySlot&)
474
JSValue jsXMLHttpRequestOPENED(ExecState* exec, const Identifier&, const PropertySlot&)
406
476
return jsNumber(exec, static_cast<int>(1));
409
JSValuePtr jsXMLHttpRequestHEADERS_RECEIVED(ExecState* exec, const Identifier&, const PropertySlot&)
479
JSValue jsXMLHttpRequestHEADERS_RECEIVED(ExecState* exec, const Identifier&, const PropertySlot&)
411
481
return jsNumber(exec, static_cast<int>(2));
414
JSValuePtr jsXMLHttpRequestLOADING(ExecState* exec, const Identifier&, const PropertySlot&)
484
JSValue jsXMLHttpRequestLOADING(ExecState* exec, const Identifier&, const PropertySlot&)
416
486
return jsNumber(exec, static_cast<int>(3));
419
JSValuePtr jsXMLHttpRequestDONE(ExecState* exec, const Identifier&, const PropertySlot&)
489
JSValue jsXMLHttpRequestDONE(ExecState* exec, const Identifier&, const PropertySlot&)
421
491
return jsNumber(exec, static_cast<int>(4));
424
JSC::JSValuePtr toJS(JSC::ExecState* exec, XMLHttpRequest* object)
494
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, XMLHttpRequest* object)
426
return getDOMObjectWrapper<JSXMLHttpRequest>(exec, object);
496
return getDOMObjectWrapper<JSXMLHttpRequest>(exec, globalObject, object);
428
XMLHttpRequest* toXMLHttpRequest(JSC::JSValuePtr value)
498
XMLHttpRequest* toXMLHttpRequest(JSC::JSValue value)
430
return value->isObject(&JSXMLHttpRequest::s_info) ? static_cast<JSXMLHttpRequest*>(asObject(value))->impl() : 0;
500
return value.inherits(&JSXMLHttpRequest::s_info) ? static_cast<JSXMLHttpRequest*>(asObject(value))->impl() : 0;