cares_wrap: don't set oncomplete property from c++
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 12 Aug 2013 15:54:11 +0000 (17:54 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 12 Aug 2013 17:08:03 +0000 (19:08 +0200)
commit6cd7fd7d243fcf36b047b9c22a79927fb714d6cd
treefeb9407dfdcd2a897a8c0cca98d287e0d64a3e2c
parent4ffa943c3f25d801bb89744c94850484dc99231b
cares_wrap: don't set oncomplete property from c++

Don't set the oncomplete property in src/cares_wrap.cc, we can do it
just as easily in lib/dns.js.

Switch two closures to the 'function with _this_ object' model. Makes
it impossible for an overzealous closure to capture too much context
and accidentally hold on to too much memory.
lib/dns.js
src/cares_wrap.cc