diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 11fb94693cf..9d811243718 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -510,7 +510,7 @@ namespace ts { case ModuleKind.UMD: return transformImportCallExpressionUMD(node); } - Debug.assert(false, "All supported module kind in this transformation step should have been handled"); + Debug.fail("All supported module kind in this transformation step should have been handled"); } function transformImportCallExpressionUMD(node: ImportCallExpression): Expression { diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 45f515cda9b..2798c7ca2cc 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -677,7 +677,7 @@ namespace ts { visitNode(node.body, visitor, isBlock))); } else { - hoistedStatements = append(hoistedStatements, node); + hoistedStatements = append(hoistedStatements, visitEachChild(node, visitor, context)); } if (hasAssociatedEndOfDeclarationMarker(node)) {