本文整理汇总了C++中jsc::JSValue::inherits方法的典型用法代码示例。如果您正苦于以下问题:C++ JSValue::inherits方法的具体用法?C++ JSValue::inherits怎么用?C++ JSValue::inherits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsc::JSValue
的用法示例。
在下文中一共展示了JSValue::inherits方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type
JSValue WebInjectedScriptHost::type(JSC::ExecState* exec, JSC::JSValue value)
{
if (value.inherits(JSNode::info()))
return jsNontrivialString(exec, ASCIILiteral("node"));
if (value.inherits(JSNodeList::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(JSHTMLCollection::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
return jsUndefined();
}
示例2: subtype
JSValue WebInjectedScriptHost::subtype(JSC::ExecState* exec, JSC::JSValue value)
{
if (value.inherits(JSNode::info()))
return jsNontrivialString(exec, ASCIILiteral("node"));
if (value.inherits(JSNodeList::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(JSHTMLCollection::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
DOM_EXCEPTION_INTERFACES_FOR_EACH(RETURN_ERROR_IF_VALUE_INHERITS_EXCEPTION_TYPE)
return jsUndefined();
}
示例3: throwError
static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec, JSC::JSObject *callee,
JSC::JSValue thisValue, const JSC::ArgList &args)
{
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
thisValue = engine->toUsableValue(thisValue);
if (!thisValue.inherits(&QScriptObject::info))
return throwError(exec, JSC::TypeError, "This object is not a QVariant");
QScriptObjectDelegate *delegate = static_cast<QScriptObject*>(JSC::asObject(thisValue))->delegate();
if (!delegate || (delegate->type() != QScriptObjectDelegate::Variant))
return throwError(exec, JSC::TypeError, "This object is not a QVariant");
const QVariant &v = static_cast<QVariantDelegate*>(delegate)->value();
JSC::UString result;
JSC::JSValue value = variantProtoFuncValueOf(exec, callee, thisValue, args);
if (value.isObject()) {
result = v.toString();
if (result.isEmpty() && !v.canConvert(QVariant::String))
result = QString::fromLatin1("QVariant(%0)").arg(QString::fromLatin1(v.typeName()));
} else {
result = value.toString(exec);
}
return JSC::jsString(exec, result);
}
示例4: isHTMLAllCollection
bool WebInjectedScriptHost::isHTMLAllCollection(JSC::JSValue value)
{
return value.inherits(JSHTMLAllCollection::info());
}
示例5: toSVGLength
SVGLength toSVGLength(JSC::JSValue value)
{
return value.inherits(&JSSVGLength::s_info) ? (SVGLength) *static_cast<JSSVGLength*>(asObject(value))->impl() : SVGLength();
}