Content-Length: 294718 | pFad | https://github.com/nodejs/node/commit/984f7ef5bd

1A readline: add support for `Symbol.dispose` · nodejs/node@984f7ef · GitHub
Skip to content

Commit 984f7ef

Browse files
committed
readline: add support for Symbol.dispose
PR-URL: #57276 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
1 parent b10ac9a commit 984f7ef

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

doc/api/readline.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ the `'close'` event will be emitted.
272272
Calling `rl.close()` does not immediately stop other events (including `'line'`)
273273
from being emitted by the `InterfaceConstructor` instance.
274274

275+
### `rl[Symbol.dispose]()`
276+
277+
<!-- YAML
278+
added: REPLACEME
279+
-->
280+
281+
Alias for `rl.close()`.
282+
275283
### `rl.pause()`
276284

277285
<!-- YAML

lib/internal/readline/interface.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,7 @@ class Interface extends InterfaceConstructor {
13711371
return this[kLineObjectStream];
13721372
}
13731373
}
1374+
Interface.prototype[SymbolDispose] = Interface.prototype.close;
13741375

13751376
module.exports = {
13761377
Interface,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nodejs/node/commit/984f7ef5bd

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy