I'm exploring domains now. Adding a hook into MakeCallback would be nice, actually. You can get pretty far without it, but not quite as far as I'd like. Having a single point where all JS->C++ callbacks flow through is really nice, and generally good design, imo. Scrapping it entirely is a waste of an opportunity. We ought to just make it not suck.
What I'm noticing is: 1. We don't use MakeCallback quite everywhere that we could. 2. It uses a char* each time, rather than storing a symbol, or just taking a function. For #1, it looks like a modest change to node_file.cc and a few other places can clean this up pretty easily. For #2, I'm going to investigate the performance impact of changing this function signature to take a Handle<Function> instead of a const char*. That would make for slightly more complexity in the consumers, since they'll have to store a symbol or something, but it'll also probably run faster. We'll see. Another option would be to make every ReqWrap object's callback named "oncomplete" or perhaps some small set of consistent names, so that the same symbol could be used over and over again. On Sat, Apr 7, 2012 at 17:12, Ben Noordhuis <i...@bnoordhuis.nl> wrote: > On Sun, Apr 8, 2012 at 01:06, Jann Horn <jannh...@googlemail.com> wrote: >> Wasn't MakeCallback() also supposed to handle the domains stuff? > > Yes, but there's more than one way to skin a cat. > >> And don't many C++ modules use that? > > Undoubtedly. When I say "scratch" I mean remove usage in core, not > remove altogether (not right away at least, it gets deprecated first).