for .. in loop for Array is causing errors when Array.prototype is extended
On this line https://github.com/oracle/node-oracledb/blob/afb9f696ca7dbdd72150ba5efdc94f3ebffb4133/lib/thin/sqlnet/ezConnectResolver.js#L223 the for...in loop is used which causes an error when Array.prototype is extended since it iterates over the added methods.
Changing the for...in to for...of fixes the issue.
The framework i use Total.js framework v4 is extending the Array prototype by many useful methods.
Example without Total.js:
% node
Welcome to Node.js v20.10.0.
Type ".help" for more information.
> for (const a in [1]) console.log(a)
1
Example with Total.js:
Welcome to Node.js v20.10.0.
Type ".help" for more information.
> require('total4')
> for (const a in [1]) console.log(a)
0
take
first
toObject
last
quicksort
trim
skip
findAll
findValue
findItem
remove
wait
async
random
limit
Thanks @molda. We will fix it in the next release after looking at how the for loop has been used.
Were you using the Total.js framework with our previous releases?
Thanks @sharadraju for the quick answer. No i never used oracledb before.
This has been fixed in the 6.5 release. @molda Please verify.
Thank you @sharadraju I'll test it when i have time and report back if needed.