title: Weird behaviour with 'use strict' and read only properties
body: <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode">On the MDN strict mode reference page</a> it says</p>
  
  <blockquote>
    <p>Any assignment that silently fails in normal code (assignment to a non-writable property, assignment to a getter-only property, assignment to a new property on a non-extensible object) will throw in strict mode</p>
  </blockquote>
  
  <p>So, using their example, doing something like the following throws a TypeError</p>
  
  <pre><code>"use strict";
  var obj1 = {};
  Object.defineProperty(obj1, "x", { value: 42, writable: false });
  obj1.x = 9; // throws a TypeError
  </code></pre>
  
  <p>However I ran into an example where it seems 'use strict' is being a little overzealous about this rule. Here is my setup</p>
  
  <p><em>definelol.js</em></p>
  
  <pre><code>Object.defineProperty(Object.prototype, 'lol', {
      value: 'wat'
  })
  </code></pre>
  
  <p><em>setlol.js</em></p>
  
  <pre><code>'use strict';
  
  console.log('here 0');
  
  var sugar = { lol: '123' }
  
  console.log('here 1');
  
  var verbose = {};
  verbose.lol = '123';
  
  console.log('here 2');
  
  console.log('sugar.lol:', sugar.lol);
  console.log('verbose.lol:', verbose.lol);
  console.log('Object.prototype.lol:', Object.prototype.lol);
  </code></pre>
  
  <p><em>app.js</em></p>
  
  <pre><code>require('./definelol.js');
  require('./setlol.js');
  </code></pre>
  
  <p>running <code>node app.js</code> gives</p>
  
  <pre><code>here 0
  here 1
  
  /pathto/setlol.js:10
  verbose.lol = '123';
              ^
  TypeError: Cannot assign to read only property 'lol' of #&lt;Object&gt;
      at Object.&lt;anonymous&gt; (/pathto/setlol.js:10:13)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Module.require (module.js:364:17)
      at require (module.js:380:17)
      at Object.&lt;anonymous&gt; (/pathto/app.js:2:1)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
  </code></pre>
  
  <p>There are a couple of interesting things that are interesting about this output. First is that we are not trying to set the <code>lol</code> property on <code>Object.prototype</code> we are trying to set the <code>lol</code> property of <code>verbose</code>. To prove this I changed <code>definelol.js</code> to be</p>
  
  <pre><code>Object.defineProperty(Object.prototype, 'lol', {
      writable: true,
      value: 'wat'
  })
  </code></pre>
  
  <p>Now, running <code>node app.js</code> gives</p>
  
  <pre><code>here 0
  here 1
  here 2
  sugar.lol: 123
  verbose.lol: 123
  Object.prototype.lol: wat
  </code></pre>
  
  <p>The second thing that was interesting was that the original program failed on <code>verbose.lol = '123'</code> but was perfectly happy creating <code>sugar</code> and setting its <code>lol</code> to 123.  I don't understand this because it seems that the way we created <code>sugar</code> should simply be syntactic sugar for the way we created <code>verbose</code></p>