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


C++ JSTestCustomNamedGetter类代码示例

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


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

示例1: jsTestCustomNamedGetterConstructor

EncodedJSValue jsTestCustomNamedGetterConstructor(ExecState* state, JSObject*, EncodedJSValue thisValue, PropertyName)
{
    JSTestCustomNamedGetter* domObject = jsDynamicCast<JSTestCustomNamedGetter*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(state);
    return JSValue::encode(JSTestCustomNamedGetter::getConstructor(state->vm(), domObject->globalObject()));
}
开发者ID:allsmy,项目名称:webkit,代码行数:7,代码来源:JSTestCustomNamedGetter.cpp

示例2: ASSERT_GC_OBJECT_INHERITS

bool JSTestCustomNamedGetter::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
        return true;
    }
    return getStaticValueSlot<JSTestCustomNamedGetter, Base>(exec, JSTestCustomNamedGetterTable, thisObject, propertyName, slot);
}
开发者ID:kodybrown,项目名称:webkit,代码行数:10,代码来源:JSTestCustomNamedGetter.cpp

示例3: getOwnPropertySlotByIndex

bool JSTestCustomNamedGetter::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
{
    JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    PropertyName propertyName = Identifier::from(exec, index);
    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
        return true;
    }
    return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
}
开发者ID:kodybrown,项目名称:webkit,代码行数:11,代码来源:JSTestCustomNamedGetter.cpp

示例4: jsTestCustomNamedGetterPrototypeFunctionAnotherFunction

EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunction(ExecState* state)
{
    JSValue thisValue = state->thisValue();
    JSTestCustomNamedGetter* castedThis = jsDynamicCast<JSTestCustomNamedGetter*>(thisValue);
    if (UNLIKELY(!castedThis))
        return throwThisTypeError(*state, "TestCustomNamedGetter", "anotherFunction");
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestCustomNamedGetter::info());
    auto& impl = castedThis->impl();
    if (UNLIKELY(state->argumentCount() < 1))
        return throwVMError(state, createNotEnoughArgumentsError(state));
    String str = state->argument(0).toString(state)->value(state);
    if (UNLIKELY(state->hadException()))
        return JSValue::encode(jsUndefined());
    impl.anotherFunction(str);
    return JSValue::encode(jsUndefined());
}
开发者ID:allsmy,项目名称:webkit,代码行数:16,代码来源:JSTestCustomNamedGetter.cpp


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