Do not cache modules that throw exceptions
authorFelix Geisendörfer <felix@debuggable.com>
Mon, 21 Feb 2011 14:46:34 +0000 (15:46 +0100)
committerRyan Dahl <ry@tinyclouds.org>
Fri, 25 Feb 2011 00:14:04 +0000 (16:14 -0800)
commit66601f13d9f841fe4e644a0b106ea3106054f46a
treec6bdf926b5d5ff18caced7b39768b8c047b0f48d
parenta2f498a5ef6c46a57a3e88bd6917c5e69d7a7321
Do not cache modules that throw exceptions

If a module throws an exception on load, it should not be cached.
This patch shows the problem in a test case and also fixes it.

See: https://groups.google.com/forum/#!topic/nodejs-dev/1cIrvJcADbY

Closes GH-707
Closes GH-710
lib/module.js
test/simple/test-require-exceptions.js [new file with mode: 0644]