Exemplo n.º 1
0
JSValue* JSNodeIterator::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case RootAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return toJS(exec, WTF::getPtr(imp->root()));
    }
    case WhatToShowAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return jsNumber(exec, imp->whatToShow());
    }
    case FilterAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return toJS(exec, WTF::getPtr(imp->filter()));
    }
    case ExpandEntityReferencesAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return jsBoolean(imp->expandEntityReferences());
    }
    case ReferenceNodeAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return toJS(exec, WTF::getPtr(imp->referenceNode()));
    }
    case PointerBeforeReferenceNodeAttrNum: {
        NodeIterator* imp = static_cast<NodeIterator*>(impl());
        return jsBoolean(imp->pointerBeforeReferenceNode());
    }
    }
    return 0;
}
Exemplo n.º 2
0
JSValue jsNodeIteratorFilter(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->filter()));
    return result;
}