diff --git a/doc/api/domain.markdown b/doc/api/domain.markdown index 24acd295b79..4161e2579eb 100644 --- a/doc/api/domain.markdown +++ b/doc/api/domain.markdown @@ -27,11 +27,11 @@ Any time an Error object is routed through a domain, a few extra fields are added to it. * `error.domain` The domain that first handled the error. -* `error.domain_emitter` The event emitter that emitted an 'error' event +* `error.domainEmitter` The event emitter that emitted an 'error' event with the error object. -* `error.domain_bound` The callback function which was bound to the +* `error.domainBound` The callback function which was bound to the domain, and passed an error as its first argument. -* `error.domain_thrown` A boolean indicating whether the error was +* `error.domainThrown` A boolean indicating whether the error was thrown, emitted, or passed to a bound callback function. ## Implicit Binding diff --git a/lib/domain.js b/lib/domain.js index 32259d7a739..7af08ebd147 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -140,8 +140,8 @@ Domain.prototype.bind = function(cb, interceptError) { (arguments[0] instanceof Error)) { var er = arguments[0]; util._extend(er, { - domain_bound: cb, - domain_thrown: false, + domainBound: cb, + domainThrown: false, domain: self }); self.emit('error', er); diff --git a/lib/events.js b/lib/events.js index eb0aa16e43e..223015ec602 100644 --- a/lib/events.js +++ b/lib/events.js @@ -58,9 +58,9 @@ EventEmitter.prototype.emit = function(type) { { if (this.domain) { var er = arguments[1]; - er.domain_emitter = this; + er.domainEmitter = this; er.domain = this.domain; - er.domain_thrown = false; + er.domainThrown = false; this.domain.emit('error', er); return false; } diff --git a/src/node.js b/src/node.js index bfd312b30fc..98523c5303b 100644 --- a/src/node.js +++ b/src/node.js @@ -231,7 +231,7 @@ return true; er.domain = domain; - er.domain_thrown = true; + er.domainThrown = true; // wrap this in a try/catch so we don't get infinite throwing try { // One of three things will happen here. diff --git a/test/simple/test-domain-implicit-fs.js b/test/simple/test-domain-implicit-fs.js index 665a821abf0..c701c931582 100644 --- a/test/simple/test-domain-implicit-fs.js +++ b/test/simple/test-domain-implicit-fs.js @@ -36,8 +36,8 @@ d.on('error', function(er) { console.error('caught', er); assert.strictEqual(er.domain, d); - assert.strictEqual(er.domain_thrown, true); - assert.ok(!er.domain_emitter); + assert.strictEqual(er.domainThrown, true); + assert.ok(!er.domainEmitter); assert.strictEqual(er.code, 'ENOENT'); assert.ok(/\bthis file does not exist\b/i.test(er.path)); assert.strictEqual(typeof er.errno, 'number'); diff --git a/test/simple/test-domain.js b/test/simple/test-domain.js index 183e2deb923..c47e2d7352a 100644 --- a/test/simple/test-domain.js +++ b/test/simple/test-domain.js @@ -53,28 +53,28 @@ d.on('error', function(er) { switch (er_message) { case 'emitted': assert.equal(er.domain, d); - assert.equal(er.domain_emitter, e); - assert.equal(er.domain_thrown, false); + assert.equal(er.domainEmitter, e); + assert.equal(er.domainThrown, false); break; case 'bound': - assert.ok(!er.domain_emitter); + assert.ok(!er.domainEmitter); assert.equal(er.domain, d); - assert.equal(er.domain_bound, fn); - assert.equal(er.domain_thrown, false); + assert.equal(er.domainBound, fn); + assert.equal(er.domainThrown, false); break; case 'thrown': - assert.ok(!er.domain_emitter); + assert.ok(!er.domainEmitter); assert.equal(er.domain, d); - assert.equal(er.domain_thrown, true); + assert.equal(er.domainThrown, true); break; case "ENOENT, open 'this file does not exist'": assert.equal(er.domain, d); - assert.equal(er.domain_thrown, false); - assert.equal(typeof er.domain_bound, 'function'); - assert.ok(!er.domain_emitter); + assert.equal(er.domainThrown, false); + assert.equal(typeof er.domainBound, 'function'); + assert.ok(!er.domainEmitter); assert.equal(er.code, 'ENOENT'); assert.equal(er_path, 'this file does not exist'); assert.equal(typeof er.errno, 'number'); @@ -85,33 +85,33 @@ d.on('error', function(er) { assert.equal(er.code, 'ENOENT'); assert.equal(er_path, 'stream for nonexistent file'); assert.equal(er.domain, d); - assert.equal(er.domain_emitter, fst); - assert.ok(!er.domain_bound); - assert.equal(er.domain_thrown, false); + assert.equal(er.domainEmitter, fst); + assert.ok(!er.domainBound); + assert.equal(er.domainThrown, false); break; case 'implicit': - assert.equal(er.domain_emitter, implicit); + assert.equal(er.domainEmitter, implicit); assert.equal(er.domain, d); - assert.equal(er.domain_thrown, false); - assert.ok(!er.domain_bound); + assert.equal(er.domainThrown, false); + assert.ok(!er.domainBound); break; case 'implicit timer': assert.equal(er.domain, d); - assert.equal(er.domain_thrown, true); - assert.ok(!er.domain_emitter); - assert.ok(!er.domain_bound); + assert.equal(er.domainThrown, true); + assert.ok(!er.domainEmitter); + assert.ok(!er.domainBound); break; case 'Cannot call method \'isDirectory\' of undefined': assert.equal(er.domain, d); - assert.ok(!er.domain_emitter); - assert.ok(!er.domain_bound); + assert.ok(!er.domainEmitter); + assert.ok(!er.domainBound); break; default: - console.error('unexpected error, throwing %j', er.message || er); + console.error('unexpected error, throwing %j', er.message, er); throw er; }