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

Commit d9b280a5 by sdepold

correct equality check

1 parent 7b969728
Showing with 2 additions and 1 deletions
...@@ -162,7 +162,7 @@ module.exports = (function() { ...@@ -162,7 +162,7 @@ module.exports = (function() {
} }
//add default attributes //add default attributes
if(typeof instance[name] == 'undefined') { if(typeof instance[name] === 'undefined') {
var value = null var value = null
if(self.rawAttributes.hasOwnProperty(name) && self.rawAttributes[name].hasOwnProperty('defaultValue')) { if(self.rawAttributes.hasOwnProperty(name) && self.rawAttributes[name].hasOwnProperty('defaultValue')) {
...@@ -172,6 +172,7 @@ module.exports = (function() { ...@@ -172,6 +172,7 @@ module.exports = (function() {
instance[name] = value instance[name] = value
instance.addAttribute(name, value) instance.addAttribute(name, value)
} }
// add validation // add validation
if (self.rawAttributes.hasOwnProperty(name) && self.rawAttributes[name].hasOwnProperty('validate')) { if (self.rawAttributes.hasOwnProperty(name) && self.rawAttributes[name].hasOwnProperty('validate')) {
instance.setValidators(name, self.rawAttributes[name].validate) instance.setValidators(name, self.rawAttributes[name].validate)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!