mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-22 09:15:27 -04:00
Fix brightness collapsion of settings
Signed-off-by: zhangyukun <zhangyukun8@huawei.com> Change-Id: I19e27f716f5339ea838d252d1997b3e6f9b4a970
This commit is contained in:
@@ -144,18 +144,16 @@ Local<JSValueRef> ArkNativeFunction::NativeFunctionCallBack(EcmaVM* vm,
|
||||
Global<JSValueRef> ret(vm, JSValueRef::Undefined(vm));
|
||||
if (result == nullptr) {
|
||||
if (engine->IsExceptionPending()) {
|
||||
NativeValue* error = engine->GetAndClearLastException();
|
||||
if (error != nullptr) {
|
||||
ret = *error;
|
||||
}
|
||||
} else {
|
||||
ret = Global<JSValueRef>(vm, JSValueRef::Undefined(vm));
|
||||
[[maybe_unused]] NativeValue *error = engine->GetAndClearLastException();
|
||||
}
|
||||
} else {
|
||||
ret = *result;
|
||||
}
|
||||
auto localRet = ret.ToLocal(vm);
|
||||
scopeManager->Close(nativeScope);
|
||||
if (localRet.IsEmpty()) {
|
||||
return scope.Escape(JSValueRef::Undefined(vm));
|
||||
}
|
||||
return scope.Escape(localRet);
|
||||
}
|
||||
|
||||
@@ -207,18 +205,16 @@ Local<JSValueRef> ArkNativeFunction::NativeClassFunctionCallBack(EcmaVM* vm,
|
||||
Global<JSValueRef> ret(vm, JSValueRef::Undefined(vm));
|
||||
if (result == nullptr) {
|
||||
if (engine->IsExceptionPending()) {
|
||||
NativeValue* error = engine->GetAndClearLastException();
|
||||
if (error != nullptr) {
|
||||
ret = *error;
|
||||
}
|
||||
} else {
|
||||
ret = Global<JSValueRef>(vm, JSValueRef::Undefined(vm));
|
||||
[[maybe_unused]] NativeValue *error = engine->GetAndClearLastException();
|
||||
}
|
||||
} else {
|
||||
ret = *result;
|
||||
}
|
||||
auto localRet = ret.ToLocal(vm);
|
||||
scopeManager->Close(nativeScope);
|
||||
if (localRet.IsEmpty()) {
|
||||
return scope.Escape(JSValueRef::Undefined(vm));
|
||||
}
|
||||
return scope.Escape(localRet);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user