Ah! Nevermind. nameGetter is static. static JSC::JSValue nameGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
-eric On Thu, Jul 23, 2009 at 3:04 PM, Eric Seidel<e...@webkit.org> wrote: > 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