repl: don't touch `require.cache`
authorNathan Rajlich <nathan@tootallnate.net>
Fri, 21 Dec 2012 19:42:40 +0000 (11:42 -0800)
committerNathan Rajlich <nathan@tootallnate.net>
Fri, 21 Dec 2012 19:42:40 +0000 (11:42 -0800)
commit837df70b7576089f808ab3acf626cb06e430f4f6
treef3ec7f8b233e4b6161d984d0fc73538c9dea9f67
parent841b7f534b80b86d4f815ed3d66f7ac9c1944841
repl: don't touch `require.cache`

Fixes #3226.

Consider a production server that uses a REPL to debug. Creating the instance
would wipe out the global cache of modules, and subsequent "require" calls in
the server would be reloaded from disk. The REPL should observe only, without
altering, its environment.
lib/repl.js
test/simple/test-repl-require-cache.js [new file with mode: 0644]