fix(docs): accept return in addition to returns

documentation used @return but parser expected
@returns, which made the generated documentation
incomplete.
This commit is contained in:
Misko Hevery
2012-05-16 22:20:35 -07:00
parent 7e70463da1
commit bbaf9a2870
4 changed files with 13 additions and 13 deletions

View File

@@ -227,10 +227,10 @@ Doc.prototype = {
'default':match[6]
};
self.param.push(param);
} else if (atName == 'returns') {
} else if (atName == 'returns' || atName == 'return') {
match = text.match(/^\{([^}=]+)\}\s+(.*)/);
if (!match) {
throw new Error("Not a valid 'returns' format: " + text);
throw new Error("Not a valid 'returns' format: " + text + ' in ' + self.file + ':' + self.line);
}
self.returns = {
type: match[1],