Permalink
Browse files

Change the way the ‘length’ attribute reports errors

  • Loading branch information...
1 parent 56a3834 commit 1fc9fb25a9e8e0e5747070100abf93a2237b6773 @Baggz committed Mar 12, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/engines/json/attributes/length.js
@@ -2,13 +2,13 @@
* Length
*/
Validation.prototype.addAttributeConstructor('length', function lengthConstructor() {
-
return function length(property, propertyValue, attributeValue, propertyAttributes, callback) {
- if (isString(propertyValue) && propertyValue.length === attributeValue) {
- return callback();
- } else {
- return callback(true);
+
+ if (isString(propertyValue) && propertyValue.length !== attributeValue) {
+ this.addError();
}
- };
+ return callback();
+
+ };
});

0 comments on commit 1fc9fb2

Please sign in to comment.