Closed pangqianjin closed 1 year ago
In JavaScript, objects are typically passed by reference by default when you pass them as arguments to a function. This means that if you modify the object within the function, the changes will persist outside the function as well.
https://github.com/mde/ejs/blob/f47d7aedd51a983e4f73045f962b1209096b5800/lib/ejs.js#L422
I noticed this line, it tries to copy the properties from data to opts, but the function: utils.shallowCopyFromList only returns a new Object, giving value operation is for the local variable in function itself.
Should also give the returned value to the opts variable in this line will do it work.