Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Fix: visiting superTypeParameters in classes (#561)
Browse files Browse the repository at this point in the history
* Fix: visiting superTypeParameters in classes

* Add missing decorators in TSAbstractClassDeclaration

its already supported in visitClass

* Add missing typeParameters in TSAbstractClassDeclaration

its using same logic as ClassDeclaration
  • Loading branch information
armano2 authored and platinumazure committed Nov 28, 2018
1 parent 83dbabb commit cc92044
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 3 deletions.
8 changes: 8 additions & 0 deletions analyze-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ class Referencer extends OriginalReferencer {
*/
visitClass(node) {
this.visitDecorators(node.decorators);

if (node.superTypeParameters) {
const upperTypeMode = this.typeMode;
this.typeMode = true;
this.visit(node.superTypeParameters);
this.typeMode = upperTypeMode;
}

super.visitClass(node);
}

Expand Down
11 changes: 11 additions & 0 deletions tests/fixtures/scope-analysis/class-supper-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
abstract class Foo extends Bar<Baz> {

}

declare class Foo2 extends Bar<Baz> {

}

class Foo3 extends Bar<Baz> {

}
Loading

0 comments on commit cc92044

Please sign in to comment.