chore(doc-gen): improve error handling for missing declaration params
This commit is contained in:
parent
398e70ad39
commit
8c409e9251
|
@ -153,13 +153,14 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
|
|||
return memberDoc;
|
||||
}
|
||||
|
||||
|
||||
function getParameters(typeChecker, symbol) {
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
if(!declaration.parameters) {
|
||||
console.log(declaration);
|
||||
throw 'missing declaration parameters';
|
||||
var location = getLocation(symbol);
|
||||
throw new Error('missing declaration parameters for "' + symbol.name +
|
||||
'" in ' + sourceFile.fileName +
|
||||
' at line ' + location.start.line);
|
||||
}
|
||||
var signature = typeChecker.getSignatureFromDeclaration(declaration);
|
||||
return declaration.parameters.map(function(parameter) {
|
||||
|
|
Loading…
Reference in New Issue