本文整理汇总了C++中FunctionExecutable::paramString方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionExecutable::paramString方法的具体用法?C++ FunctionExecutable::paramString怎么用?C++ FunctionExecutable::paramString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionExecutable
的用法示例。
在下文中一共展示了FunctionExecutable::paramString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: functionProtoFuncToString
JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
{
if (thisValue.inherits(&JSFunction::info)) {
JSFunction* function = asFunction(thisValue);
if (!function->isHostFunction()) {
FunctionExecutable* executable = function->jsExecutable();
UString sourceString = executable->source().toString();
insertSemicolonIfNeeded(sourceString);
return jsString(exec, makeString("function ", function->name(exec), "(", executable->paramString(), ") ", sourceString));
}
}
if (thisValue.inherits(&InternalFunction::info)) {
InternalFunction* function = asInternalFunction(thisValue);
return jsString(exec, makeString("function ", function->name(exec), "() {\n [native code]\n}"));
}
#ifdef QT_BUILD_SCRIPT_LIB //same error message as in the old engine, and in mozilla
return throwError(exec, TypeError, "Function.prototype.toString called on incompatible object");
#else
return throwError(exec, TypeError);
#endif
}
示例2: functionProtoFuncToString
EncodedTiValue JSC_HOST_CALL functionProtoFuncToString(TiExcState* exec)
{
TiValue thisValue = exec->hostThisValue();
if (thisValue.inherits(&TiFunction::s_info)) {
TiFunction* function = asFunction(thisValue);
if (function->isHostFunction())
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
FunctionExecutable* executable = function->jsExecutable();
UString sourceString = executable->source().toString();
insertSemicolonIfNeeded(sourceString);
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "(", executable->paramString(), ") ", sourceString));
}
if (thisValue.inherits(&InternalFunction::s_info)) {
InternalFunction* function = asInternalFunction(thisValue);
return TiValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
}
return throwVMTypeError(exec);
}
示例3: functionProtoFuncToString
EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
if (thisValue.inherits(JSFunction::info())) {
JSFunction* function = jsCast<JSFunction*>(thisValue);
if (function->isHostOrBuiltinFunction())
return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
FunctionExecutable* executable = function->jsExecutable();
String sourceString = executable->source().toString();
insertSemicolonIfNeeded(sourceString, executable->bodyIncludesBraces());
return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "(", executable->paramString(), ") ", sourceString));
}
if (thisValue.inherits(InternalFunction::info())) {
InternalFunction* function = asInternalFunction(thisValue);
return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
}
return throwVMTypeError(exec);
}