title: Why is this configurable property not deletable?
body: <p>Configurable properties seem to be deletable:</p>
  
  <pre class="lang-js prettyprint-override"><code>var o = {};
  Object.defineProperty(o, 'prop', {
      configurable: true,
      value: 'val'
  });
  delete o.prop; // true
  o.prop;        // undefined
  </code></pre>
  
  <p>But it doesn't work in the following case, at least on Firefox and Chrome:</p>
  
  <pre class="lang-js prettyprint-override"><code>var form = document.createElement('form'),
      input = document.createElement('input');
  form.appendChild(input);
  var elems = form.elements;
  Object.getOwnPropertyDescriptor(form, 0)
        .configurable; // true &lt;────────────────────── !!!
  delete elems[0];     // false                         │
  elems[0];            // input                         │
  (function(){ 'use strict'; //                         V
      delete elems[0]; // TypeError: property 0 is non-configurable
  })();                // and can't be deleted
  </code></pre>
  
  <p>But this seems to contradict the spec.</p>
  
  <p>The <code>delete</code> operator is defined like this:</p>
  
  <blockquote>
    <p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.1" rel="noreferrer"><strong>11.4.1 - The delete Operator</strong></a></p>
    
    <p>The production <em>UnaryExpression</em> : <code>delete</code> <em>UnaryExpression</em> is
    evaluated as follows:</p>
    
    <ul>
    <li>Let <em>ref</em> be the result of evaluating <em>UnaryExpression</em>.</li>
    <li>[...]</li>
    <li>If <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.7" rel="noreferrer">IsPropertyReference</a>(<em>ref</em>) is <strong>true</strong>, then
    <ul>
    <li>Return the result of calling the [[Delete]] internal method on <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-9.9" rel="noreferrer">ToObject</a>(<a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.7" rel="noreferrer">GetBase</a>(<em>ref</em>)) providing
    <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.7" rel="noreferrer">GetReferencedName</a>(<em>ref</em>) and <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.7" rel="noreferrer">IsStrictReference</a>(<em>ref</em>) as the
    arguments.</li>
    </ul></li>
    </ul>
  </blockquote>
  
  <p>So the result of using <code>delete</code> depends on [[Delete]]. Now let's see what [[Delete]] does:</p>
  
  <blockquote>
    <p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.3.3" rel="noreferrer"><strong>8.12.7 - [[Delete]] (P, Throw)</strong></a></p>
    
    <p>When the [[Delete]] internal method of <em>O</em> is called with property
    name <em>P</em> and the Boolean flag <em>Throw</em>, the following steps are taken:</p>
    
    <ul>
    <li>Let <em>desc</em> be the result of calling the [[GetOwnProperty]] internal method of <em>O</em> with property name <em>P</em>.</li>
    <li>If <em>desc</em> is <strong>undefined</strong>, then return <strong>true</strong>.</li>
    <li>If <em>desc</em>.[[Configurable]] is <strong>true</strong>, then
    <ul>
    <li>Remove the own property with name <em>P</em> from <em>O</em>.</li>
    <li>Return <strong>true</strong>.</li>
    </ul></li>
    <li>Else if <em>Throw</em>, then throw a <strong>TypeError</strong> exception.</li>
    <li>Return <strong>false</strong>.</li>
    </ul>
  </blockquote>
  
  <p>Therefore, if the property is configurable, it should be deletable.</p>
  
  <p>But wait, maybe <code>Object.getOwnPropertyDescritor</code> is a troll and says that a property is configurable, but [[Configurable]] is <strong>false</strong>. Let's see:</p>
  
  <blockquote>
    <p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.3.3" rel="noreferrer"><strong>15.2.3.3 - Object.getOwnPropertyDescriptor ( O, P )</strong></a></p>
    
    <p>When the <strong>getOwnPropertyDescriptor</strong> function is called, the
    following steps are taken:</p>
    
    <ul>
    <li>If <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8" rel="noreferrer">Type</a>(<em>O</em>) is not Object throw a <strong>TypeError</strong> exception.</li>
    <li>Let <em>name</em> be <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-9.8" rel="noreferrer">ToString</a>(<em>P</em>).</li>
    <li>Let <em>desc</em> be the result of calling the [[GetOwnProperty]] internal method of <em>O</em> with argument <em>name</em>.</li>
    <li>Return the result of calling <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.10.4" rel="noreferrer">FromPropertyDescriptor</a>(<em>desc</em>).</li>
    </ul>
  </blockquote>
  
  <p>So it also uses [[GetOwnProperty]], like [[Delete]]. Maybe the troll is FromPropertyDescriptor?</p>
  
  <blockquote>
    <p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.10.4" rel="noreferrer"><strong>8.10.4 FromPropertyDescriptor ( Desc )</strong></a></p>
    
    <p>When the abstract operation FromPropertyDescriptor is called with
    property descriptor <em>Desc</em>, the following steps are taken:</p>
    
    <ul>
    <li>If <em>Desc</em> is <strong>undefined</strong>, then return <strong>undefined</strong>.</li>
    <li>Let <em>obj</em> be the result of creating a new object as if by the expression <strong>new Object()</strong> where <strong>Object</strong> is the standard built-in
    constructor with that name.</li>
    <li>...</li>
    <li>Call the [[DefineOwnProperty]] internal method of <em>obj</em> with arguments "<code>configurable</code>", <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.10" rel="noreferrer">Property Descriptor</a> {[[Value]]:
    <em>Desc</em>.[[Configurable]], [[Writable]]: <strong>true</strong>, [[Enumerable]]: <strong>true</strong>, [[Configurable]]: <strong>true</strong>}, and <strong>false</strong>.</li>
    <li>Return <em>obj</em>.</li>
    </ul>
  </blockquote>
  
  <p>So no, it is not a troll neither. The <code>configurable</code> property of the property descriptor is set to the [[Configurable]] value.</p>
  
  <p>How is it possible, then, that a configurable property can't be deleted?</p>