Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
actually prevent a StringIndexOutOfBoundsException on empty comments (j…
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Feb 28, 2015
1 parent 20e5d9b commit 1455d1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/org/jsdoc/AstBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ private void processComment(Comment rhinoNode, Entry info)
info.put(TYPE, JsDocNode.BLOCK);

// Esprima provides the comment value without delimiters, so we do too
info.put("value", comment.substring(2, Math.max(0, comment.length() - 2)));
info.put("value", comment.length() > 2 ?
comment.substring(2) :
"");
// Esprima doesn't provide this, but it's useful
info.put("raw", rhinoNode.getValue());
}
Expand Down

0 comments on commit 1455d1a

Please sign in to comment.