mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
This commit is contained in:
committed by
Rich Trott
parent
27507ca108
commit
fce1a5198a
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user