From de32082a62ef826fc7b77b83f0c3d5e725a82f09 Mon Sep 17 00:00:00 2001 From: Claus Augusti Date: Wed, 15 Apr 2015 13:56:38 +0200 Subject: [PATCH] changed the toInt()'s function behavior so that it returns 0 on empty strings --- src/js/lib/helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/lib/helper.js b/src/js/lib/helper.js index 8226db4..14f49b6 100644 --- a/src/js/lib/helper.js +++ b/src/js/lib/helper.js @@ -8,7 +8,7 @@ var cls = require('./class') exports.toInt = function (x) { if (typeof x === 'string') { - return parseInt(x, 10); + return parseInt(x, 10) || 0; } else { return ~~x; }