Is it possible to move a name getter onto a different JavaScript object?

Example:
JSValue JSHTMLFormElement::nameGetter(ExecState* exec, const
Identifier& propertyName, const PropertySlot& slot)
{
    JSHTMLElement* jsForm =
static_cast<JSHTMLFormElement*>(asObject(slot.slotBase()));
    HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());

    Vector<RefPtr<Node> > namedItems;
    form->getNamedElements(propertyName, namedItems);

    if (namedItems.size() == 1)
        return toJS(exec, jsForm->globalObject(), namedItems[0].get());
    if (namedItems.size() > 1)
        return new (exec) JSNamedNodesCollection(exec,
jsForm->globalObject(), namedItems);
    return jsUndefined();
}

Why does this function use slot.slotBase() for "this" instead of just
using "this"?

Arv mentioned that there is lookupGetter()... maybe that's why this
uses slot.slotBase()?

-eric
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to