src: fix module search path for preload modules
authorAli Ijaz Sheikh <ofrobots@google.com>
Wed, 27 May 2015 17:11:30 +0000 (10:11 -0700)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Sat, 30 May 2015 14:36:09 +0000 (10:36 -0400)
commit5759722cfacf17cc79651c81801a5e03521db053
treeb4bb49403e7346dd166f64820ef7e2adff284a85
parent53e98cc1b44203147c0abdc03eb0e57e34c4274d
src: fix module search path for preload modules

When the preload module is not a abs/relative path, we should use
the standard search mechanism of looking into the node_modules folders
outwards. The current working directory is deemed to be the 'requiring
module', i.e. parent. The search path starts from cwd outwards.

Fixes: https://github.com/nodejs/io.js/issues/1803
PR-URL: https://github.com/nodejs/io.js/pull/1812
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
lib/module.js
src/node.js
test/fixtures/cluster-preload.js