Skip to content

Commit

Permalink
lib: include return types in JSDoc
Browse files Browse the repository at this point in the history
Add types to @returns JSDoc annotations where the type is missing.

PR-URL: #41130
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Trott authored and danielleadams committed Jan 31, 2022
1 parent c5a979a commit e6accfa
Show file tree
Hide file tree
Showing 6 changed files with 957 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/internal/blob.js
Expand Up @@ -129,7 +129,7 @@ class Blob {
* endings? : string,
* type? : string,
* }} [options]
* @returns
* @constructs {Blob}
*/
constructor(sources = [], options = {}) {
emitExperimentalWarning('buffer.Blob');
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs/utils.js
Expand Up @@ -525,7 +525,7 @@ Stats.prototype._checkModeProperty = function(property) {
/**
* @param {Float64Array | BigUint64Array} stats
* @param {number} offset
* @returns
* @returns {BigIntStats | Stats}
*/
function getStatsFromBinding(stats, offset = 0) {
if (isBigUint64Array(stats)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/modules/esm/resolve.js
Expand Up @@ -609,7 +609,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath,
* @param {Exports} exports
* @param {URL} packageJSONUrl
* @param {string | URL | undefined} base
* @returns
* @returns {boolean}
*/
function isConditionalExportsMainSugar(exports, packageJSONUrl, base) {
if (typeof exports === 'string' || ArrayIsArray(exports)) return true;
Expand Down Expand Up @@ -724,7 +724,7 @@ function patternKeyCompare(a, b) {
* @param {string} name
* @param {string | URL | undefined} base
* @param {Set<string>} conditions
* @returns
* @returns {URL}
*/
function packageImportsResolve(name, base, conditions) {
if (name === '#' || StringPrototypeStartsWith(name, '#/')) {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/per_context/primordials.js
Expand Up @@ -404,7 +404,7 @@ primordials.PromisePrototypeCatch = (thisPromise, onRejected) =>
* @param {Promise<any>} thisPromise
* @param {() => void) | undefined | null} onFinally The callback to execute
* when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
* @returns {Promise} A Promise for the completion of the callback.
*/
primordials.SafePromisePrototypeFinally = (thisPromise, onFinally) =>
// Wrapping on a new Promise is necessary to not expose the SafePromise
Expand Down

0 comments on commit e6accfa

Please sign in to comment.