joyent/node — pull request #2202 by seebees (2011-11-27 04:11:05+00:00)
Title: don't double-eval

to determine if a command is complete the REPL should eval in a separate context.

This should fix #807 and #870. Funny that these two cases would be the same. I don't know if you want to accept this because it is a bit inefficient. But it does solve the problem.

This is the same technique as the local tab complete. I do not know how many REPL's people are using per node process and I don't know the expected concurrency. Since all the REPL's generally use the same context I could make both this and the tab complete use a singleton. But that would be a problem is you have 2 users typing into the same RPEL.

Of course, test included.