本文整理汇总了C++中TestEventTarget类的典型用法代码示例。如果您正苦于以下问题:C++ TestEventTarget类的具体用法?C++ TestEventTarget怎么用?C++ TestEventTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestEventTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: namedPropertyDeleter
static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
bool result = collection->anonymousNamedDeleter(propertyName);
return v8SetReturnValueBool(info, result);
}
示例2: namedPropertyDeleter
static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
DeleteResult result = imp->anonymousNamedDeleter(propertyName);
if (result != DeleteUnknownProperty)
return v8SetReturnValueBool(info, result == DeleteSuccess);
}
示例3: namedItemMethod
static v8::Handle<v8::Value> namedItemMethod(const v8::Arguments& args)
{
if (args.Length() < 1)
return throwNotEnoughArgumentsError(args.GetIsolate());
TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, args[0]);
return toV8(imp->namedItem(name), args.Holder(), args.GetIsolate());
}
示例4: indexedPropertyGetter
static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
RefPtr<Node> result = imp->item(index);
if (!result)
return;
v8SetReturnValueFast(info, result.release(), imp);
}
示例5: indexedPropertyDeleter
static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
bool result = collection->anonymousIndexedDeleter(index, exceptionState);
if (exceptionState.throwIfNeeded())
return;
return v8SetReturnValueBool(info, result);
}
示例6: indexedPropertySetter
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
V8TRYCATCH_VOID(Node*, propertyValue, V8Node::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
bool result = collection->anonymousIndexedSetter(index, propertyValue);
if (!result)
return;
v8SetReturnValue(info, jsValue);
}
示例7: indexedPropertyGetter
static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
RefPtr<Node> element = collection->item(index);
if (!element)
return;
v8SetReturnValueFast(info, element.release(), collection);
}
示例8: itemMethod
static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwTypeError(ExceptionMessages::failedToExecute("item", "TestEventTarget", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
return;
}
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
V8TRYCATCH_VOID(unsigned, index, toUInt32(info[0]));
v8SetReturnValue(info, imp->item(index));
}
示例9: namedItemMethod
static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestEventTarget", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
return;
}
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
v8SetReturnValue(info, imp->namedItem(name));
}
示例10: indexedPropertyDeleter
static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
DeleteResult result = imp->anonymousIndexedDeleter(index, exceptionState);
if (exceptionState.throwIfNeeded())
return;
if (result != DeleteUnknownProperty)
return v8SetReturnValueBool(info, result == DeleteSuccess);
}
示例11: itemMethod
static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestEventTarget", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
exceptionState.throwIfNeeded();
return;
}
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
v8SetReturnValue(info, imp->item(index));
}
示例12: namedPropertyQuery
static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
TestEventTarget* collection = V8TestEventTarget::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);
}
示例13: namedPropertyEnumerator
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
TestEventTarget* collection = V8TestEventTarget::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);
}
示例14: 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;
TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
RefPtr<Node> result = imp->namedItem(propertyName);
if (!result)
return;
v8SetReturnValueFast(info, result.release(), imp);
}
示例15: jsTestEventTargetPrototypeFunctionRemoveEventListener
EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestEventTarget::s_info))
return throwVMTypeError(exec);
JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
impl->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
}