Skip to content

Commit 87c87f0

Browse files
Recompiled
1 parent 3edb472 commit 87c87f0

File tree

1 file changed

+53
-15
lines changed

1 file changed

+53
-15
lines changed

bin/typedoc.js

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ var td;
372372
/**
373373
* The version number of TypeDoc.
374374
*/
375-
Application.VERSION = '0.3.1';
375+
Application.VERSION = '0.3.2';
376376
return Application;
377377
})();
378378
td.Application = Application;
@@ -2271,32 +2271,40 @@ var td;
22712271
catch (error) {
22722272
var msg = [];
22732273
msg.push('An error occurred while creating reflections for the current project.');
2274-
msg.push(' | Please report this error at https://github.com/sebastian-lenz/typedoc/issues');
2275-
msg.push(' | including the following details:');
2276-
msg.push(' |');
2274+
msg.push('Please report this error at https://github.com/sebastian-lenz/typedoc/issues');
2275+
msg.push('including the following details:');
2276+
msg.push('');
2277+
msg.push('>>> BEGIN OF ERROR DESCRIPTION');
2278+
msg.push('');
22772279
try {
22782280
var sourceFile = ts.getSourceFileOfNode(node);
22792281
var line = sourceFile.getLineAndCharacterFromPosition(node.pos);
22802282
if (node.symbol) {
2281-
msg.push(td.Util.format(' | The error occurred while converting `%s` in `%s` around line %s:', context.checker.getFullyQualifiedName(node.symbol), ts.getBaseFilename(sourceFile.filename), line.line));
2283+
msg.push(td.Util.format('The error occurred while converting `%s` in `%s` around line %s:', context.checker.getFullyQualifiedName(node.symbol), ts.getBaseFilename(sourceFile.filename), line.line));
22822284
}
22832285
else {
2284-
msg.push(td.Util.format(' | The error occurred while converting `%s` around line %s:', ts.getBaseFilename(sourceFile.filename), line.line));
2286+
msg.push(td.Util.format('The error occurred while converting `%s` around line %s:', ts.getBaseFilename(sourceFile.filename), line.line));
22852287
}
2286-
var lines = sourceFile.getLineStarts();
2288+
var lineData, lines = sourceFile.getLineStarts();
2289+
var lineCount = lines.length - 1;
22872290
var min = Math.max(line.line - 2, 0);
2288-
var max = Math.min(line.line + 25, lines.length - 2);
2291+
var max = Math.min(line.line + 25, lineCount);
2292+
msg.push('', '```');
22892293
for (var index = min; index <= max; index++) {
2290-
msg.push((index == line.line - 1 ? ' | @ ' : ' | > ') + sourceFile.text.substring(lines[index], lines[index + 1] - 1));
2294+
if (index == lineCount) {
2295+
lineData = sourceFile.text.substring(lines[index]);
2296+
}
2297+
else {
2298+
lineData = sourceFile.text.substring(lines[index], lines[index + 1] - 1);
2299+
}
2300+
msg.push((index == line.line - 1 ? '@ ' : ' ') + lineData);
22912301
}
2292-
msg.push(' |');
2302+
msg.push('```');
22932303
}
2294-
catch (error) {
2304+
catch (sourceError) {
22952305
}
2296-
error.stack.split('\n').forEach(function (str, index) {
2297-
msg.push((index == 0 ? ' | ' : ' | ') + str.trim());
2298-
});
2299-
msg.push('');
2306+
msg.push('', '```', error.stack, '```');
2307+
msg.push('', '<<< END OF ERROR DESCRIPTION', '', '');
23002308
context.getLogger().error(msg.join('\n'));
23012309
}
23022310
}
@@ -2550,6 +2558,35 @@ var td;
25502558
}
25512559
return member;
25522560
}
2561+
/**
2562+
* Analyze parameters in given constructor declaration node and create a suitable reflection.
2563+
*
2564+
* @param context The context object describing the current state the converter is in.
2565+
* @param node The constructor declaration node that should be analyzed.
2566+
* @return The resulting reflection or NULL.
2567+
*/
2568+
function visitConstructorModifiers(context, node) {
2569+
node.parameters.forEach(function (param) {
2570+
var visibility = param.flags & (16 /* Public */ | 64 /* Protected */ | 32 /* Private */);
2571+
if (!visibility)
2572+
return;
2573+
var property = converter.createDeclaration(context, param, 1024 /* Property */);
2574+
if (!property)
2575+
return;
2576+
property.setFlag(8 /* Static */, false);
2577+
property.type = converter.convertType(context, param.type, context.getTypeAtLocation(param));
2578+
var sourceComment = converter.CommentPlugin.getComment(node);
2579+
if (sourceComment) {
2580+
var constructorComment = converter.CommentPlugin.parseComment(sourceComment);
2581+
if (constructorComment) {
2582+
var tag = constructorComment.getTag('param', property.name);
2583+
if (tag && tag.text) {
2584+
property.comment = converter.CommentPlugin.parseComment(tag.text);
2585+
}
2586+
}
2587+
}
2588+
});
2589+
}
25532590
/**
25542591
* Analyze the given constructor declaration node and create a suitable reflection.
25552592
*
@@ -2561,6 +2598,7 @@ var td;
25612598
var parent = context.scope;
25622599
var hasBody = !!node.body;
25632600
var method = converter.createDeclaration(context, node, 512 /* Constructor */, 'constructor');
2601+
visitConstructorModifiers(context, node);
25642602
context.withScope(method, function () {
25652603
if (!hasBody || !method.signatures) {
25662604
var name = 'new ' + parent.name;

0 commit comments

Comments
 (0)