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

domain: dry decorate using util._extend

  • Loading branch information...
AndreasMadsen authored and bnoordhuis committed Jun 8, 2012
1 parent 26f754d commit 77cfbd9f2d286368627a8dfa4f4f5cbdfd6f89e1
Showing with 2 additions and 10 deletions.
  1. +2 −10 lib/domain.js
View
@@ -53,7 +53,7 @@ function uncaughtHandler(er) {
// if there's an active domain, then handle this there.
// Note that if this error emission throws, then it'll just crash.
if (exports.active && !exports.active._disposed) {
- decorate(er, {
+ util._extend(er, {
domain: exports.active,
domain_thrown: true
});
@@ -158,7 +158,7 @@ Domain.prototype.bind = function(cb, interceptError) {
if (interceptError && arguments[0] &&
(arguments[0] instanceof Error)) {
var er = arguments[0];
- decorate(er, {
+ util._extend(er, {
domain_bound: cb,
domain_thrown: false,
domain: self
@@ -251,11 +251,3 @@ Domain.prototype.dispose = function() {
// so that it can't be entered or activated.
this._disposed = true;
};
-
-
-function decorate(er, props) {
- Object.keys(props).forEach(function(k, _, __) {
- if (er.hasOwnProperty(k)) return;
- er[k] = props[k];
- });
-}

0 comments on commit 77cfbd9

Please sign in to comment.