title: Javascript Namespacing, where is the syntax error?
body: <p>I'm taking an existing JS library I wrote up some time ago, and trying to organize it under a common namespace...Here is an example of the technique I am trying to use:</p>
  
  <pre><code>var NameSpace = new function ()
  {
      var privateMember = [];
  
      function privateMethod() {};
  
  
      return 
      {       
          PublicMethod1 : function(arg, arg2)
          {
              // etc
          },
          PublicMethod2 : function ()
          {
              // etc
          },
          PublicMethod3 : function(arg, arg2)
          {
              // etc
          }
      };  
  
  }();
  </code></pre>
  
  <p>From what I can tell, this should work perfectly, however I get a Syntax Error on this line:</p>
  
  <pre><code>PublicMethod1 : function(arg, arg2)
  </code></pre>
  
  <p>Can anyone see some obvious problem with this technique?</p>