If the module uses some form of internal storage (for caching, module level 
object registration, etc.) it would be duplicated and then you could see 
some interesting cache mismatch bugs.

For example in the following module 2 registries would exist rather than 
the expected one if completely reloaded:

```javascript
var registeredHandlers = {};
exports.register = function (event, fn) {registeredHandlers[event] = fn;}
exports.fire = function (event) {registeredHandlers[event]();}
```

Soo... if you setup a "prestart" function, then it gets reloaded, and 
someone attempts to fire "prestart" on the reloaded module; it would not 
contain the function originally registered as "prestart" and be a cache 
mismatch, which would be very hard to debug.

Don't introduce side effects into other authors' modules, so never ever do 
this without knowing you can cause cache mismatches.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to