Our module system currently allows cycles. However, the result of a cycle
is often not what you'd want. What we do when defining modules is:

module.exports = {};
factory(module) // either adds properties to or clobbers module.exports
return module.exports;

So, cycles in require()s will work only when:
a) exports is extended instead of clobbered, and
b) the result of the require is not used at the modules scope.

I think these restrictions are too hard to get right, and that we should
just make require cycles an error. Objections?

Andrew

Reply via email to