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


C++ JSStorage类代码示例

本文整理汇总了C++中JSStorage的典型用法代码示例。如果您正苦于以下问题:C++ JSStorage类的具体用法?C++ JSStorage怎么用?C++ JSStorage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JSStorage类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nameGetter

JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
    JSStorage* thisObj = jsCast<JSStorage*>(asObject(slotBase));
        
    JSValue prototype = asObject(slotBase)->prototype();
    if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
        return asObject(prototype)->get(exec, propertyName);
 
    return jsStringOrNull(exec, thisObj->impl()->getItem(identifierToString(propertyName)));
}
开发者ID:Moondee,项目名称:Artemis,代码行数:10,代码来源:JSStorageCustom.cpp

示例2: jsStoragePrototypeFunctionClear

JSValue JSC_HOST_CALL jsStoragePrototypeFunctionClear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSStorage::s_info))
        return throwError(exec, TypeError);
    JSStorage* castedThisObj = static_cast<JSStorage*>(asObject(thisValue));
    Storage* imp = static_cast<Storage*>(castedThisObj->impl());

    imp->clear();
    return jsUndefined();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:11,代码来源:JSStorage.cpp

示例3: jsStoragePrototypeFunctionRemoveItem

JSValue JSC_HOST_CALL jsStoragePrototypeFunctionRemoveItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSStorage::s_info))
        return throwError(exec, TypeError);
    JSStorage* castedThisObj = static_cast<JSStorage*>(asObject(thisValue));
    Storage* imp = static_cast<Storage*>(castedThisObj->impl());
    const UString& key = args.at(0).toString(exec);

    imp->removeItem(key);
    return jsUndefined();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:12,代码来源:JSStorage.cpp

示例4: nameGetter

JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
    JSStorage* thisObj = jsCast<JSStorage*>(asObject(slotBase));
        
    JSValue prototype = asObject(slotBase)->prototype();
    if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
        return asObject(prototype)->get(exec, propertyName);
 
    ExceptionCode ec = 0;
    JSValue result = jsStringOrNull(exec, thisObj->impl()->getItem(propertyNameToString(propertyName), ec));
    setDOMException(exec, ec);
    return result;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:13,代码来源:JSStorageCustom.cpp

示例5: nameGetter

EncodedJSValue JSStorage::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
{
    JSStorage* thisObject = jsCast<JSStorage*>(slotBase);
    JSValue prototype = thisObject->prototype();
    PropertySlot slot(thisObject);
    if (prototype.isObject() && asObject(prototype)->getPropertySlot(exec, propertyName, slot))
        return JSValue::encode(slot.getValue(exec, propertyName));

    ExceptionCode ec = 0;
    JSValue result = jsStringOrNull(exec, thisObject->impl().getItem(propertyNameToString(propertyName), ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
开发者ID:PTaylour,项目名称:webkit,代码行数:13,代码来源:JSStorageCustom.cpp

示例6: getOwnPropertyNames

void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
    JSStorage* thisObject = jsCast<JSStorage*>(object);
    ExceptionCode ec = 0;
    unsigned length = thisObject->wrapped().length(ec);
    setDOMException(exec, ec);
    if (exec->hadException())
        return;
    for (unsigned i = 0; i < length; ++i) {
        propertyNames.add(Identifier::fromString(exec, thisObject->wrapped().key(i, ec)));
        setDOMException(exec, ec);
        if (exec->hadException())
            return;
    }
        
    Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
开发者ID:edcwconan,项目名称:webkit,代码行数:17,代码来源:JSStorageCustom.cpp

示例7: deleteProperty

bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
    JSStorage* thisObject = jsCast<JSStorage*>(cell);
    // Only perform the custom delete if the object doesn't have a native property by this name.
    // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
    // the native property slots manually.
    PropertySlot slot;
    if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), thisObject, propertyName, slot))
        return false;
        
    JSValue prototype = thisObject->prototype();
    if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
        return false;

    thisObject->m_impl->removeItem(identifierToString(propertyName));
    return true;
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:17,代码来源:JSStorageCustom.cpp

示例8: slot

bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
    JSStorage* thisObject = jsCast<JSStorage*>(cell);
    // Only perform the custom delete if the object doesn't have a native property by this name.
    // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
    // the native property slots manually.
    PropertySlot slot(thisObject);
    if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.staticPropHashTable, thisObject, propertyName, slot))
        return false;
        
    JSValue prototype = thisObject->prototype();
    if (prototype.isObject() && asObject(prototype)->getPropertySlot(exec, propertyName, slot))
        return false;

    ExceptionCode ec = 0;
    thisObject->m_impl->removeItem(propertyNameToString(propertyName), ec);
    setDOMException(exec, ec);
    return true;
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:19,代码来源:JSStorageCustom.cpp

示例9: deleteProperty

bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
    JSStorage* thisObject = jsCast<JSStorage*>(cell);
    // Only perform the custom delete if the object doesn't have a native property by this name.
    // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
    // the native property slots manually.
    PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty);

    static_assert(!hasStaticPropertyTable, "This function does not handle static instance properties");

    JSValue prototype = thisObject->getPrototypeDirect();
    if (prototype.isObject() && asObject(prototype)->getPropertySlot(exec, propertyName, slot))
        return Base::deleteProperty(thisObject, exec, propertyName);

    if (propertyName.isSymbol())
        return Base::deleteProperty(thisObject, exec, propertyName);

    ExceptionCode ec = 0;
    thisObject->wrapped().removeItem(propertyNameToString(propertyName), ec);
    setDOMException(exec, ec);
    return true;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:22,代码来源:JSStorageCustom.cpp

示例10: nameGetter

JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
    JSStorage* thisObj = static_cast<JSStorage*>(asObject(slotBase));
    return jsStringOrNull(exec, thisObj->impl()->getItem(identifierToString(propertyName)));
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:5,代码来源:JSStorageCustom.cpp

示例11: nameGetter

JSValue* JSStorage::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSStorage* thisObj = static_cast<JSStorage*>(slot.slotBase());
    return jsStringOrNull(exec, thisObj->impl()->getItem(propertyName));
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:5,代码来源:JSStorageCustom.cpp


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