repl: keep entries added while history file is loading · nodejs/node@bb499c3 · GitHub
Skip to content

Commit bb499c3

Browse files
mhaykaduh95
authored andcommitted
repl: keep entries added while history file is loading
Lines can be evaluated while the history file is still being read asynchronously by setupHistory(), e.g. when the input stream does not support pausing. The entries added to the in-memory history in the meantime were discarded once the file load completed, because the loaded entries overwrote the in-memory history. Merge the persisted entries with the in-memory ones instead. Refs: #64508 Signed-off-by: Mhayk Whandson <hi@mhayk.com> PR-URL: #64513 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent cf39500 commit bb499c3

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

lib/internal/repl/history.js

Lines changed: 15 additions & 3 deletions
Lines changed: 64 additions & 0 deletions

0 commit comments

Comments
 (0)