不要怂,就是干,撸起袖子干!

Commit 5da0c239 by wenyuxiang

remove side effect in Util.format to fix bug `some function will modify passed arguments`.

1 parent 253b149a
......@@ -547,7 +547,7 @@ module.exports = (function() {
result = smth
}
else if (Array.isArray(smth)) {
result = Utils.format(smth.slice(0), "postgres")
result = Utils.format(smth, "postgres")
}
return result
......
......@@ -55,7 +55,7 @@ var Utils = module.exports = {
},
format: function(arr, dialect) {
var timeZone = null;
return SqlString.format(arr.shift(), arr, timeZone, dialect)
return SqlString.format(arr[0], arr.slice(1), timeZone, dialect)
},
formatNamedParameters: function(sql, parameters, dialect) {
var timeZone = null;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!