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

Commit 752b6d6

Browse files
committed
Fix: Use ts utilities function to determine variable type (#136)
This fixes issue an where async function will mark all variable declarations as constant.
1 parent 2df6d83 commit 752b6d6

File tree

3 files changed

+707
-2
lines changed

3 files changed

+707
-2
lines changed

lib/ast-converter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,10 @@ module.exports = function(ast, extra) {
899899

900900
var varStatementKind;
901901

902-
if (node.declarationList.flags) {
903-
varStatementKind = (node.declarationList.flags === ts.NodeFlags.Let) ? "let" : "const";
902+
if (ts.isLet(node.declarationList)) {
903+
varStatementKind = "let";
904+
} else if (ts.isConst(node.declarationList)) {
905+
varStatementKind = "const";
904906
} else {
905907
varStatementKind = "var";
906908
}

0 commit comments

Comments
 (0)