Skip to content

Commit

Permalink
Add support for inheritance from null
Browse files Browse the repository at this point in the history
fixes #189
  • Loading branch information
Swatinem committed Dec 24, 2021
1 parent 734fda3 commit f2feca4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transform/astHelpers.ts
Expand Up @@ -118,6 +118,8 @@ export function convertExpression(node: ts.Expression): ESTree.Expression {
}
if (ts.isIdentifier(node)) {
return createIdentifier(node);
} else if (node.kind == ts.SyntaxKind.NullKeyword) {
return { type: "Literal", value: null };
} else {
throw new UnsupportedSyntaxError(node);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/testcases/issue-189/expected.d.ts
@@ -0,0 +1,2 @@
declare class MyClass extends null {}
export { MyClass };
1 change: 1 addition & 0 deletions tests/testcases/issue-189/index.d.ts
@@ -0,0 +1 @@
export class MyClass extends null {}

0 comments on commit f2feca4

Please sign in to comment.