Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix test-domains2.js

  • Loading branch information
ry committed Sep 19, 2011
1 parent e1eee5b commit afa08ad98ca957a7962f532a80de13568ce8452e
Showing with 14 additions and 4 deletions.
  1. +7 −1 lib/domains.js
  2. +2 −2 lib/timers_uv.js
  3. +5 −1 src/node.js
@@ -76,6 +76,9 @@ Domain.prototype.kill = function() {
debug("kill handle", handle);

if (handle._onTimeout || handle.ontimeout) {
// Clean up timer pseudo handles. See lib/timers_uv.js for a
// description of what a "pseudo handle" is.

// We may be calling domain.remove(handle) on a domain which is not our
// own. This is because the timers sometimes share a handle
// in JavaScript land.
@@ -85,8 +88,11 @@ Domain.prototype.kill = function() {

handle._onTimeout = null
handle.ontimeout = null
} else {
} else if (handle.close) {
// Clean up real (libuv) handles (timer, tcp, pipe, etc)
handle.close();
} else {
// Clean up requests (like from fs or dns)
handle.oncomplete = null;
}
}
@@ -124,8 +124,8 @@ function insert(item, msecs) {
assert(L.isEmpty(list));

if (process.features.domains) {
assert(list.domains);
assert(list.domains == require('domains').defaultDomain);
assert(list.domain);
assert(list.domain == require('domains').defaultDomain);
assert(require('domains').getCurrent() ==
require('domains').defaultDomain,
"not in defaultDomain when we expected to be");
@@ -551,7 +551,11 @@
domain.enter();

try {
obj[method](arg0, arg1, arg2, arg3);
if (typeof obj[method] == 'function') {
obj[method](arg0, arg1, arg2, arg3);
} else {
// print error?
}
} catch (e) {
throw e;
domain.emit('error', e);

0 comments on commit afa08ad

Please sign in to comment.
You can’t perform that action at this time.