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

Commit cf72ccd4 by Jan Aagaard Meier

Merge pull request #3802 from hariprasadkulkarni/master

Fixes #3799 hasOwnProperty is now called through Object.prototype
2 parents cc868753 c5203863
Showing with 4 additions and 4 deletions
...@@ -658,15 +658,15 @@ module.exports = (function() { ...@@ -658,15 +658,15 @@ module.exports = (function() {
} }
if (Utils._.isPlainObject(sql)) { if (Utils._.isPlainObject(sql)) {
if (sql.hasOwnProperty('values')) { if (Object.prototype.hasOwnProperty.call(sql,'values')) {
if (options.hasOwnProperty('replacements')) { if (Object.prototype.hasOwnProperty.call(options,'replacements')) {
throw new Error('Both `sql.values` and `options.replacements` cannot be set at the same time'); throw new Error('Both `sql.values` and `options.replacements` cannot be set at the same time');
} }
options.replacements = sql.values; options.replacements = sql.values;
} }
if (sql.hasOwnProperty('query')) { if (Object.prototype.hasOwnProperty.call(sql,'query')) {
sql = sql.query; sql = sql.query;
} }
} }
......
...@@ -156,7 +156,7 @@ SqlString.formatNamedParameters = function(sql, values, timeZone, dialect) { ...@@ -156,7 +156,7 @@ SqlString.formatNamedParameters = function(sql, values, timeZone, dialect) {
return value; return value;
} }
if (values.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(values,key)) {
return SqlString.escape(values[key], false, timeZone, dialect); return SqlString.escape(values[key], false, timeZone, dialect);
} else { } else {
throw new Error('Named parameter "' + value + '" has no value in the given object.'); throw new Error('Named parameter "' + value + '" has no value in the given object.');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!