Firefoxでちょこっとチェックしただけです。五分ぐらいで適当に書いているのだけど、毎回毎回書くのは時間の無駄なので。 function toSource(obj, indent) { indent = indent || ""; if (obj === null) return indent + "null"; if (obj === void 0) return indent + "undefined"; if (obj.setTimeout) return indent + "[object Window]"; if (obj.nodeType === 9) return indent + "[object Document]"; if (obj.nodeType) return indent + "[object " + (obj.tagName || "") + " Node]