1- // Copyright (c) 2019, 2024 , Oracle and/or its affiliates.
1+ // Copyright (c) 2019, 2025 , Oracle and/or its affiliates.
22
33//-----------------------------------------------------------------------------
44//
@@ -109,7 +109,7 @@ bool njsAqQueue_setRecipients(njsBaton *baton, dpiMsgProps *handle,
109109static bool njsAqQueue_createMessage (njsBaton * baton , njsAqQueue * queue ,
110110 napi_env env , napi_value value , dpiMsgProps * * handle )
111111{
112- napi_value payloadObj , constructor , tempObj ;
112+ napi_value payloadObj , tempObj ;
113113 dpiMsgProps * tempHandle ;
114114 bool isDbObject ;
115115 size_t bufferLength ;
@@ -133,10 +133,8 @@ static bool njsAqQueue_createMessage(njsBaton *baton, njsAqQueue *queue,
133133 // set payload
134134 NJS_CHECK_NAPI (env , napi_get_named_property (env , value , "payload" ,
135135 & payloadObj ))
136- NJS_CHECK_NAPI (env , napi_get_reference_value (env ,
137- baton -> globals -> jsDbObjectConstructor , & constructor ))
138- NJS_CHECK_NAPI (env , napi_instanceof (env , payloadObj , constructor ,
139- & isDbObject ))
136+ NJS_CHECK_NAPI (env , napi_instanceof (env , payloadObj ,
137+ baton -> jsDbObjectConstructor , & isDbObject ))
140138 if (isDbObject ) {
141139 // DB Object
142140 if (!njsDbObject_getInstance (baton -> globals , env , payloadObj , & obj ))
@@ -413,6 +411,9 @@ NJS_NAPI_METHOD_IMPL_ASYNC(njsAqQueue_enq, 1, NULL)
413411 baton -> msgProps = calloc (baton -> numMsgProps , sizeof (dpiMsgProps * ));
414412 if (!baton -> msgProps )
415413 return njsBaton_setErrorInsufficientMemory (baton );
414+
415+ if (!njsBaton_setJsValues (baton , env ))
416+ return false;
416417 for (i = 0 ; i < baton -> numMsgProps ; i ++ ) {
417418 NJS_CHECK_NAPI (env , napi_get_element (env , args [0 ], i , & message ))
418419 if (!njsAqQueue_createMessage (baton , queue , env , message ,
0 commit comments