added a utility function to test for both null and undefined. popcorn-port
authorhamidouk
Mon, 16 Jan 2012 12:12:43 +0100
branchpopcorn-port
changeset 634 9de33a5ef2b3
parent 633 00a59060d78d
child 635 c33b08e0e7c4
added a utility function to test for both null and undefined.
src/js/utils.js
--- a/src/js/utils.js	Fri Jan 13 17:27:54 2012 +0100
+++ b/src/js/utils.js	Mon Jan 16 12:12:43 2012 +0100
@@ -148,6 +148,10 @@
   return "";
 };
 
+/** test if a value is null or undefined */
+IriSP.null_or_undefined = function(val) {
+  return (typeof(val) === "undefined" || val === null);
+}
 /* for ie compatibility
 if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
    Object.defineProperty=function(obj,prop,desc) {