本文整理汇总了C++中JSNodeList::globalObject方法的典型用法代码示例。如果您正苦于以下问题:C++ JSNodeList::globalObject方法的具体用法?C++ JSNodeList::globalObject怎么用?C++ JSNodeList::globalObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSNodeList
的用法示例。
在下文中一共展示了JSNodeList::globalObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsNodeListConstructor
EncodedJSValue jsNodeListConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
JSNodeList* domObject = jsDynamicCast<JSNodeList*>(JSValue::decode(thisValue));
if (!domObject)
return throwVMTypeError(exec);
if (!domObject)
return throwVMTypeError(exec);
return JSValue::encode(JSNodeList::getConstructor(exec->vm(), domObject->globalObject()));
}
示例2: jsNodeListPrototypeFunctionItem
EncodedJSValue JSC_HOST_CALL jsNodeListPrototypeFunctionItem(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSNodeList* castedThis = jsDynamicCast<JSNodeList*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSNodeList::info());
NodeList& impl = castedThis->impl();
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index)));
return JSValue::encode(result);
}
示例3: nameGetter
JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase));
return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyNameToAtomicString(propertyName)));
}
示例4: indexGetter
EncodedJSValue JSNodeList::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index)
{
JSNodeList* thisObj = jsCast<JSNodeList*>(JSValue::decode(slotBase));
ASSERT_GC_OBJECT_INHERITS(thisObj, info());
return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index)));
}