mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
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:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user