You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
doc/bug: repl.start() prompt doesn't default to '> ' #5385
repl.js:198
throw new Error('An options Object, or a prompt String are required');
On line 252 of ./doc/api/repl.markdown, it is noted that prompt should default to > if an options object is passed in, but not what should happen if it is called without arguments.
I took a look at ./lib/readline.js and ./lib/repl.js and the culprit for the code snippet failing (if the docs represent the intended functionality) is line 197-198 of ./lib/repl.js.
Either way, it seems to me that either the docs should be updated to reflect the code, or those lines in ./lib/repl.js should be removed to make it fall back to an empty object and thus the default > prompt. No PR submitted because I don't know which of the directions to go in.
Activity
cjihrig commentedon Feb 23, 2016
PR coming.
julianduque commentedon Feb 23, 2016
I think example in docs should be updated, the options parameter isn't optional.
cjihrig commentedon Feb 23, 2016
See #5388
repl: accept no arguments to start()
repl: accept no arguments to start()
repl: accept no arguments to start()