本文整理汇总了C++中TiValue::inherits方法的典型用法代码示例。如果您正苦于以下问题:C++ TiValue::inherits方法的具体用法?C++ TiValue::inherits怎么用?C++ TiValue::inherits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiValue
的用法示例。
在下文中一共展示了TiValue::inherits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TiValueIsDate
bool TiValueIsDate(TiContextRef ctx, TiValueRef value)
{
TiExcState* exec = toJS(ctx);
exec->globalData().heap.registerThread();
TiLock lock(exec);
TiValue jsValue = toJS(exec, value);
return jsValue.inherits(&DateInstance::info);
}
示例2: booleanProtoFuncValueOf
TiValue JSC_HOST_CALL booleanProtoFuncValueOf(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
if (thisValue.isBoolean())
return thisValue;
if (!thisValue.inherits(&BooleanObject::info))
return throwError(exec, TypeError);
return asBooleanObject(thisValue)->internalValue();
}
示例3: functionProtoFuncToString
EncodedTiValue JSC_HOST_CALL functionProtoFuncToString(TiExcState* exec)
{
TiValue thisValue = exec->hostThisValue();
if (thisValue.inherits(&TiFunction::s_info)) {
TiFunction* function = asFunction(thisValue);
if (function->isHostFunction())
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
FunctionExecutable* executable = function->jsExecutable();
UString sourceString = executable->source().toString();
insertSemicolonIfNeeded(sourceString);
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "(", executable->paramString(), ") ", sourceString));
}
if (thisValue.inherits(&InternalFunction::s_info)) {
InternalFunction* function = asInternalFunction(thisValue);
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
}
return throwVMTypeError(exec);
}
示例4: booleanProtoFuncToString
TiValue JSC_HOST_CALL booleanProtoFuncToString(TiExcState* exec, TiObject*, TiValue thisValue, const ArgList&)
{
if (thisValue == jsBoolean(false))
return jsNontrivialString(exec, "false");
if (thisValue == jsBoolean(true))
return jsNontrivialString(exec, "true");
if (!thisValue.inherits(&BooleanObject::info))
return throwError(exec, TypeError);
if (asBooleanObject(thisValue)->internalValue() == jsBoolean(false))
return jsNontrivialString(exec, "false");
ASSERT(asBooleanObject(thisValue)->internalValue() == jsBoolean(true));
return jsNontrivialString(exec, "true");
}