Advertisement
Guest User

Untitled

a guest
Jun 26th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function (obj)
  2.     {
  3.         if (obj === null)
  4.             return "null";
  5.  
  6.         if (this.isPrimitiveValue(obj))
  7.             return null;
  8.  
  9.         if (this._isHTMLAllCollection(obj))
  10.             return "array";
  11.  
  12.         var preciseType = InjectedScriptHost.type(obj);
  13.         if (preciseType)
  14.             return preciseType;
  15.  
  16.         // FireBug's array detection.
  17.         try {
  18.             if (typeof obj.splice === "function" && isFinite(obj.length))
  19.                 return "array";
  20.             if (Object.prototype.toString.call(obj) === "[object Arguments]" && isFinite(obj.length)) // arguments.
  21.                 return "array";
  22.         } catch (e) {
  23.         }
  24.  
  25.         // If owning frame has navigated to somewhere else window properties will be undefined.
  26.         return null;
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement