JSValue jsXPathResultInvalidIteratorState(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    JSValue result = jsBoolean(imp->invalidIteratorState());
    return result;
}
JSValue jsXPathResultResultType(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    JSValue result = jsNumber(imp->resultType());
    return result;
}
JSValue jsXPathResultSnapshotLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(slotBase));
    ExceptionCode ec = 0;
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    JSC::JSValue result = jsNumber(imp->snapshotLength(ec));
    setDOMException(exec, ec);
    return result;
}
JSValue jsXPathResultSingleNodeValue(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(slotBase));
    ExceptionCode ec = 0;
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->singleNodeValue(ec)));
    setDOMException(exec, ec);
    return result;
}
JSValue jsXPathResultBooleanValue(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(slotBase));
    ExceptionCode ec = 0;
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    JSC::JSValue result = jsBoolean(imp->booleanValue(ec));
    setDOMException(exec, ec);
    return result;
}
Beispiel #6
0
JSValue* jsXPathResultPrototypeFunctionIterateNext(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSXPathResult::s_info))
        return throwError(exec, TypeError);
    JSXPathResult* castedThisObj = static_cast<JSXPathResult*>(thisValue);
    XPathResult* imp = static_cast<XPathResult*>(castedThisObj->impl());
    ExceptionCode ec = 0;


    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->iterateNext(ec)));
    setDOMException(exec, ec);
    return result;
}
Beispiel #7
0
JSValue* jsXPathResultPrototypeFunctionSnapshotItem(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSXPathResult::s_info))
        return throwError(exec, TypeError);
    JSXPathResult* castedThisObj = static_cast<JSXPathResult*>(thisValue);
    XPathResult* imp = static_cast<XPathResult*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    unsigned index = args[0]->toInt32(exec);


    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->snapshotItem(index, ec)));
    setDOMException(exec, ec);
    return result;
}
Beispiel #8
0
EncodedJSValue JSC_HOST_CALL jsXPathResultPrototypeFunctionIterateNext(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSXPathResult::s_info))
        return throwVMTypeError(exec);
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(thisValue));
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    ExceptionCode ec = 0;


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->iterateNext(ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
Beispiel #9
0
EncodedJSValue JSC_HOST_CALL jsXPathResultPrototypeFunctionSnapshotItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSXPathResult::s_info))
        return throwVMTypeError(exec);
    JSXPathResult* castedThis = static_cast<JSXPathResult*>(asObject(thisValue));
    XPathResult* imp = static_cast<XPathResult*>(castedThis->impl());
    ExceptionCode ec = 0;
    unsigned index(exec->argument(0).toUInt32(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->snapshotItem(index, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
JSValue jsXPathResultConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSXPathResult* domObject = static_cast<JSXPathResult*>(asObject(slotBase));
    return JSXPathResult::getConstructor(exec, domObject->globalObject());
}