title: In old prototype style "[js] 'this' implicitly has type 'any' because it does not have a type annotation."
body: <p>I trying to annotate types in my old JavaScript code. I have problems with <code>this</code> when using <code>prototype</code> class definitions.</p>
  
  <p>For example in:</p>
  
  <pre><code>/**
   * @constructor 
   * @param {string} name
   * @type {Animal}
   */
  function Animal(name){
      this.name=name;
  }
  
  Animal.prototype.show = function show(){
      console.log(this.name);
  }
  
  var a = new Animal("bob");
  a.show();
  </code></pre>
  
  <p>I get:
  <a href="https://i.stack.imgur.com/3hjCP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3hjCP.png" alt="enter image description here"></a></p>
  
  <p>When I use class style I don't have any problems:</p>
  
  <pre><code>class AnimalClass{
      /**
       * @param {string} name
       */
      constructor(name){
          this.name=name;
      }
  
      show(){
          console.log(this.name);
      }
  }
  
  var animal = new AnimalClass("bob");
  animal.show();
  </code></pre>
  
  <p>My tsconfig.json is:</p>
  
  <pre><code>{
    "compilerOptions": {
      "lib":["es2017", "es2015", "dom"],
      "noImplicitAny": true,
      "alwaysStrict": true,
      "noUnusedLocals": true,
      "noUnusedParameters": true,
      "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
      "noFallthroughCasesInSwitch": true,
      "allowJs": true,
      "strict": true,
      "strictFunctionTypes": true,
      "strictNullChecks": true,
      "checkJs": true,
      "noImplicitThis": true
    }
  }
  </code></pre>
  
  <h1>My question is how to annotate type in old style JavaScript.</h1>