本文整理汇总了C++中TiValue::isGetterSetter方法的典型用法代码示例。如果您正苦于以下问题:C++ TiValue::isGetterSetter方法的具体用法?C++ TiValue::isGetterSetter怎么用?C++ TiValue::isGetterSetter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiValue
的用法示例。
在下文中一共展示了TiValue::isGetterSetter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defineSetter
void TiObject::defineSetter(TiExcState* exec, const Identifier& propertyName, TiObject* setterFunction, unsigned attributes)
{
TiValue object = getDirect(propertyName);
if (object && object.isGetterSetter()) {
ASSERT(m_structure->hasGetterSetterProperties());
asGetterSetter(object)->setSetter(setterFunction);
return;
}
PutPropertySlot slot;
GetterSetter* getterSetter = new (exec) GetterSetter(exec);
putDirectInternal(exec->globalData(), propertyName, getterSetter, attributes | Setter, true, slot);
// putDirect will change our Structure if we add a new property. For
// getters and setters, though, we also need to change our Structure
// if we override an existing non-getter or non-setter.
if (slot.type() != PutPropertySlot::NewProperty) {
if (!m_structure->isDictionary()) {
RefPtr<Structure> structure = Structure::getterSetterTransition(m_structure);
setStructure(structure.release());
}
}
m_structure->setHasGetterSetterProperties(true);
getterSetter->setSetter(setterFunction);
}
示例2: TiValue
static ALWAYS_INLINE TiValue callDefaultValueFunction(TiExcState* exec, const TiObject* object, const Identifier& propertyName)
{
TiValue function = object->get(exec, propertyName);
CallData callData;
CallType callType = function.getCallData(callData);
if (callType == CallTypeNone)
return exec->exception();
// Prevent "toString" and "valueOf" from observing execution if an exception
// is pending.
if (exec->hadException())
return exec->exception();
TiValue result = call(exec, function, callType, callData, const_cast<TiObject*>(object), exec->emptyList());
ASSERT(!result.isGetterSetter());
if (exec->hadException())
return exec->exception();
if (result.isObject())
return TiValue();
return result;
}