File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
src/compiler/transformers Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -2105,21 +2105,24 @@ namespace ts {
2105
2105
* This function will be called when one of the following conditions are met:
2106
2106
* - The node is exported from a TypeScript namespace.
2107
2107
*/
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
+ }
2110
2115
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 ) ;
2115
2125
}
2116
-
2117
- return createStatement (
2118
- inlineExpressions (
2119
- map ( variables , transformInitializedVariable )
2120
- ) ,
2121
- /*location*/ node
2122
- ) ;
2123
2126
}
2124
2127
2125
2128
function transformInitializedVariable ( node : VariableDeclaration ) : Expression {
You can’t perform that action at this time.
0 commit comments