title: object literal used in inherited property changes all instances of the class
body: <p>I have the following code (ObjA) and it works as I would expect, instance 'a1' has the same properties as 'a2' but with different values.</p>
  
  <pre><code>function ObjA() {
      this.objLiteral = {};
      this.propA = 0;
  }
  
  var a1 = new ObjA();
  a1.objLiteral['hello'] = 3;
  a1.propA = 1.5;
  
  var a2 = new ObjA();
  a2.objLiteral['goodbye'] = 4;
  a2.propA = 2;
  </code></pre>
  
  <p>debugger info for a1 and a2:<br>
  <a href="http://www.flickr.com/photos/76617756@N02/6879283032/" rel="nofollow">http://www.flickr.com/photos/76617756@N02/6879283032/</a></p>
  
  <p>Next, I have the following ObjB that inherits from ObjA. Instance 'b1' and 'b2' have the same properties and different values for properties propA and propB but for some reason, objLiteral is the same in both as if it was referencing the same object.</p>
  
  <pre><code>ObjB.prototype = new ObjA();
  ObjB.prototype.constructor=ObjB;
  
  function ObjB() {
      this.propB = 2;
  }
  
  var b1 = new ObjB();
  b1.objLiteral['hello2'] = 6;
  b1.propA = 4;
  b1.propB = 5;
  
  var b2 = new ObjB();
  b2.objLiteral['goodbye2'] = 8;
  b2.propA = 6;
  b2.propB = 7;
  </code></pre>
  
  <p>debugger info for b1 and b2:<br>
  <a href="http://www.flickr.com/photos/76617756@N02/6879283088/" rel="nofollow">http://www.flickr.com/photos/76617756@N02/6879283088/</a></p>
  
  <p>Can somebody help me understand what is happening? What do I have to do to ge what I am expecting?
  Your help is much appreciated.</p>