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


C++ JSValue::toInt32方法代码示例

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


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

示例1: setJSHTMLInputElementMaxLength

void setJSHTMLInputElementMaxLength(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLInputElement* imp = static_cast<HTMLInputElement*>(static_cast<JSHTMLInputElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setMaxLength(value.toInt32(exec), ec);
    setDOMException(exec, ec);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:7,代码来源:JSHTMLInputElement.cpp

示例2: setJSSVGAnimatedIntegerBaseVal

void setJSSVGAnimatedIntegerBaseVal(ExecState* exec, JSObject* thisObject, JSValue value)
{
    SVGAnimatedInteger* imp = static_cast<SVGAnimatedInteger*>(static_cast<JSSVGAnimatedInteger*>(thisObject)->impl());
    imp->setBaseVal(value.toInt32(exec));
    if (static_cast<JSSVGAnimatedInteger*>(thisObject)->context())
        static_cast<JSSVGAnimatedInteger*>(thisObject)->context()->svgAttributeChanged(static_cast<JSSVGAnimatedInteger*>(thisObject)->impl()->associatedAttributeName());
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: acceptNode

short JSNodeFilterCondition::acceptNode(JSC::ExecState* exec, Node* filterNode) const
{
    JSLock lock(SilenceAssertionsOnly);

    CallData callData;
    CallType callType = m_filter.getCallData(callData);
    if (callType == CallTypeNone)
        return NodeFilter::FILTER_ACCEPT;

   // The exec argument here should only be null if this was called from a
   // non-JavaScript language, and this is a JavaScript filter, and the document
   // in question is not associated with the frame. In that case, we're going to
   // behave incorrectly, and just reject nodes instead of calling the filter function.
   // To fix that we'd need to come up with a way to find a suitable JavaScript
   // execution context for the filter function to run in.
    if (!exec)
        return NodeFilter::FILTER_REJECT;

    MarkedArgumentBuffer args;
    // FIXME: The node should have the prototype chain that came from its document, not
    // whatever prototype chain might be on the window this filter came from. Bug 27662
    args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), filterNode));
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    JSValue result = call(exec, m_filter, callType, callData, m_filter, args);
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    int intResult = result.toInt32(exec);
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    return intResult;
}
开发者ID:boyliang,项目名称:ComponentSuperAccessor,代码行数:35,代码来源:JSNodeFilterCondition.cpp

示例4: setJSSVGAnimatedEnumerationBaseVal

void setJSSVGAnimatedEnumerationBaseVal(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSSVGAnimatedEnumeration* castedThisObj = static_cast<JSSVGAnimatedEnumeration*>(thisObject);
    SVGAnimatedEnumeration* imp = static_cast<SVGAnimatedEnumeration*>(castedThisObj->impl());
    imp->setBaseVal(value.toInt32(exec));
    JSSVGContextCache::propagateSVGDOMChange(castedThisObj, imp->associatedAttributeName());
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:7,代码来源:JSSVGAnimatedEnumeration.cpp

示例5: acceptNode

short JSNodeFilterCondition::acceptNode(Node* filterNode, JSValue*& exception) const
{
    // FIXME: It makes no sense for this to depend on the document being in a frame!
    Frame* frame = filterNode->document()->frame();
    if (!frame)
        return NodeFilter::FILTER_REJECT;

    JSLock lock;

    CallData callData;
    CallType callType = m_filter->getCallData(callData);
    if (callType == CallTypeNone)
        return NodeFilter::FILTER_ACCEPT;

    ExecState* exec = frame->script()->globalObject()->globalExec();
    ArgList args;
    args.append(toJS(exec, filterNode));
    if (exec->hadException()) {
        exception = takeException(exec);
        return NodeFilter::FILTER_REJECT;
    }
    JSValue* result = call(exec, m_filter, callType, callData, m_filter, args);
    if (exec->hadException()) {
        exception = takeException(exec);
        return NodeFilter::FILTER_REJECT;
    }
    int intResult = result->toInt32(exec);
    if (exec->hadException()) {
        exception = takeException(exec);
        return NodeFilter::FILTER_REJECT;
    }
    return intResult;
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:33,代码来源:JSNodeFilterCondition.cpp

示例6: setSelectionEnd

void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
{
    HTMLInputElement& input = impl();
    if (!input.canHaveSelection())
        throwTypeError(exec);

    input.setSelectionEnd(value.toInt32(exec));
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例7: setSelectionEnd

void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        throwTypeError(exec);

    input->setSelectionEnd(value.toInt32(exec));
}
开发者ID:RasterCode,项目名称:wke,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例8: setJSHTMLMarqueeElementScrollDelay

void setJSHTMLMarqueeElementScrollDelay(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject);
    HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl());
    ExceptionCode ec = 0;
    imp->setScrollDelay(value.toInt32(exec), ec);
    setDOMException(exec, ec);
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:8,代码来源:JSHTMLMarqueeElement.cpp

示例9: setSelectionEnd

void JSHTMLInputElement::setSelectionEnd(ExecState& state, JSValue value)
{
    HTMLInputElement& input = wrapped();
    if (!input.canHaveSelection())
        throwTypeError(&state);

    input.setSelectionEnd(value.toInt32(&state));
}
开发者ID:edcwconan,项目名称:webkit,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例10: acceptNode

short JSNodeFilterCondition::acceptNode(JSC::ExecState* exec, Node* filterNode) const
{
    JSLock lock(SilenceAssertionsOnly);

    if (!m_filter)
        return NodeFilter::FILTER_ACCEPT;

    // Exec is null if we've been called from a non-JavaScript language and the document
    // is no longer able to run JavaScript (e.g., it's disconnected from its frame).
    if (!exec)
        return NodeFilter::FILTER_REJECT;

    JSValue filter = m_filter.get();
    CallData callData;
    CallType callType = getCallData(filter, callData);
    if (callType == CallTypeNone) {
        filter = filter.get(exec, Identifier(exec, "acceptNode"));
        callType = getCallData(filter, callData);
        if (callType == CallTypeNone) {
            throwError(exec, createTypeError(exec, "NodeFilter object does not have an acceptNode function"));
            return NodeFilter::FILTER_REJECT;
        }
    }

    MarkedArgumentBuffer args;
    // FIXME: The node should have the prototype chain that came from its document, not
    // whatever prototype chain might be on the window this filter came from. Bug 27662
    args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), filterNode));
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    JSValue result = JSMainThreadExecState::call(exec, filter, callType, callData, m_filter.get(), args);
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    int intResult = result.toInt32(exec);
    if (exec->hadException())
        return NodeFilter::FILTER_REJECT;

    return intResult;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:41,代码来源:JSNodeFilterCondition.cpp

