예제 #1
0
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionState& exceptionState)
{
    HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
    if (!value) {
        exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
        return true;
    }
    base->setOption(index, value.get(), exceptionState);
    return true;
}
예제 #2
0
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionCode& ec)
{
    HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
    if (!value) {
        ec = TYPE_MISMATCH_ERR;
        return true;
    }
    base->setOption(index, value.get(), ec);
    return true;
}