static v8::Handle<v8::Value> setCustomValidityCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.HTMLSelectElement.setCustomValidity");
    HTMLSelectElement* imp = V8HTMLSelectElement::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, error, args[0]);
    imp->setCustomValidity(error);
    return v8::Handle<v8::Value>();
}
Esempio n. 2
0
EncodedJSValue JSC_HOST_CALL jsHTMLSelectElementPrototypeFunctionSetCustomValidity(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& error(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->setCustomValidity(error);
    return JSValue::encode(jsUndefined());
}