本文整理汇总了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();
}
示例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();
}
}
示例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);
}
示例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());
}
示例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))));
}
示例6: objectProtoFuncValueOf
TiValue JSC_HOST_CALL objectProtoFuncValueOf(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
return thisValue.toThisObject(exec);
}
示例7: objectProtoFuncToString
TiValue JSC_HOST_CALL objectProtoFuncToString(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
return jsNontrivialString(exec, "[object " + thisValue.toThisObject(exec)->className() + "]");
}
示例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)));
}
示例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());
}