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

Commit c184825a by Ruben Bridgewater

Fix a node-webkit issue

1 parent b9a0339b
Showing with 4 additions and 2 deletions
...@@ -8,7 +8,7 @@ var validateDeprecation = function(value, expectation, options) { ...@@ -8,7 +8,7 @@ var validateDeprecation = function(value, expectation, options) {
return; return;
} }
var valid = value instanceof options.deprecated; var valid = value instanceof options.deprecated || Object.prototype.toString.call(value) === Object.prototype.toString.call(options.deprecated.call());
if (valid) { if (valid) {
var message = util.format('%s should not be of type "%s"', util.inspect(value), options.deprecated.name); var message = util.format('%s should not be of type "%s"', util.inspect(value), options.deprecated.name);
...@@ -20,7 +20,9 @@ var validateDeprecation = function(value, expectation, options) { ...@@ -20,7 +20,9 @@ var validateDeprecation = function(value, expectation, options) {
}; };
var validate = function(value, expectation) { var validate = function(value, expectation) {
if (value instanceof expectation) { // the second part of this check is a workaround to deal with an issue that occurs in node-webkit when
// using object literals. https://github.com/sequelize/sequelize/issues/2685
if (value instanceof expectation || Object.prototype.toString.call(value) === Object.prototype.toString.call(expectation.call())) {
return true; return true;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!