Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(docs): accept return in addition to returns
Browse files Browse the repository at this point in the history
documentation used @return but parser expected
@returns, which made the generated documentation
incomplete.
  • Loading branch information
mhevery committed May 24, 2012
1 parent 7e70463 commit bbaf9a2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 2 additions & 2 deletions src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function inferInjectionArgs(fn) {
* @param {Object=} self The `this` for the invoked method.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return the value returned by the invoked `fn` function.
* @returns {*} the value returned by the invoked `fn` function.
*/

/**
Expand All @@ -149,7 +149,7 @@ function inferInjectionArgs(fn) {
* @param {function} Type Annotated constructor function.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return new instance of `Type`.
* @returns {Object} new instance of `Type`.
*/


Expand Down
16 changes: 8 additions & 8 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ LocationUrl.prototype = {
* Return full url representation with all segments encoded according to rules specified in
* {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
*
* @return {string}
* @return {string} full url
*/
absUrl: locationGetter('$$absUrl'),

Expand All @@ -231,7 +231,7 @@ LocationUrl.prototype = {
* Change path, search and hash, when called with parameter and return `$location`.
*
* @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
* @return {string}
* @return {string} url
*/
url: function(url, replace) {
if (isUndefined(url))
Expand All @@ -255,7 +255,7 @@ LocationUrl.prototype = {
*
* Return protocol of current url.
*
* @return {string}
* @return {string} protocol of current url
*/
protocol: locationGetter('$$protocol'),

Expand All @@ -269,7 +269,7 @@ LocationUrl.prototype = {
*
* Return host of current url.
*
* @return {string}
* @return {string} host of current url.
*/
host: locationGetter('$$host'),

Expand All @@ -283,7 +283,7 @@ LocationUrl.prototype = {
*
* Return port of current url.
*
* @return {Number}
* @return {Number} port
*/
port: locationGetter('$$port'),

Expand All @@ -303,7 +303,7 @@ LocationUrl.prototype = {
* if it is missing.
*
* @param {string=} path New path
* @return {string}
* @return {string} path
*/
path: locationGetterSetter('$$path', function(path) {
return path.charAt(0) == '/' ? path : '/' + path;
Expand All @@ -325,7 +325,7 @@ LocationUrl.prototype = {
* @param {string=} paramValue If `search` is a string, then `paramValue` will override only a
* single search parameter. If the value is `null`, the parameter will be deleted.
*
* @return {string}
* @return {string} search
*/
search: function(search, paramValue) {
if (isUndefined(search))
Expand Down Expand Up @@ -358,7 +358,7 @@ LocationUrl.prototype = {
* Change hash fragment when called with parameter and return `$location`.
*
* @param {string=} hash New hash fragment
* @return {string}
* @return {string} hash
*/
hash: locationGetterSetter('$$hash', identity),

Expand Down
2 changes: 1 addition & 1 deletion src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ angular.mock.$LogProvider = function() {
* This method is also available on window, where it can be used to display objects on debug console.
*
* @param {*} object - any object to turn into string.
* @return a serialized string of the argument
* @return {string} a serialized string of the argument
*/
angular.mock.dump = function(object) {
return serialize(object);
Expand Down

0 comments on commit bbaf9a2

Please sign in to comment.