C:\Work\src\lib>ts2jsdoc --module amd --target es5 core.ts
Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\common.js:6
var nodeType = node.type;
^
TypeError: Cannot read property 'type' of null
at addTypeToTag (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\common.js:6:24)
at Object.addName (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\common.js:65:13)
at Object.forVar (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\syntax.js:16:16)
at Object.process (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\processor.js:36:20)
at createComments (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\ast.js:20:15)
at Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\ast.js:22:9
at children (Z:\Prog\nodejs\node_modules\typescript\bin\typescriptServices.js:3476:34)
at Object.forEachChild (Z:\Prog\nodejs\node_modules\typescript\bin\typescriptServices.js:3565:52)
at createComments (Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\ast.js:21:8)
at Z:\Prog\nodejs\node_modules\ts2jsdoc\lib\ast.js:22:9
common.js at lineno 65 addName calls to function addTypeToTag with null for 3rd argument:
function addName(comments, tagName, node, checker) {
var tag = comments.getOrAddTag(tagName), nodeType = node.type, initializer = node.initializer;
tag.name = utils.getNodeName(node);
if (checker) {
if (nodeType) {
addTypeToTag(comments, tag, node, checker);
}
if (initializer && initializer.kind === 6 /* FirstLiteralToken */) {
if (tagName === "member") {
comments.getOrAddTag("default").name = initializer.getText();
}
else {
tag.name += "=" + initializer.getText();
}
}
if (initializer && !nodeType) {
addTypeToTag(comments, tag, null, checker, initializer.contextualType);6
}
}
}
But addTypeToTag doesn't expect null for its 3rd arg (node):
function addTypeToTag(comments, tag, node, checker, type) {
var nodeType = node.type;
common.js at lineno 65
addName
calls to functionaddTypeToTag
withnull
for 3rd argument:But
addTypeToTag
doesn't expect null for its 3rd arg (node):