static v8::Handle<v8::Value> namedItemCallback(const v8::Arguments& args) { INC_STATS("DOM.HTMLSelectElement.namedItem"); HTMLSelectElement* imp = V8HTMLSelectElement::toNative(args.Holder()); STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, name, args[0]); return toV8(imp->namedItem(name)); }
EncodedJSValue JSC_HOST_CALL jsHTMLSelectElementPrototypeFunctionNamedItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLSelectElement::s_info)) return throwVMTypeError(exec); JSHTMLSelectElement* castedThis = static_cast<JSHTMLSelectElement*>(asObject(thisValue)); HTMLSelectElement* imp = static_cast<HTMLSelectElement*>(castedThis->impl()); const String& name(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->namedItem(name))); return JSValue::encode(result); }