angular / clutz

Closure to TypeScript `.d.ts` generator
MIT License
162 stars 60 forks source link

The code #976

Closed tsjs-copybara-bot closed 4 years ago

tsjs-copybara-bot commented 4 years ago

The code

class A {
  constructor() {
    this.x = function() {
      this.y;
    }
  }
}

causes the TypeConversionPass#getEnclosingFunctionName method to fail because, in this specific case, the parent node of the anonymous function is an ASSIGN node, and the getString() method (used to previously get the enclosing function name) is not supported for ASSIGN nodes.

This change addresses this issue by specially handling the ASSIGN node case and includes an update to the golden tests.