Skip to content

Commit bac4c5b

Browse files
committed
Remove unnecessary @returns
1 parent dc94a65 commit bac4c5b

File tree

3 files changed

+21
-53
lines changed

3 files changed

+21
-53
lines changed

test/lib/infer/kind.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ test('inferKind', function (t) {
2424
});
2525

2626
t.equal(inferKind(toComment(function () {
27-
/** @returns {number} two */
27+
/** function */
2828
function foo() { }
2929
foo();
3030
})).kind, 'function', 'inferred function');
3131

3232
t.equal(inferKind(toComment(function () {
33-
/** @returns {number} two */
33+
/** function */
3434
var foo = function () { };
3535
foo();
3636
})).kind, 'function', 'inferred var function');
3737

3838
t.equal(inferKind(toComment(function () {
39-
/** @returns {number} two */
39+
/** class */
4040
function Foo() { }
4141
})).kind, 'class', 'class via uppercase');
4242

4343
t.equal(inferKind(toComment(function () {
44-
/** @returns {number} two */
44+
/** undefined */
4545
})).kind, undefined, 'undetectable');
4646

4747
t.equal(inferKind(toComment(

test/lib/infer/membership.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ test('inferMembership - explicit', function (t) {
8585
Foo.prototype = {
8686
/**
8787
* Test
88-
* @returns {undefined} bar
8988
*/
9089
bar: function () {}
9190
};
@@ -107,8 +106,7 @@ test('inferMembership - explicit', function (t) {
107106

108107
t.deepEqual(_.pick(evaluate(function () {
109108
var Foo = {
110-
/** Test
111-
* @returns {undefined} bar */
109+
/** Test */
112110
baz: function () {}
113111
};
114112
return Foo;
@@ -118,8 +116,7 @@ test('inferMembership - explicit', function (t) {
118116
}, 'variable object assignment, function');
119117

120118
t.deepEqual(_.pick(evaluate(function () {
121-
/** Test
122-
* @returns {undefined} bar */
119+
/** Test */
123120
module.exports = function () {};
124121
})[0], ['memberof', 'scope']), {
125122
memberof: 'module',
@@ -138,10 +135,7 @@ test('inferMembership - explicit', function (t) {
138135

139136
t.deepEqual(_.pick(evaluate(function () {
140137
lend(/** @lends Foo */{
141-
/**
142-
* Test
143-
* @returns {undefined} nothing
144-
*/
138+
/** Test */
145139
bar: function () {}
146140
});
147141
})[1], ['memberof', 'scope']), {
@@ -161,10 +155,7 @@ test('inferMembership - explicit', function (t) {
161155

162156
t.deepEqual(_.pick(evaluate(function () {
163157
lend(/** @lends Foo.prototype */{
164-
/**
165-
* Test
166-
* @returns {number} nothing
167-
*/
158+
/** Test */
168159
bar: function () {}
169160
});
170161
})[1], ['memberof', 'scope']), {
@@ -193,7 +184,7 @@ test('inferMembership - exports', function (t) {
193184

194185
t.equal(evaluate(function () {
195186
/** @module mod */
196-
/** @returns {undefined} foo */
187+
/** foo */
197188
exports.foo = function () {};
198189
})[1].memberof, 'mod');
199190

@@ -214,21 +205,21 @@ test('inferMembership - exports', function (t) {
214205
t.equal(evaluate(function () {
215206
/** @module mod */
216207
exports.foo = {
217-
/** @returns {undefined} bar */
208+
/** bar */
218209
bar: function () {}
219210
};
220211
})[1].memberof, 'mod.foo');
221212

222213
t.equal(evaluate(function () {
223214
/** @module mod */
224-
/** @returns {undefined} bar */
215+
/** bar */
225216
exports.foo.prototype.bar = function () {};
226217
})[1].memberof, 'mod.foo');
227218

228219
t.equal(evaluate(function () {
229220
/** @module mod */
230221
exports.foo.prototype = {
231-
/** @returns {undefined} bar */
222+
/** bar */
232223
bar: function () {}
233224
};
234225
})[1].memberof, 'mod.foo');
@@ -245,7 +236,7 @@ test('inferMembership - module.exports', function (t) {
245236

246237
t.equal(evaluate(function () {
247238
/** @module mod */
248-
/** @returns {undefined} foo */
239+
/** foo */
249240
module.exports.foo = function () {};
250241
})[1].memberof, 'mod');
251242

@@ -266,21 +257,21 @@ test('inferMembership - module.exports', function (t) {
266257
t.equal(evaluate(function () {
267258
/** @module mod */
268259
module.exports.foo = {
269-
/** @returns {undefined} bar */
260+
/** bar */
270261
bar: function () {}
271262
};
272263
})[1].memberof, 'mod.foo');
273264

274265
t.equal(evaluate(function () {
275266
/** @module mod */
276-
/** @returns {undefined} bar */
267+
/** bar */
277268
module.exports.prototype.bar = function () {};
278269
})[1].memberof, 'mod');
279270

280271
t.equal(evaluate(function () {
281272
/** @module mod */
282273
module.exports.prototype = {
283-
/** @returns {undefined} bar */
274+
/** bar */
284275
bar: function () {}
285276
};
286277
})[1].memberof, 'mod');
@@ -297,7 +288,6 @@ test('inferMembership - module.exports', function (t) {
297288
/**
298289
* @module mod
299290
* @name exports
300-
* @returns {undefined} bar
301291
*/
302292
module.exports = function () {};
303293
})[0].memberof, undefined);

test/lib/infer/name.js

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ test('inferName', function (t) {
3030
// AssignmentExpression
3131
// MemberExpression (comment attached here)
3232
// FunctionExpression
33-
/**
34-
* Test
35-
* @returns {undefined} bar
36-
*/
33+
/** Test */
3734
exports.name = function () {};
3835
}).name, 'name', 'expression statement, function');
3936

@@ -52,37 +49,25 @@ test('inferName', function (t) {
5249
// Property
5350
// Identifier (comment attached here)
5451
// FunctionExpression
55-
/**
56-
* Test
57-
* @returns {undefined} bar
58-
*/
52+
/** Test */
5953
name: function () {}
6054
};
6155
}).name, 'name', 'property, function');
6256

6357
t.equal(evaluate(function () {
64-
/**
65-
* Test
66-
* @returns {undefined} bar
67-
*/
58+
/** Test */
6859
function name() {}
6960
return name;
7061
}).name, 'name', 'function declaration');
7162

7263
t.equal(evaluate(function () {
73-
/**
74-
* Test
75-
* @returns {undefined} bar
76-
*/
64+
/** Test */
7765
var name = function () {};
7866
return name;
7967
}).name, 'name', 'anonymous function expression');
8068

8169
t.equal(evaluate(function () {
82-
/**
83-
* Test
84-
* @returns {undefined} bar
85-
*/
70+
/** Test */
8671
var name = function name2() {};
8772
return name;
8873
}).name, 'name', 'named function expression');
@@ -91,7 +76,6 @@ test('inferName', function (t) {
9176
/**
9277
* Test
9378
* @name explicitName
94-
* @returns {undefined} bar
9579
*/
9680
function implicitName() {}
9781
return implicitName;
@@ -112,7 +96,6 @@ test('inferName', function (t) {
11296
t.equal(evaluate(function () {
11397
/**
11498
* @event explicitEvent
115-
* @returns {undefined} bar
11699
*/
117100
function implicitName() {}
118101
return implicitName;
@@ -121,7 +104,6 @@ test('inferName', function (t) {
121104
t.equal(evaluate(function () {
122105
/**
123106
* @typedef {Object} ExplicitTypedef
124-
* @returns {undefined} bar
125107
*/
126108
function implicitName() {}
127109
return implicitName;
@@ -130,7 +112,6 @@ test('inferName', function (t) {
130112
t.equal(evaluate(function () {
131113
/**
132114
* @callback explicitCallback
133-
* @returns {undefined} baz
134115
*/
135116
function implicitName() {}
136117
return implicitName;
@@ -139,7 +120,6 @@ test('inferName', function (t) {
139120
t.equal(evaluate(function () {
140121
/**
141122
* @module explicitModule
142-
* @returns {undefined} baz
143123
*/
144124
function implicitName() {}
145125
return implicitName;
@@ -148,7 +128,6 @@ test('inferName', function (t) {
148128
t.equal(evaluate(function () {
149129
/**
150130
* @module {Function} explicitModule
151-
* @returns {undefined} baz
152131
*/
153132
function implicitName() {}
154133
return implicitName;
@@ -157,7 +136,6 @@ test('inferName', function (t) {
157136
t.equal(evaluate(function () {
158137
/**
159138
* @module
160-
* @returns {undefined} baz
161139
*/
162140
function implicitName() {}
163141
return implicitName;

0 commit comments

Comments
 (0)