diff --git a/ecmascript/napi/jsnapi_expo.cpp b/ecmascript/napi/jsnapi_expo.cpp index 2c0d41f8566180048fd9a053c67d272b9a452ac6..72fc943f3bd51f8539ff1e8d77712bb64088af8e 100644 --- a/ecmascript/napi/jsnapi_expo.cpp +++ b/ecmascript/napi/jsnapi_expo.cpp @@ -18,6 +18,7 @@ #include "ecmascript/base/json_stringifier.h" #include "ecmascript/base/typed_array_helper-inl.h" #include "ecmascript/builtins/builtins_object.h" +#include "ecmascript/shared_objects/concurrent_api_scope.h" #if defined(ECMASCRIPT_SUPPORT_CPUPROFILER) #include "ecmascript/dfx/cpu_profiler/cpu_profiler.h" #endif @@ -3938,6 +3939,8 @@ Local SendableArrayRef::GetValueAt(const EcmaVM *vm, Local object = JSNApiHelper::ToJSHandle(obj); + // Add Concurrent check for shared array + [[maybe_unused]] ecmascript::ConcurrentApiScope scope(thread, object); JSHandle result = ecmascript::JSSharedArray::FastGetPropertyByValue(thread, object, index); return JSNApiHelper::ToLocal(result); }