本文整理汇总了C++中PropertySlot::setBase方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertySlot::setBase方法的具体用法?C++ PropertySlot::setBase怎么用?C++ PropertySlot::setBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertySlot
的用法示例。
在下文中一共展示了PropertySlot::setBase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOwnPropertySlot
bool AJCell::getOwnPropertySlot(ExecState* exec, unsigned identifier, PropertySlot& slot)
{
// This is not a general purpose implementation of getOwnPropertySlot.
// It should only be called by AJValue::get.
// It calls getPropertySlot, not getOwnPropertySlot.
AJObject* object = toObject(exec);
slot.setBase(object);
if (!object->getPropertySlot(exec, identifier, slot))
slot.setUndefined();
return true;
}
示例2: getOwnPropertySlot
bool JSCell::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot)
{
// This is not a general purpose implementation of getOwnPropertySlot.
// It should only be called by JSValue::get.
// It calls getPropertySlot, not getOwnPropertySlot.
JSObject* object = toObject(exec, exec->lexicalGlobalObject());
slot.setBase(object);
if (!object->getPropertySlot(exec, identifier, slot))
slot.setUndefined();
return true;
}
示例3: getOwnPropertySlot
bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
JSString* thisObject = jsCast<JSString*>(cell);
// The semantics here are really getPropertySlot, not getOwnPropertySlot.
// This function should only be called by JSValue::get.
if (thisObject->getStringPropertySlot(exec, propertyName, slot))
return true;
slot.setBase(thisObject);
JSObject* object;
for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {
object = asObject(prototype);
if (object->methodTable()->getOwnPropertySlot(object, exec, propertyName, slot))
return true;
}
slot.setUndefined();
return true;
}
示例4: getOwnPropertySlot
bool JSString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
// The semantics here are really getPropertySlot, not getOwnPropertySlot.
// This function should only be called by JSValue::get.
if (getStringPropertySlot(exec, propertyName, slot))
return true;
if (propertyName == exec->propertyNames().underscoreProto) {
slot.setValue(exec->lexicalGlobalObject()->stringPrototype());
return true;
}
slot.setBase(this);
JSObject* object;
for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {
object = asObject(prototype);
if (object->getOwnPropertySlot(exec, propertyName, slot))
return true;
}
slot.setUndefined();
return true;
}