title: 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method
body: <pre><code>    interface IMySocks {
          start(): void;
      }
  
      declare var $;
  
      class MySocks implements IMySocks {
  
          private address: string;
          private protocols = [];
          private mySock: WebSocket;
  start() {
          this.mySock = new WebSocket(this.address, this.protocols);
          this.mySock.onclose = this.onclose;
          this.mySock.onopen = this.onopen;
          this.mySock.onerror = this.onerror;
          this.mySock.onmessage = this.onmessage;
      }
  
  private onopen(): void {
          this.sendIt();
          console.debug("OPEN");
      }
  
  private sendIt() {
  .....}
  </code></pre>
  
  <p>var my: IMySocks = new MySocks();
  my.start();</p>
  
  <p>So such class comes to Error in the subject. Intellisense and compilation found no error in typescript file. I am using VS2012 Ultimate update 2 with typescript 1.0.  What wrong ? </p>
  
  <p>Trhe problem raises when I call this.sendIt();</p>