title: JavaScript SyntaxError: invalid property id
body: <p>I am trying to execute the following JS code;</p>
  
  <pre><code>var foo = {
    func1:function(){
      function test()
      {
        alert("123");
      }();
      alert("456");
    },
    myVar : 'local'
  };
  </code></pre>
  
  <p>But I am getting an error 
  SyntaxError: invalid property id</p>
  
  <p>What is wrong with the above code?</p>