本文整理汇总了C++中JSFunction::isClassConstructorFunction方法的典型用法代码示例。如果您正苦于以下问题:C++ JSFunction::isClassConstructorFunction方法的具体用法?C++ JSFunction::isClassConstructorFunction怎么用?C++ JSFunction::isClassConstructorFunction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFunction
的用法示例。
在下文中一共展示了JSFunction::isClassConstructorFunction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subtype
JSValue JSInjectedScriptHost::subtype(ExecState* exec)
{
if (exec->argumentCount() < 1)
return jsUndefined();
JSValue value = exec->uncheckedArgument(0);
if (value.isString())
return exec->vm().smallStrings.stringString();
if (value.isBoolean())
return exec->vm().smallStrings.booleanString();
if (value.isNumber())
return exec->vm().smallStrings.numberString();
if (value.isSymbol())
return exec->vm().smallStrings.symbolString();
JSObject* object = asObject(value);
if (object) {
if (object->isErrorInstance())
return jsNontrivialString(exec, ASCIILiteral("error"));
// Consider class constructor functions class objects.
JSFunction* function = jsDynamicCast<JSFunction*>(value);
if (function && function->isClassConstructorFunction())
return jsNontrivialString(exec, ASCIILiteral("class"));
}
if (value.inherits(JSArray::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(DirectArguments::info()) || value.inherits(ScopedArguments::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(DateInstance::info()))
return jsNontrivialString(exec, ASCIILiteral("date"));
if (value.inherits(RegExpObject::info()))
return jsNontrivialString(exec, ASCIILiteral("regexp"));
if (value.inherits(JSMap::info()))
return jsNontrivialString(exec, ASCIILiteral("map"));
if (value.inherits(JSSet::info()))
return jsNontrivialString(exec, ASCIILiteral("set"));
if (value.inherits(JSWeakMap::info()))
return jsNontrivialString(exec, ASCIILiteral("weakmap"));
if (value.inherits(JSWeakSet::info()))
return jsNontrivialString(exec, ASCIILiteral("weakset"));
if (value.inherits(JSArrayIterator::info())
|| value.inherits(JSMapIterator::info())
|| value.inherits(JSSetIterator::info())
|| value.inherits(JSStringIterator::info()))
return jsNontrivialString(exec, ASCIILiteral("iterator"));
if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
if (value.inherits(JSFloat32Array::info()) || value.inherits(JSFloat64Array::info()))
return jsNontrivialString(exec, ASCIILiteral("array"));
return impl().subtype(exec, value);
}