本文整理汇总了C++中CallbackInfo::GetIsolate方法的典型用法代码示例。如果您正苦于以下问题:C++ CallbackInfo::GetIsolate方法的具体用法?C++ CallbackInfo::GetIsolate怎么用?C++ CallbackInfo::GetIsolate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CallbackInfo
的用法示例。
在下文中一共展示了CallbackInfo::GetIsolate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getNamedItems
static v8::Local<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, const CallbackInfo& info)
{
WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems;
collection->namedItems(name, namedItems);
if (!namedItems.size())
return v8Undefined();
if (namedItems.size() == 1)
return toV8(namedItems.at(0).release(), info.Holder(), info.GetIsolate());
// FIXME: HTML5 specification says this should be a HTMLCollection.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
return toV8(StaticElementList::adopt(namedItems), info.Holder(), info.GetIsolate());
}
示例2: getItem
static v8::Local<v8::Value> getItem(HTMLAllCollection* collection, v8::Local<v8::Value> argument, const CallbackInfo& info)
{
v8::Local<v8::Uint32> index;
if (!argument->ToArrayIndex(info.GetIsolate()->GetCurrentContext()).ToLocal(&index)) {
TOSTRING_DEFAULT(V8StringResource<>, name, argument, v8::Undefined(info.GetIsolate()));
v8::Local<v8::Value> result = getNamedItems(collection, name, info);
if (result.IsEmpty())
return v8::Undefined(info.GetIsolate());
return result;
}
RefPtrWillBeRawPtr<Element> result = collection->item(index->Value());
return toV8(result.release(), info.Holder(), info.GetIsolate());
}
示例3: getItem
static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v8::Value> argument, const CallbackInfo& info)
{
v8::Local<v8::Uint32> index = argument->ToArrayIndex();
if (index.IsEmpty()) {
V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, name, argument, v8::Undefined(info.GetIsolate()));
v8::Handle<v8::Value> result = getNamedItems(collection, name, info);
if (result.IsEmpty())
return v8::Undefined(info.GetIsolate());
return result;
}
RefPtr<Element> result = collection->item(index->Uint32Value());
return toV8(result.release(), info.Holder(), info.GetIsolate());
}
示例4: getNamedItems
static v8::Handle<v8::Value> getNamedItems(HTMLFormControlsCollection* collection, const AtomicString& name, const CallbackInfo& callbackInfo)
{
Vector<RefPtr<Node> > namedItems;
collection->namedItems(name, namedItems);
if (!namedItems.size())
return v8Undefined();
if (namedItems.size() == 1)
return toV8(namedItems.at(0).release(), callbackInfo.Holder(), callbackInfo.GetIsolate());
return toV8(collection->ownerNode()->radioNodeList(name).get(), callbackInfo.Holder(), callbackInfo.GetIsolate());
}
示例5: getNamedItems
static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, const CallbackInfo& info)
{
WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems;
collection->namedItems(name, namedItems);
if (!namedItems.size())
return v8Undefined();
if (namedItems.size() == 1)
return toV8(namedItems.at(0).release(), info.Holder(), info.GetIsolate());
// FIXME: HTML5 specification says this should be a HTMLCollection.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
//
// FIXME: Oilpan: explicitly convert adopt()'s result so as to
// disambiguate the (implicit) conversion of its
// PassRefPtrWillBeRawPtr<StaticElementList> result -- the
// other toV8() overload that introduces the ambiguity is
// toV8(NodeList*, ...).
//
// When adopt() no longer uses transition types, the conversion
// can be removed.
return toV8(PassRefPtrWillBeRawPtr<NodeList>(StaticElementList::adopt(namedItems)), info.Holder(), info.GetIsolate());
}
示例6: TestInterfaceNamedConstructorCreateDataProperty
static bool TestInterfaceNamedConstructorCreateDataProperty(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
ASSERT(info.This()->IsObject());
return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
}
示例7: TestTypedefsForceSetAttributeOnThis
static void TestTypedefsForceSetAttributeOnThis(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
ASSERT(info.This()->IsObject());
v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCurrentContext(), name, v8Value);
}