From 283f1e8721dcf9787fe7fb656260dd99ebdc33b7 Mon Sep 17 00:00:00 2001 From: Danielle Adams Date: Tue, 1 Feb 2022 01:24:17 -0500 Subject: [PATCH] lib: fix linting warnings and errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41805 Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott --- lib/internal/bootstrap/node.js | 2 +- lib/internal/streams/utils.js | 9 --------- lib/readline.js | 6 +++++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 3fe41cf1cf8d56..1393cc20f45db6 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -56,7 +56,7 @@ const { } = primordials; const config = internalBinding('config'); const internalTimers = require('internal/timers'); -const { deprecate, lazyDOMExceptionClass } = require('internal/util'); +const { deprecate } = require('internal/util'); setupProcessObject(); diff --git a/lib/internal/streams/utils.js b/lib/internal/streams/utils.js index 67550553515911..1b317eeb7e5cb5 100644 --- a/lib/internal/streams/utils.js +++ b/lib/internal/streams/utils.js @@ -6,7 +6,6 @@ const { SymbolIterator, } = primordials; -const kDestroyed = Symbol('kDestroyed'); const kIsErrored = Symbol('kIsErrored'); const kIsReadable = Symbol('kIsReadable'); const kIsDisturbed = Symbol('kIsDisturbed'); @@ -112,14 +111,6 @@ function isReadableFinished(stream, strict) { ); } -function isDisturbed(stream) { - return !!(stream && ( - stream.readableDidRead || - stream.readableAborted || - stream[kIsDisturbed] - )); -} - function isReadable(stream) { if (stream && stream[kIsReadable] != null) return stream[kIsReadable]; const r = isReadableNodeStream(stream); diff --git a/lib/readline.js b/lib/readline.js index 1b8b276a6d6db0..a6eecc763ae3a1 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -1283,7 +1283,11 @@ Interface.prototype._ttyWrite = function(s, key) { /** * Creates an `AsyncIterator` object that iterates through * each line in the input stream as a string. - * @returns {Symbol.AsyncIterator} + * @typedef {{ + * [Symbol.asyncIterator]: () => InterfaceAsyncIterator, + * next: () => Promise + * }} InterfaceAsyncIterator + * @returns {InterfaceAsyncIterator} */ Interface.prototype[SymbolAsyncIterator] = function() { if (this[kLineObjectStream] === undefined) {