diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-10-03 02:56:18 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-12 21:59:34 -0700 |
commit | fce1a5198a89e8f62ea2d093e01971db46da9bf5 (patch) | |
tree | ce4ac9be5cba85236421ee672bd3b5249872ba5a /lib | |
parent | 27507ca10846592a928cb3b6e7f8152d8090a24d (diff) | |
download | android-node-v8-fce1a5198a89e8f62ea2d093e01971db46da9bf5.tar.gz android-node-v8-fce1a5198a89e8f62ea2d093e01971db46da9bf5.tar.bz2 android-node-v8-fce1a5198a89e8f62ea2d093e01971db46da9bf5.zip |
domain: do not import util for a simple type check
This removes `require('util')` from the `domain` module. There was
only a single simple type check used from the `util` module which
is now inlined instead.
PR-URL: https://github.com/nodejs/node/pull/29825
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'lib')
-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, |