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


C++ PropertySlot类代码示例

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


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

示例1: impl

bool JSLocation::getOwnPropertyDescriptorDelegate(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
    Frame* frame = impl()->frame();
    if (!frame) {
        descriptor.setUndefined();
        return true;
    }
    
    // throw out all cross domain access
    if (!shouldAllowAccessToFrame(exec, frame))
        return true;
    
    // Check for the few functions that we allow, even when called cross-domain.
    const HashEntry* entry = JSLocationPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    PropertySlot slot;
    if (entry && (entry->attributes() & JSC::Function)) {
        if (entry->function() == jsLocationPrototypeFunctionReplace) {
            slot.setCustom(this, nonCachingStaticReplaceFunctionGetter);
            descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
            return true;
        } else if (entry->function() == jsLocationPrototypeFunctionReload) {
            slot.setCustom(this, nonCachingStaticReloadFunctionGetter);
            descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
            return true;
        } else if (entry->function() == jsLocationPrototypeFunctionAssign) {
            slot.setCustom(this, nonCachingStaticAssignFunctionGetter);
            descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
            return true;
        }
    }
    
    // FIXME: Other implementers of the Window cross-domain scheme (Window, History) allow toString,
    // but for now we have decided not to, partly because it seems silly to return "[Object Location]" in
    // such cases when normally the string form of Location would be the URL.

    descriptor.setUndefined();
    return true;
}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:38,代码来源:JSLocationCustom.cpp

示例2: getOwnPropertyDescriptor

bool JSDOMTokenList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    const HashEntry* entry = JSDOMTokenListTable.entry(exec, propertyName);
    if (entry) {
        PropertySlot slot;
        slot.setCustom(this, entry->propertyGetter());
        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
        return true;
    }
    bool ok;
    unsigned index = propertyName.toUInt32(ok);
    if (ok && index < static_cast<DOMTokenList*>(impl())->length()) {
        PropertySlot slot;
        slot.setCustomIndex(this, index, indexGetter);
        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
        return true;
    }
    return getStaticValueDescriptor<JSDOMTokenList, Base>(exec, &JSDOMTokenListTable, this, propertyName, descriptor);
}
开发者ID:13W,项目名称:phantomjs,代码行数:19,代码来源:JSDOMTokenList.cpp

示例3: ASSERT

bool RuntimeArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
    RuntimeArray* thisObject = jsCast<RuntimeArray*>(object);
    if (propertyName == exec->propertyNames().length) {
        PropertySlot slot;
        slot.setCustom(thisObject, lengthGetter);
        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
        return true;
    }
    
    unsigned index = propertyName.asIndex();
    if (index < thisObject->getLength()) {
        ASSERT(index != PropertyName::NotAnIndex);
        PropertySlot slot;
        slot.setCustomIndex(thisObject, index, indexGetter);
        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | DontEnum);
        return true;
    }
    
    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:21,代码来源:runtime_array.cpp

示例4: getOwnPropertyDescriptor

bool RuntimeArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    if (propertyName == exec->propertyNames().length) {
        PropertySlot slot;
        slot.setCustom(this, lengthGetter);
        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
        return true;
    }
    
    bool ok;
    unsigned index = propertyName.toArrayIndex(ok);
    if (ok) {
        if (index < getLength()) {
            PropertySlot slot;
            slot.setCustomIndex(this, index, indexGetter);
            descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | DontEnum);
            return true;
        }
    }
    
    return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
}
开发者ID:1833183060,项目名称:wke,代码行数:22,代码来源:runtime_array.cpp

示例5: nameGetter

JSValuePtr JSHTMLFormElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    HTMLFormElement* form = static_cast<HTMLFormElement*>(static_cast<JSHTMLElement*>(asObject(slot.slotBase()))->impl());
    
    Vector<RefPtr<Node> > namedItems;
    form->getNamedElements(propertyName, namedItems);
    
    if (namedItems.size() == 1)
        return toJS(exec, namedItems[0].get());
    if (namedItems.size() > 1) 
        return new (exec) JSNamedNodesCollection(exec, namedItems);
    return jsUndefined();
}
开发者ID:arjunroy,项目名称:cinder_webkit,代码行数:13,代码来源:JSHTMLFormElementCustom.cpp

示例6: regExpConstructorLastParen

JSValuePtr regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    return asRegExpConstructor(slot.slotBase())->getLastParen(exec);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:4,代码来源:RegExpConstructor.cpp

示例7: regExpConstructorMultiline

JSValuePtr regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot)
{
    return jsBoolean(asRegExpConstructor(slot.slotBase())->multiline());
}
开发者ID:Fale,项目名称:qtmoko,代码行数:4,代码来源:RegExpConstructor.cpp

示例8: jsSVGFEFloodElementConstructor

JSValue jsSVGFEFloodElementConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSSVGFEFloodElement* domObject = static_cast<JSSVGFEFloodElement*>(asObject(slot.slotBase()));
    return JSSVGFEFloodElement::getConstructor(exec, domObject->globalObject());
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:5,代码来源:JSSVGFEFloodElement.cpp

示例9: lengthGetter

JSValue JSNamedNodesCollection::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSNamedNodesCollection* thisObj = static_cast<JSNamedNodesCollection*>(asObject(slot.slotBase()));
    return jsNumber(exec, thisObj->m_nodes->size());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:5,代码来源:JSNamedNodesCollection.cpp

示例10: indexGetter

JSValue JSNamedNodesCollection::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSNamedNodesCollection *thisObj = static_cast<JSNamedNodesCollection*>(asObject(slot.slotBase()));
    return toJS(exec, (*thisObj->m_nodes)[slot.index()].get());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:5,代码来源:JSNamedNodesCollection.cpp

示例11: regExpConstructorInput

JSValuePtr regExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    return jsString(exec, asRegExpConstructor(slot.slotBase())->input());
}
开发者ID:Fale,项目名称:qtmoko,代码行数:4,代码来源:RegExpConstructor.cpp

示例12: regExpConstructorLastMatch

JSValuePtr regExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 0);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:4,代码来源:RegExpConstructor.cpp

示例13: regExpConstructorRightContext

JSValuePtr regExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    return asRegExpConstructor(slot.slotBase())->getRightContext(exec);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:4,代码来源:RegExpConstructor.cpp

示例14: jsDocumentTypeConstructor

JSValue jsDocumentTypeConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSDocumentType* domObject = static_cast<JSDocumentType*>(asObject(slot.slotBase()));
    return JSDocumentType::getConstructor(exec, domObject->globalObject());
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:5,代码来源:JSDocumentType.cpp


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