Permalink
Browse files

Don't use Number constructor for number conversion

  • Loading branch information...
1 parent 57dd1ab commit aed0725469e28b097e14ca7fe348a78ccf74346d Christian Johansen committed Jan 7, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/validators/max_val.js
  2. +1 −1 src/validators/min_val.js
@@ -6,5 +6,5 @@
* @depends ../core/validator.js
*/
v2.Validator.reg('max-val', function(field, value, params) {
- return Number(value) <= Number(params[0]);
+ return +value <= params[0];
}, 'max');
@@ -6,5 +6,5 @@
* @depends ../core/validator.js
*/
v2.Validator.reg('min-val', function(field, value, params) {
- return Number(value) >= Number(params[0]);
+ return +value >= +params[0];
}, 'min');

0 comments on commit aed0725

Please sign in to comment.