title: this.$initialize is not a function
body: <p>I have recently started using <a href="http://bridge.net/" rel="nofollow noreferrer">Bridge.NET</a> and I run into a problem. </p>
  
  <p>With a class defined as follow</p>
  
  <pre><code>public class DomEngine
  {
      public DomEngine()
      {
          // Empty constructor to make sure it works
      }
  
      /* Lots of irrelevant code removed */
  }
  </code></pre>
  
  <p>and an index.html like so</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;MenuGeneratorFromDom&lt;/title&gt;
  
      &lt;script src="bridge.js"&gt;&lt;/script&gt;
      &lt;script src="bridge.console.js"&gt;&lt;/script&gt;
      &lt;script src="bridge.meta.js"&gt;&lt;/script&gt;
      &lt;script src="jquery-2.2.4.js"&gt;&lt;/script&gt;
      &lt;script src="MenuGeneratorFromDom.js"&gt;&lt;/script&gt;
      &lt;script src="MenuGeneratorFromDom.meta.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;1.0&lt;/h1&gt;
      &lt;h4&gt;4.0&lt;/h4&gt;
      &lt;h2&gt;2.0&lt;/h2&gt;
      &lt;h3&gt;3.0&lt;/h3&gt;
      &lt;h4&gt;4.1&lt;/h4&gt;
      &lt;h3&gt;3.1&lt;/h3&gt;
      &lt;h3&gt;3.2&lt;/h3&gt;
      &lt;h2&gt;2.1&lt;/h2&gt;
      &lt;h3&gt;3.3&lt;/h3&gt;
      &lt;h3&gt;3.4&lt;/h3&gt;
      &lt;h4&gt;4.2&lt;/h4&gt;
      &lt;h4&gt;4.3&lt;/h4&gt;
  &lt;script&gt;
      $(function()
      {
          var domEngine = MenuGeneratorFromDom.DomEngine();
      });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I get a <code>this.$initialize is not a function</code> in the code generated by Bridge.NET</p>
  
  <pre><code>Bridge.define("MenuGeneratorFromDom.DomEngine", 
  {
      ctors: 
      {
          ctor: function () 
          {
              this.$initialize(); // Here
          }
      },
      /* lots of generated code */
  }
  </code></pre>
  
  <p>While the <code>Initializ()</code> is, indeed, defined in <code>bridge.js</code> with the line</p>
  
  <pre><code>prop.$initialize = Bridge.Class._initialize;
  </code></pre>
  
  <p>(where <code>Bridge.Class._initialize</code> is defined as well) and we can see in the index.html above that <code>bridge.js</code> is included in the file before <code>MenuGeneratorFromDom.js</code></p>
  
  <p>I do not understand why this <code>Initialize</code> call throws an undefined error while it is obviously defined ! Did I forget to do something with Bridge.NET ?</p>