示例#1
0
JSValue jsXMLHttpRequestStatusText(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSXMLHttpRequest* castedThis = static_cast<JSXMLHttpRequest*>(asObject(slot.slotBase()));
    ExceptionCode ec = 0;
    XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(castedThis->impl());
    JSC::JSValue result = jsString(exec, imp->statusText(ec));
    setDOMException(exec, ec);
    return result;
}
示例#2
-1
JSValue* JSXMLHttpRequest::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case OnabortAttrNum: {
        return onabort(exec);
    }
    case OnerrorAttrNum: {
        return onerror(exec);
    }
    case OnloadAttrNum: {
        return onload(exec);
    }
    case OnloadstartAttrNum: {
        return onloadstart(exec);
    }
    case OnprogressAttrNum: {
        return onprogress(exec);
    }
    case OnreadystatechangeAttrNum: {
        return onreadystatechange(exec);
    }
    case ReadyStateAttrNum: {
        XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(impl());
        return jsNumber(exec, imp->readyState());
    }
    case ResponseTextAttrNum: {
        XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(impl());
        return jsStringOrNull(exec, imp->responseText());
    }
    case ResponseXMLAttrNum: {
        XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(impl());
        return toJS(exec, WTF::getPtr(imp->responseXML()));
    }
    case StatusAttrNum: {
        ExceptionCode ec = 0;
        XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(impl());
        KJS::JSValue* result = jsNumber(exec, imp->status(ec));
        setDOMException(exec, ec);
        return result;
    }
    case StatusTextAttrNum: {
        ExceptionCode ec = 0;
        XMLHttpRequest* imp = static_cast<XMLHttpRequest*>(impl());
        KJS::JSValue* result = jsString(exec, imp->statusText(ec));
        setDOMException(exec, ec);
        return result;
    }
    }
    return 0;
}