本文整理汇总了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()));
}
示例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);
}
示例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);
}
示例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());
}