title: How to make an iterator out of an ES6 class
body: <p>How would I make an iterator out of an ES6 class in the same manner as JS1.7 <code>SomeClass.prototype.__iterator__ = function() {...}</code> syntax?</p>
  
  <p>[EDIT 16:00]</p>
  
  <p>The following works:</p>
  
  <pre><code>class SomeClass {
      constructor() {
      }
  
      *[Symbol.iterator]() {
          yield '1';
          yield '2';
      }
  
      //*generator() {
      //}
  
  }
  
  an_instance = new SomeClass();
  for (let v of an_instance) {
      console.log(v);
  }
  </code></pre>
  
  <p>WebStorm flags <code>*[Symbol.iterator]()</code> with a 'function name expected' warning directly following the asterix, but otherwise this compiles and runs fine with Traceur.  (Note WebStorm does not generate any errors for <code>*generator()</code>.)</p>