diff options
-rw-r--r-- | lib/domain.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/domain.js b/lib/domain.js index 3dc56c179a..697ef6d8ad 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -28,7 +28,6 @@ const { Object, Reflect } = primordials; -const util = require('util'); const EventEmitter = require('events'); const { ERR_DOMAIN_CALLBACK_NOT_AVAILABLE, @@ -207,7 +206,7 @@ Domain.prototype.members = undefined; Domain.prototype._errorHandler = function(er) { var caught = false; - if (!util.isPrimitive(er)) { + if ((typeof er === 'object' && er !== null) || typeof er === 'function') { Object.defineProperty(er, 'domain', { configurable: true, enumerable: false, |