Skip to content

Commit

Permalink
readline: add support for Symbol.dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Mar 2, 2025
1 parent d1ec948 commit 3949f24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/internal/readline/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ class Interface extends InterfaceConstructor {
return this[kLineObjectStream];
}
}
Interface.prototype[SymbolDispose] = Interface.prototype.close;

module.exports = {
Interface,
Expand Down

0 comments on commit 3949f24

Please sign in to comment.