Skip to content

Commit

Permalink
Stopped jsdebug printing "Usage exmple" if there is no usage example for
Browse files Browse the repository at this point in the history
this method.
  • Loading branch information
Joscha Rohmann committed Aug 19, 2016
1 parent da3c09d commit 0871c4b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/blocks/jsdebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ function addMethodReference(message, method, examplesExpanded) {
message.beginCollapsedGroup();
}

message
.addSpan('Usage example' + (examples.length > 1 ? 's' : ''), { color: 'blue' })
.newLine();
if (examples.length > 0) {
message
.addSpan('Usage example' + (examples.length > 1 ? 's' : ''), { color: 'blue' })
.newLine();

for (var i = 0; i < method.examples.length;i++) {
addCodeTree(message, method.examples[i].code);
for (var i = 0; i < examples.length;i++) {
addCodeTree(message, examples[i].code);
}
}

message.endGroup();
Expand Down

0 comments on commit 0871c4b

Please sign in to comment.