!360 [napi tool]Modify pxt valid judgement repeat

Merge pull request !360 from zhaojunxia/master
This commit is contained in:
openharmony_ci 2024-01-25 06:22:02 +00:00 committed by Gitee
commit 4fa9693163
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 1 additions and 16 deletions

View File

@ -68,9 +68,6 @@ napi_value [middleClassName][funcName]_middle(napi_env env, napi_callback_info i
[unwarp_instance]
struct [funcName]_value_struct *vio = new [funcName]_value_struct();
[valueCheckout][optionalCallbackInit][start_async]
if (pxt->IsFailed()) {
result = pxt->GetError();
}
return result;
}`

View File

@ -45,9 +45,6 @@ napi_value [middleClassName][funcName]_middle(napi_env env, napi_callback_info i
napi_value result = nullptr;
[valuePackage][optionalParamDestory]
delete vio;
if (pxt->IsFailed()) {
result = pxt->GetError();
}
delete pxt; // release
return result;
}`

View File

@ -50,9 +50,6 @@ napi_value [middleClassName][funcName]_middle(napi_env env, napi_callback_info i
napi_value result = pxt->UndefinedValue();
delete vio;
if (pxt->IsFailed()) {
result = pxt->GetError();
}
delete pxt; // release
return result;
}

View File

@ -64,9 +64,6 @@ napi_value [middleClassName][funcName]_middle(napi_env env, napi_callback_info i
[optionalParamDestory]
delete vio;
if (pxt->IsFailed()) {
result = pxt->GetError();
}
delete pxt; // release
return result;
}`
@ -194,7 +191,7 @@ function fillValueStruct(type, param, outName) {
if (param.callback.returnType === 'void') {
param.valueDefine += "%sbool& %s".format(param.valueDefine.length > 0 ? ", " : "", outName)
}
} else if (type.substring(0, 12) == "NUMBER_TYPE_") {
} else if (type.substring(0, 12) === "NUMBER_TYPE_") {
param.valueOut += '%s %s;\n'.format(type, outName)
if (param.callback.returnType === 'void') {
param.valueDefine += "%s%s& %s".format(param.valueDefine.length > 0 ? ", " : "", type, outName)

View File

@ -71,9 +71,6 @@ napi_value [middleClassName]createThreadSafeFunc[funcName]_middle(napi_env env,
XNapiTool::CallThreadSafeFunc(vio->eventName);
napi_value result = pxt->UndefinedValue();
delete vio;
if (pxt->IsFailed()) {
result = pxt->GetError();
}
delete pxt; // release
return result;
}