EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionHasFocus(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLDocument::s_info)) return throwVMTypeError(exec); JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue)); HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl()); JSC::JSValue result = jsBoolean(imp->hasFocus()); return JSValue::encode(result); }