title: Object.prototype.__defineGetter__ (and __defineSetter__) polyfill
body: <p>I know the <code>__defineGetter__</code> (and <code>__defineSetter__</code>) method name is really <a href="http://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/" rel="nofollow">weird and deprecated</a> but I find it more convenient than <code>Object.defineProperty</code>. Compare yourself:</p>
  
  <pre><code>//Readable
  Something.prototype.__defineGetter__("name", function() {return this._name;});
  //Uh... - what?
  Object.defineProperty(Something.prototype, "name", {
                         get: function() {return this._name;}
                       });
  </code></pre>
  
  <p>Because, as I said, this method is being deprecated. So I'm creating a polyfill to put it back in bussiness:</p>
  
  <pre><code>if(!Object.prototype.__defineGetter__) {
    Object.prototype.__defineGetter__ = function(name, func) {
      Object.defineProperty(this, name, {
        get: func
      });
    }
  }
  </code></pre>
  
  <p>It really just calls the standard <code>Object.defineProperty</code>. I could name the <code>__defineGetter__</code> whatever I wanted. I just decided to stick to something that already existed.</p>
  
  <p>The problem here is that if I use <code>__defineGetter__</code> and <code>__defineSetter__</code> polyfills on the same property, I'm calling <code>Object.defineProperty</code> twice.</p>
  
  <p>My question is: Is it OK to call <code>Object.defineProperty</code> twice on same property? Doesn't it overwrite something for example?</p>