readline: add support for Symbol.dispose

PR-URL: https://github.com/nodejs/node/pull/57276
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
This commit is contained in:
Antoine du Hamel authored and GitHub committed 2025-03-04 17:54:01 +00:00
1 parent 6fdd4e6dcf
commit db00f94018
2 files changed
+9

No files matched your search

+8
View File
@@ -272,6 +272,14 @@ the `'close'` event will be emitted.
Calling `rl.close()` does not immediately stop other events (including `'line'`)
from being emitted by the `InterfaceConstructor` instance.
### `rl[Symbol.dispose]()`
<!-- YAML
added: REPLACEME
-->
Alias for `rl.close()`.
### `rl.pause()`
<!-- YAML
+1
View File
@@ -1371,6 +1371,7 @@ class Interface extends InterfaceConstructor {
return this[kLineObjectStream];
}
}
Interface.prototype[SymbolDispose] = Interface.prototype.close;
module.exports = {
Interface,