repl: backslash bug fix
authorSakthipriyan Vairamani <thechargingvolcano@gmail.com>
Sun, 20 Sep 2015 10:37:21 +0000 (16:07 +0530)
committerRod Vagg <rod@vagg.org>
Tue, 22 Sep 2015 22:39:33 +0000 (08:39 +1000)
commitcb971cc97d217119ab8b3526cf9471caa3ba6ba7
treec1cc23dd5260c6dfcb480068f76a0c15dddd1d30
parentb93ad5abbdaa1af49453d6aee18968f44c50e07c
repl: backslash bug fix

The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
`\` as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with `null`, so that it will
properly skip the character next to it.

Previous Discussion: https://github.com/nodejs/node/pull/2952
Fixes: https://github.com/nodejs/node/issues/2749
PR-URL: https://github.com/nodejs/node/pull/2968
Reviewed-By: Roman Reiss <me@silverwind.io>
lib/repl.js
test/parallel/test-repl.js