当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLOptionsCollection::add方法代码示例

本文整理汇总了C++中HTMLOptionsCollection::add方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLOptionsCollection::add方法的具体用法?C++ HTMLOptionsCollection::add怎么用?C++ HTMLOptionsCollection::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLOptionsCollection的用法示例。


在下文中一共展示了HTMLOptionsCollection::add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setDOMException

void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
    if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
        setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
        return;
    }
    HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
    HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));

    ExceptionCode ec = 0;
    if (args.Length() < 2)
        imp->add(option, ec);
    else {
        bool ok;
        V8TRYCATCH_VOID(int, index, toInt32(args[1], ok));
        if (!ok)
            ec = TYPE_MISMATCH_ERR;
        else
            imp->add(option, index, ec);
    }

    if (!ec)
        return;
    setDOMException(ec, args.GetIsolate());
}
开发者ID:windyuuy,项目名称:opera,代码行数:25,代码来源:V8HTMLOptionsCollectionCustom.cpp

示例2: setDOMException

v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.HTMLOptionsCollection.add()");
    if (!V8HTMLOptionElement::HasInstance(args[0]))
        return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
    HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
    HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));

    ExceptionCode ec = 0;
    if (args.Length() < 2)
        imp->add(option, ec);
    else {
        bool ok;
        v8::TryCatch try_catch;
        int index = toInt32(args[1], ok);

        if (try_catch.HasCaught())
            return v8::Undefined();

        if (!ok)
            ec = TYPE_MISMATCH_ERR;
        else
            imp->add(option, index, ec);
    }

    if (ec)
        return setDOMException(ec, args.GetIsolate());

    return v8::Undefined();
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例3: add

JSValue JSHTMLOptionsCollection::add(ExecState* exec)
{
    HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
    HTMLOptionElement* option = toHTMLOptionElement(exec->argument(0));
    ExceptionCode ec = 0;
    if (exec->argumentCount() < 2)
        imp->add(option, ec);
    else {
        int index = exec->argument(1).toInt32(exec);
        if (exec->hadException())
            return jsUndefined();
        imp->add(option, index, ec);
    }
    setDOMException(exec, ec);
    return jsUndefined();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:16,代码来源:JSHTMLOptionsCollectionCustom.cpp

示例4: add

JSValue JSHTMLOptionsCollection::add(ExecState* exec, const ArgList& args)
{
    HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
    HTMLOptionElement* option = toHTMLOptionElement(args.at(0));
    ExceptionCode ec = 0;
    if (args.size() < 2)
        imp->add(option, ec);
    else {
        bool ok;
        int index = args.at(1).toInt32(exec, ok);
        if (exec->hadException())
            return jsUndefined();
        if (!ok)
            ec = TYPE_MISMATCH_ERR;
        else
            imp->add(option, index, ec);
    }
    setDOMException(exec, ec);
    return jsUndefined();
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:20,代码来源:JSHTMLOptionsCollectionCustom.cpp

示例5: add

JSValue JSHTMLOptionsCollection::add(ExecState* exec)
{
    HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
    HTMLOptionElement* option = toHTMLOptionElement(exec->argument(0));
    ExceptionCode ec = 0;
    if (exec->argumentCount() < 2)
        imp->add(option, ec);
    else {
        bool ok;
        int index = finiteInt32Value(exec->argument(1), exec, ok);
        if (exec->hadException())
            return jsUndefined();
        if (!ok)
            ec = TYPE_MISMATCH_ERR;
        else
            imp->add(option, index, ec);
    }
    setDOMException(exec, ec);
    return jsUndefined();
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:20,代码来源:JSHTMLOptionsCollectionCustom.cpp

示例6: exceptionState

void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTMLOptionsCollection", info.Holder(), info.GetIsolate());
    if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate())) {
        exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
    } else {
        HTMLOptionsCollection* impl = V8HTMLOptionsCollection::toNative(info.Holder());
        HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(info[0])));

        if (info.Length() < 2) {
            impl->add(option, exceptionState);
        } else {
            int index = toInt32(info[1], exceptionState);
            if (exceptionState.throwIfNeeded())
                return;

            impl->add(option, index, exceptionState);
        }
    }

    exceptionState.throwIfNeeded();
}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:22,代码来源:V8HTMLOptionsCollectionCustom.cpp

示例7: exceptionState

void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTMLOptionsCollection", info.Holder(), info.GetIsolate());
    if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
        exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
    } else {
        HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
        HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(info[0])));

        if (info.Length() < 2) {
            imp->add(option, exceptionState);
        } else {
            bool ok;
            V8TRYCATCH_VOID(int, index, toInt32(info[1], ok));
            if (!ok)
                exceptionState.throwTypeError("The index provided could not be interpreted as an integer.");
            else
                imp->add(option, index, exceptionState);
        }
    }

    exceptionState.throwIfNeeded();
}
开发者ID:Igalia,项目名称:blink,代码行数:23,代码来源:V8HTMLOptionsCollectionCustom.cpp


注:本文中的HTMLOptionsCollection::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。