Skip to content

Commit

Permalink
remove side effect in Util.format to fix bug `some function will modi…
Browse files Browse the repository at this point in the history
…fy passed arguments`.
  • Loading branch information
wenyuxiang committed Sep 15, 2013
1 parent 253b149 commit 5da0c23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dialects/postgres/query-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5da0c23

Please sign in to comment.