@@ -706,9 +706,6 @@ CallbackHandlers::GetMethodOverrides(napi_env env, JEnv &jEnv, napi_value implem
706
706
}
707
707
708
708
napi_value CallbackHandlers::RunOnMainThreadCallback (napi_env env, napi_callback_info info) {
709
-
710
- NapiScope scope (env);
711
-
712
709
size_t argc = 1 ;
713
710
napi_value args[1 ];
714
711
napi_get_cb_info (env, info, &argc, args, nullptr , nullptr );
@@ -973,12 +970,12 @@ napi_value CallbackHandlers::CallJSMethod(napi_env env, JNIEnv *_jEnv,
973
970
974
971
#ifndef __HERMES__
975
972
auto runtime = Runtime::GetRuntime (env);
976
- method = runtime->js_method_cache ->getCachedMethod (javaObjectId,methodName);
973
+ method = runtime->js_method_cache ->getCachedMethod (javaObjectId, methodName);
977
974
if (!method) {
978
975
#endif
979
976
napi_get_named_property (env, jsObject, methodName.c_str (), &method);
980
977
#ifndef __HERMES__
981
- if (! napi_util::is_null_or_undefined (env, method)) {
978
+ if (napi_util::is_of_type (env, method, napi_function )) {
982
979
runtime->js_method_cache ->cacheMethod (javaObjectId, methodName, method);
983
980
}
984
981
}
@@ -1121,7 +1118,6 @@ void CallbackHandlers::PostCallback(napi_env env, napi_callback_info info,
1121
1118
1122
1119
napi_value CallbackHandlers::PostFrameCallback (napi_env env, napi_callback_info info) {
1123
1120
if (android_get_device_api_level () >= 24 ) {
1124
- NapiScope scope (env);
1125
1121
InitChoreographer ();
1126
1122
1127
1123
size_t argc = 2 ;
@@ -1182,7 +1178,6 @@ napi_value CallbackHandlers::PostFrameCallback(napi_env env, napi_callback_info
1182
1178
1183
1179
napi_value CallbackHandlers::RemoveFrameCallback (napi_env env, napi_callback_info info) {
1184
1180
if (android_get_device_api_level () >= 24 ) {
1185
- NapiScope scope (env);
1186
1181
InitChoreographer ();
1187
1182
1188
1183
size_t argc = 1 ;
0 commit comments