本文整理汇总了C++中JSString::getStringPropertySlot方法的典型用法代码示例。如果您正苦于以下问题:C++ JSString::getStringPropertySlot方法的具体用法?C++ JSString::getStringPropertySlot怎么用?C++ JSString::getStringPropertySlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSString
的用法示例。
在下文中一共展示了JSString::getStringPropertySlot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOwnPropertySlotByIndex
bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned 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;
return JSString::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
}
示例2: 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;
}
示例3: getOwnPropertySlot
bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
JSString* thisObject = static_cast<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;
if (propertyName == exec->propertyNames().underscoreProto) {
slot.setValue(exec->lexicalGlobalObject()->stringPrototype());
return true;
}
slot.setBase(thisObject);
JSObject* object;
for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {
object = asObject(prototype);
if (object->getOwnPropertySlotVirtual(exec, propertyName, slot))
return true;
}
slot.setUndefined();
return true;
}