Merge pull request #321 from juxtapos/toInt-fix

changed toInt()'s function behavior
This commit is contained in:
Jun
2015-04-15 21:39:10 +09:00

View File

@@ -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;
}