Js functions getting appended as attributes of objects
<p>I'm working on a merge method for js objects:</p>

<pre><code>Object.prototype.dup = function() {
  var key, temp;
  if (!(typeof this !== "undefined" &amp;&amp; this !== null) || typeof this !== "thisect") {
    return this;
  }
  temp = {};
  for (key in this) {
    temp[key] = this[key];
  }
  return temp;
};

Object.prototype.d_merge = function(o) {
  var key, _results;
  _results = [];
  for (key in o) {
    _results.push(this[key] = o[key]);
  }
  return _results;
};

Object.prototype.merge = function(o) {
  return this.dup().d_merge(o);
};
</code></pre>

<p>And works pretty fine, except:</p>

<pre><code>&gt; obj = {asdf: 1, qwer: 2}
&gt; obj.merge({uiop: 3})
Object
  asdf: 1
  d_merge: function (o) {
  dup: function () {
  merge: function (o) {
  qwer: 2
  uiop: 3
  __proto__: Object
</code></pre>

<p>The custom functions gets appended to my obj as attributes when I call them once. <strong>Is this bahavior unavoidable when messing around with <code>Object</code> class?</strong></p>

<p><strong>Note:</strong> I'm compiling this from a <a href="https://gist.github.com/nicooga/4947985" rel="nofollow">coffeescript</a>.</p>
