title: Is it possible to emulate non-enumerable properties?
body: <p>ES5 has a enumerable flag. <a href="http://jsfiddle.net/BjrTV/2/">Example</a></p>
  
  <h2>Example</h2>
  
  <pre><code>var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
   , pd = getOwnPropertyDescriptor(Object.prototype, "toString");
  
  assert(pd.enumerable === false, "enumerability has the wrong value");
  </code></pre>
  
  <h2>Partial implementation</h2>
  
  <p><a href="https://gist.github.com/1672142">Partial implementation</a> is do-able by having <code>Object.keys</code> and <code>Object.getOwnPropertyNames</code> filter out new non-enumerable properties using the shimmed <code>Object.defineProperty</code>.</p>
  
  <h2>Introduction</h2>
  
  <p>This allows for properties to be non enumerable. This clearly means that <a href="http://jsfiddle.net/aGRDF/2/">Example</a></p>
  
  <pre><code>for (var key in {}) {
      assert(key !== "toString", "I should never print");
  }
  </code></pre>
  
  <p>This allows us to add properties to say <code>Object.prototype</code> (<a href="http://jsfiddle.net/aGRDF/1/">Example</a>)</p>
  
  <pre><code>Object.defineProperty(Object.prototype, "toUpperCaseString", {
      value: function toUpperCaseString() {
          return this.toString().toUpperCase();
      },
      enumerable: false
  });
  
  for (var key in {}) {
      assert(key !== "toUpperCaseString", "I should never print");
  }
  
  console.log(({}).toUpperCaseString()); // "[OBJECT OBJECT]"
  </code></pre>
  
  <h2>Question</h2>
  
  <p>How can we emulate this in non-ES5 compliant browsers?</p>
  
  <p><a href="http://kangax.github.com/es5-compat-table/">Browser compat table</a></p>
  
  <p>In this case we care about potentially solving this for </p>
  
  <ul>
  <li>IE &lt; 9 (IE8 only works on DOM objects)</li>
  <li>Firefox 3.6</li>
  <li>Safari 4</li>
  <li>Opera 11.5 (Opera 11.6 solves this).</li>
  </ul>
  
  <p>The <a href="https://github.com/kriskowal/es5-shim">ES5-shim</a> does not have a solution for this.</p>
  
  <p>The ES5 shim has a <a href="https://gist.github.com/1664895">solution for <em>most</em> ES5 features that will break your code</a> if it doesn't work.</p>
  
  <p>Is there any black magic that can be done with propiotory IE only APIs? Maybe with VBScript?</p>