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


C++ TiValue::toThisObject方法代码示例

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


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

示例1: objectProtoFuncDefineSetter

TiValue JSC_HOST_CALL objectProtoFuncDefineSetter(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList& args)
{
    CallData callData;
    if (args.at(1).getCallData(callData) == CallTypeNone)
        return throwError(exec, SyntaxError, "invalid setter usage");
    thisValue.toThisObject(exec)->defineSetter(exec, Identifier(exec, args.at(0).toString(exec)), asObject(args.at(1)));
    return jsUndefined();
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:8,代码来源:ObjectPrototype.cpp

示例2: objectProtoFuncIsPrototypeOf

TiValue JSC_HOST_CALL objectProtoFuncIsPrototypeOf(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList& args)
{
    TiObject* thisObj = thisValue.toThisObject(exec);

    if (!args.at(0).isObject())
        return jsBoolean(false);

    TiValue v = asObject(args.at(0))->prototype();

    while (true) {
        if (!v.isObject())
            return jsBoolean(false);
        if (v == thisObj)
            return jsBoolean(true);
        v = asObject(v)->prototype();
    }
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:17,代码来源:ObjectPrototype.cpp

示例3: call

TiValue TiCallbackFunction::call(TiExcState* exec, TiObject* functionObject, TiValue thisValue, const ArgList& args)
{
    TiContextRef execRef = toRef(exec);
    TiObjectRef functionRef = toRef(functionObject);
    TiObjectRef thisObjRef = toRef(thisValue.toThisObject(exec));

    int argumentCount = static_cast<int>(args.size());
    Vector<TiValueRef, 16> arguments(argumentCount);
    for (int i = 0; i < argumentCount; i++)
        arguments[i] = toRef(exec, args.at(i));

    TiValueRef exception = 0;
    TiValueRef result;
    {
        APICallbackShim callbackShim(exec);
        result = static_cast<TiCallbackFunction*>(functionObject)->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception);
    }
    if (exception)
        exec->setException(toJS(exec, exception));

    return toJS(exec, result);
}
开发者ID:adelyte,项目名称:tijscore,代码行数:22,代码来源:TiCallbackFunction.cpp

示例4: addParentForConsoleStart

void ProfileGenerator::addParentForConsoleStart(TiExcState* exec)
{
    int lineNumber;
    intptr_t sourceID;
    UString sourceURL;
    TiValue function;

    exec->interpreter()->retrieveLastCaller(exec, lineNumber, sourceID, sourceURL, function);
    m_currentNode = ProfileNode::create(Profiler::createCallIdentifier(&exec->globalData(), function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get());
    m_head->insertNode(m_currentNode.get());
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:11,代码来源:ProfileGenerator.cpp

示例5: objectProtoFuncHasOwnProperty

TiValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList& args)
{
    return jsBoolean(thisValue.toThisObject(exec)->hasOwnProperty(exec, Identifier(exec, args.at(0).toString(exec))));
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:4,代码来源:ObjectPrototype.cpp

示例6: objectProtoFuncValueOf

TiValue JSC_HOST_CALL objectProtoFuncValueOf(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
    return thisValue.toThisObject(exec);
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:4,代码来源:ObjectPrototype.cpp

示例7: objectProtoFuncToString

TiValue JSC_HOST_CALL objectProtoFuncToString(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
    return jsNontrivialString(exec, "[object " + thisValue.toThisObject(exec)->className() + "]");
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:4,代码来源:ObjectPrototype.cpp

示例8: objectProtoFuncLookupSetter

TiValue JSC_HOST_CALL objectProtoFuncLookupSetter(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList& args)
{
    return thisValue.toThisObject(exec)->lookupSetter(exec, Identifier(exec, args.at(0).toString(exec)));
}
开发者ID:rseagraves,项目名称:tijscore,代码行数:4,代码来源:ObjectPrototype.cpp

示例9: call

TiValue TiFunction::call(TiExcState* exec, TiValue thisValue, const ArgList& args)
{
    ASSERT(!isHostFunction());
    return exec->interpreter()->execute(jsExecutable(), exec, this, thisValue.toThisObject(exec), args, scopeChain().node(), exec->exceptionSlot());
}
开发者ID:adelyte,项目名称:tijscore,代码行数:5,代码来源:TiFunction.cpp


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