本文整理汇总了C++中JSStorage::prototype方法的典型用法代码示例。如果您正苦于以下问题:C++ JSStorage::prototype方法的具体用法?C++ JSStorage::prototype怎么用?C++ JSStorage::prototype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSStorage
的用法示例。
在下文中一共展示了JSStorage::prototype方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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);
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;
}