File tree Expand file tree Collapse file tree
src/compiler/transformers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2105,21 +2105,24 @@ namespace ts {
21052105 * This function will be called when one of the following conditions are met:
21062106 * - The node is exported from a TypeScript namespace.
21072107 */
2108- function visitVariableStatement ( node : VariableStatement ) {
2109- Debug . assert ( isNamespaceExport ( node ) ) ;
2108+ function visitVariableStatement ( node : VariableStatement ) : Statement {
2109+ if ( isNamespaceExport ( node ) ) {
2110+ const variables = getInitializedVariables ( node . declarationList ) ;
2111+ if ( variables . length === 0 ) {
2112+ // elide statement if there are no initialized variables.
2113+ return undefined ;
2114+ }
21102115
2111- const variables = getInitializedVariables ( node . declarationList ) ;
2112- if ( variables . length === 0 ) {
2113- // elide statement if there are no initialized variables.
2114- return undefined ;
2116+ return createStatement (
2117+ inlineExpressions (
2118+ map ( variables , transformInitializedVariable )
2119+ ) ,
2120+ /*location*/ node
2121+ ) ;
2122+ }
2123+ else {
2124+ return visitEachChild ( node , visitor , context ) ;
21152125 }
2116-
2117- return createStatement (
2118- inlineExpressions (
2119- map ( variables , transformInitializedVariable )
2120- ) ,
2121- /*location*/ node
2122- ) ;
21232126 }
21242127
21252128 function transformInitializedVariable ( node : VariableDeclaration ) : Expression {
You can’t perform that action at this time.
0 commit comments