Commit 29c4a2af authored by Mudit Ameta's avatar Mudit Ameta Committed by Jeremiah Senkpiel
Browse files

repl: Fixed node repl history edge case.

If the deprecated NODE_REPL_HISTORY_FILE is set to default
node history file path ($HOME/.node_repl_history) and the file
doesn't exist, then node creates the file and then crashes when
it tries to parse that file as JSON thinking that it's an older
JSON formatted history file. This fixes that bug.

This patch also prevents node repl from throwing if the old
history file is empty or if $HOME/.node_repl_history is empty.

Fixes: https://github.com/nodejs/node/issues/4102
PR-URL: https://github.com/nodejs/node/pull/4108


Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
parent 79dc1d76
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment