Merge pull request #78 from pandaiolo/master

Fix, model builder setter will not try to cast value if already the proper type
This commit is contained in:
Raymond Feng 2014-02-27 10:38:28 -08:00
commit 925402fdb6
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
} else { } else {
// Assume the type constructor handles Constructor() call // Assume the type constructor handles Constructor() call
// If not, we should call new DataType(value).valueOf(); // If not, we should call new DataType(value).valueOf();
this.__data[propertyName] = DataType(value); this.__data[propertyName] = (value instanceof DataType) ? value : DataType(value);
} }
} }
} }