Commit 6893eb57 6893eb57116d7ec5e239f73bb10933f0cc827e38 by Nicolas Perriault

fixed utils.isTruthy() and utils.isFalsy()

1 parent 940b862f
...@@ -295,7 +295,7 @@ exports.isClipRect = isClipRect; ...@@ -295,7 +295,7 @@ exports.isClipRect = isClipRect;
295 function isFalsy(subject) { 295 function isFalsy(subject) {
296 "use strict"; 296 "use strict";
297 /*jshint eqeqeq:false*/ 297 /*jshint eqeqeq:false*/
298 return subject == new Function('return false;')(); 298 return !subject;
299 } 299 }
300 exports.isFalsy = isFalsy; 300 exports.isFalsy = isFalsy;
301 /** 301 /**
...@@ -392,7 +392,7 @@ exports.isString = isString; ...@@ -392,7 +392,7 @@ exports.isString = isString;
392 function isTruthy(subject) { 392 function isTruthy(subject) {
393 "use strict"; 393 "use strict";
394 /*jshint eqeqeq:false*/ 394 /*jshint eqeqeq:false*/
395 return subject == new Function('return true;')(); 395 return !!subject;
396 } 396 }
397 exports.isTruthy = isTruthy; 397 exports.isTruthy = isTruthy;
398 398
......