示例11: setJSDataGridColumnSortDirection

void setJSDataGridColumnSortDirection(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSDataGridColumn* castedThisObj = static_cast<JSDataGridColumn*>(thisObject);
    DataGridColumn* imp = static_cast<DataGridColumn*>(castedThisObj->impl());
    imp->setSortDirection(value.toInt32(exec));
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:6,代码来源:JSDataGridColumn.cpp

示例12: showContextMenu

JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec)
{
    if (exec->argumentCount() < 2)
        return jsUndefined();
#if ENABLE(CONTEXT_MENUS)
    Event* event = toEvent(exec->argument(0));

    JSArray* array = asArray(exec->argument(1));
    Vector<ContextMenuItem*> items;

    for (size_t i = 0; i < array->length(); ++i) {
        JSObject* item = asObject(array->getIndex(i));
        JSValue label = item->get(exec, Identifier(exec, "label"));
        JSValue type = item->get(exec, Identifier(exec, "type"));
        JSValue id = item->get(exec, Identifier(exec, "id"));
        JSValue enabled = item->get(exec, Identifier(exec, "enabled"));
        JSValue checked = item->get(exec, Identifier(exec, "checked"));
        if (!type.isString())
            continue;

        String typeString = ustringToString(type.toString(exec)->value(exec));
        if (typeString == "separator") {
            items.append(new ContextMenuItem(SeparatorType,
                                             ContextMenuItemCustomTagNoAction,
                                             String()));
        } else {
            ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec));
            ContextMenuItem* menuItem = new ContextMenuItem((typeString == "checkbox" ? CheckableActionType : ActionType), typedId, ustringToString(label.toString(exec)->value(exec)));
            if (!enabled.isUndefined())
                menuItem->setEnabled(enabled.toBoolean(exec));
            if (!checked.isUndefined())
                menuItem->setChecked(checked.toBoolean(exec));
            items.append(menuItem);
        }
    }

    impl()->showContextMenu(event, items);
#endif
    return jsUndefined();
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:40,代码来源:JSInspectorFrontendHostCustom.cpp

示例13: setJSHTMLTableCellElementRowSpan

void setJSHTMLTableCellElementRowSpan(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLTableCellElement* castedThisObj = static_cast<JSHTMLTableCellElement*>(thisObject);
    HTMLTableCellElement* imp = static_cast<HTMLTableCellElement*>(castedThisObj->impl());
    imp->setRowSpan(value.toInt32(exec));
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:6,代码来源:JSHTMLTableCellElement.cpp

示例14: setJSHTMLElementTabIndex

void setJSHTMLElementTabIndex(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject);
    HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
    imp->setTabIndex(value.toInt32(exec));
}
开发者ID:dpnishant,项目名称:tpjs,代码行数:6,代码来源:JSHTMLElement.cpp

示例15: setJSHTMLDataGridColElementSortDirection

void setJSHTMLDataGridColElementSortDirection(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLDataGridColElement* castedThisObj = static_cast<JSHTMLDataGridColElement*>(thisObject);
    HTMLDataGridColElement* imp = static_cast<HTMLDataGridColElement*>(castedThisObj->impl());
    imp->setSortDirection(value.toInt32(exec));
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:6,代码来源:JSHTMLDataGridColElement.cpp


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