当前位置: 首页>>代码示例>>C++>>正文


C++ JSString::getStringPropertySlot方法代码示例

本文整理汇总了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);
}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:9,代码来源:JSString.cpp

示例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;
}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:17,代码来源:JSString.cpp

示例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;
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:21,代码来源:JSString.cpp


注:本文中的JSString::getStringPropertySlot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。