Skip to content

Commit c09f76c

Browse files
committed
Breaking: Add .body to TSModuleBlock nodes (fixes eslint#217)
1 parent 41ccef5 commit c09f76c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/ast-converter.js

+7
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,13 @@ module.exports = function(ast, extra) {
14911491
break;
14921492

14931493
// Modules
1494+
case SyntaxKind.ModuleBlock:
1495+
assign(result, {
1496+
type: "TSModuleBlock",
1497+
body: node.statements.map(convertChild)
1498+
});
1499+
break;
1500+
14941501
case SyntaxKind.ImportDeclaration:
14951502
assign(result, {
14961503
type: "ImportDeclaration",

tests/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.result.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = {
8484
"column": 1
8585
}
8686
},
87-
"statements": [
87+
"body": [
8888
{
8989
"type": "TSNamespaceExportDeclaration",
9090
"declaration": {
@@ -616,4 +616,4 @@ module.exports = {
616616
}
617617
}
618618
]
619-
};
619+
};

0 commit comments

Comments
 (0)