本文整理汇总了C++中TestInterface类的典型用法代码示例。如果您正苦于以下问题:C++ TestInterface类的具体用法?C++ TestInterface怎么用?C++ TestInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestInterface类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: namedPropertyGetter
static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
return;
if (info.Holder()->HasRealNamedCallbackProperty(name))
return;
if (info.Holder()->HasRealNamedProperty(name))
return;
TestInterface* collection = V8TestInterface::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
bool element0Enabled = false;
RefPtr<Node> element0;
bool element1Enabled = false;
RefPtr<NodeList> element1;
collection->getItem(propertyName, element0Enabled, element0, element1Enabled, element1);
if (element0Enabled) {
v8SetReturnValueFast(info, element0.release(), collection);
return;
}
if (element1Enabled) {
v8SetReturnValueFast(info, element1.release(), collection);
return;
}
return;
}
示例2: jsTestInterfacePrototypeFunctionImplementsMethod2
EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(JSTestInterface::info()))
return throwVMTypeError(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
if (exec->argumentCount() < 2)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
ExceptionCode ec = 0;
ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
if (!scriptContext)
return JSValue::encode(jsUndefined());
const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(exec->argument(1)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->implementsMethod2(scriptContext, strArg, objArg, ec)));
setDOMException(exec, ec);
return JSValue::encode(result);
}
示例3: namedPropertyGetter
static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (info.Holder()->HasRealNamedProperty(name))
return;
if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
return;
TestInterface* impl = V8TestInterface::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
bool result0Enabled = false;
RefPtr<Node> result0;
bool result1Enabled = false;
RefPtr<NodeList> result1;
impl->getItem(propertyName, result0Enabled, result0, result1Enabled, result1);
if (!result0Enabled && !result1Enabled)
return;
if (result0Enabled) {
v8SetReturnValueFast(info, WTF::getPtr(result0.release()), impl);
return;
}
if (result1Enabled) {
v8SetReturnValueFast(info, WTF::getPtr(result1.release()), impl);
return;
}
v8SetReturnValueNull(info);
}
示例4: jsTestInterfaceImplementsNode
JSValue jsTestInterfaceImplementsNode(ExecState* exec, JSValue slotBase, PropertyName)
{
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->implementsNode()));
return result;
}
示例5: jsTestInterfaceImplementsStr2
JSValue jsTestInterfaceImplementsStr2(ExecState* exec, JSValue slotBase, PropertyName)
{
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
JSValue result = jsStringWithCache(exec, impl->implementsStr2());
return result;
}
示例6: setJSTestInterfaceImplementsNode
void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* thisObject, JSValue value)
{
UNUSED_PARAM(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
Node* nativeValue(toNode(value));
if (exec->hadException())
return;
impl->setImplementsNode(nativeValue);
}
示例7: setJSTestInterfaceImplementsStr2
void setJSTestInterfaceImplementsStr2(ExecState* exec, JSObject* thisObject, JSValue value)
{
UNUSED_PARAM(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
if (exec->hadException())
return;
impl->setImplementsStr2(nativeValue);
}
示例8: jsTestInterfacePrototypeFunctionImplementsMethod1
EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(JSTestInterface::info()))
return throwVMTypeError(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
impl->implementsMethod1();
return JSValue::encode(jsUndefined());
}
示例9: namedPropertyQuery
static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
TestInterface* collection = V8TestInterface::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
bool result = collection->namedPropertyQuery(propertyName, exceptionState);
if (exceptionState.throwIfNeeded())
return;
if (!result)
return;
v8SetReturnValueInt(info, v8::None);
}
示例10: namedPropertyEnumerator
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
TestInterface* collection = V8TestInterface::toNative(info.Holder());
Vector<String> names;
collection->namedPropertyEnumerator(names, exceptionState);
if (exceptionState.throwIfNeeded())
return;
v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
for (size_t i = 0; i < names.size(); ++i)
v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
v8SetReturnValue(info, v8names);
}
示例11: implementsEventHandlerAttributeAttributeGetter
static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface* impl = V8TestInterface::toNative(holder);
ASSERT(impl);
EventListener* v8Value = TestImplements::implementsEventHandlerAttribute(*impl);
v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
}
示例12: namedItemMethod
static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestInterface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
return;
}
TestInterface* impl = V8TestInterface::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
bool result0Enabled = false;
RefPtr<Node> result0;
bool result1Enabled = false;
RefPtr<NodeList> result1;
impl->getItem(name, result0Enabled, result0, result1Enabled, result1);
if (result0Enabled) {
v8SetReturnValue(info, result0.release());
return;
}
if (result1Enabled) {
v8SetReturnValue(info, result1.release());
return;
}
v8SetReturnValueNull(info);
}
示例13: implementsEventHandlerAttributeAttributeGetter
static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterface* imp = V8TestInterface::toNative(info.Holder());
EventListener* jsValue = TestImplements::implementsEventHandlerAttribute(imp, isolatedWorldForIsolate(info.GetIsolate()));
v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
}