当前位置: 首页>>代码示例>>C++>>正文


C++ VJSParms_callStaticFunction::GetExceptionRefPointer方法代码示例

本文整理汇总了C++中VJSParms_callStaticFunction::GetExceptionRefPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction::GetExceptionRefPointer方法的具体用法?C++ VJSParms_callStaticFunction::GetExceptionRefPointer怎么用?C++ VJSParms_callStaticFunction::GetExceptionRefPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VJSParms_callStaticFunction的用法示例。


在下文中一共展示了VJSParms_callStaticFunction::GetExceptionRefPointer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: do_include

void VJSGlobalClass::do_include( VJSParms_callStaticFunction& inParms, VJSGlobalObject *inGlobalObject)
{
	// EvaluateScript() uses NULL (this is default) as inThisObject argument. 
	// This works fine currently, but would it be better (if any problem) to pass global (application) object instead? 
	// See WAK0074064.

	VFile* file = inParms.RetainFileParam(1, false);
	if (file != NULL)
	{
		bool newlyRegistered = inGlobalObject->RegisterIncludedFile( file);		// sc 15/06/2010 the file must be registered
		if (inParms.GetBoolParam(2,"refresh","auto") || newlyRegistered)
		{
			inParms.GetContext().EvaluateScript( file, NULL, inParms.GetExceptionRefPointer());
		}
		file->Release();
	}
	else
	{
		VString pathname;
		if (inParms.IsStringParam(1) && inParms.GetStringParam( 1, pathname))
		{
			VFolder* folder = inGlobalObject->GetRuntimeDelegate()->RetainScriptsFolder();
			if (folder != NULL)
			{
				file = new VFile( *folder, pathname, FPS_POSIX);
				
				bool newlyRegistered = inGlobalObject->RegisterIncludedFile( file);		// sc 15/06/2010 the file must be registered
				if (inParms.GetBoolParam(2,"refresh","auto") || newlyRegistered)
				{
					inParms.GetContext().EvaluateScript( file, NULL, inParms.GetExceptionRefPointer());
				}
				ReleaseRefCountable( &file);
			}
			ReleaseRefCountable( &folder);
		}
		else
			vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:39,代码来源:VJSGlobalClass.cpp

示例2: do_testMe

void VJSGlobalClass::do_testMe( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
	VJSObject globalObject( inParms.GetContext().GetGlobalObject());
	
	VString functionName;
	inParms.GetStringParam( 1, functionName);
	
	std::vector<VJSValue> values;
	size_t count = inParms.CountParams();
	for( size_t i = 2 ; i <= count ; ++i)
		values.push_back( inParms.GetParamValue( i));

	VJSValue result( inParms.GetContextRef());
	bool ok = globalObject.CallMemberFunction( functionName, &values, &result, inParms.GetExceptionRefPointer());
	inParms.ReturnValue( result);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:16,代码来源:VJSGlobalClass.cpp


注:本文中的VJSParms_callStaticFunction::GetExceptionRefPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。