> Would it be possible to have a "strict async" switch that make all Sync
> calls throw if called outside of startup or require sequences?
> This would make it easy to spot libraries that are potential perf killers.

I'm not sure how the node modules system behaves if you alter required
tables, so would this work*?

var gotyou = function() { throw new Error('Evil Sync caller you!'); };
for (var k in fs) {
    if (fs.hasOwnProperty(k) && k.search(/Sync$/) >= 0) { fs[k] = gotyou; }
}

*Unless something is that evil to cache the function pointers, or to
require later on. However, one could set "require" to gotyou as well
after startup.

-- 
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