Permalink
Browse files

[doc_comments plugin] Ignore leading question or exclamation marks

... in JSDoc types.

Closes #861
  • Loading branch information...
1 parent 3f4794d commit 4393441d459549e250360ea8ccd1c0918ef14b85 @marijnh marijnh committed Dec 14, 2016
Showing with 3 additions and 2 deletions.
  1. +1 −0 plugin/doc_comment.js
  2. +2 −2 test/cases/jsdoc.js
@@ -264,6 +264,7 @@
function parseTypeInner(scope, str, pos) {
pos = skipSpace(str, pos);
+ if (/[?!]/.test(str.charAt(pos))) pos++
var type, madeUp = false;
if (str.indexOf("function(", pos) == pos) {
View
@@ -142,15 +142,15 @@ function ui() {}
ui(); //: string
/**
- * @param {string} [somebody=John Doe] - Somebody's name.
+ * @param {?string} [somebody=John Doe] - Somebody's name.
*/
function sayHello(somebody) {
somebody; //: string
}
/**
* Testing jsdoc with properties for an object
- * @param {Object} employee - The employee who is responsible for the project.
+ * @param {!Object} employee - The employee who is responsible for the project.
* @param {string} employee.name - The name of the employee.
* @param {string} employee.department - The employee's department.
*/

0 comments on commit 4393441

Please sign in to comment.