domain: remove deprecated API call

PR-URL: https://github.com/nodejs/node/pull/59339
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This commit is contained in:
Alex Yang 2025-08-04 20:51:16 -07:00 committed by GitHub
parent 84fed8d8a0
commit 9bcc5a8f01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -270,7 +270,7 @@ Domain.prototype._errorHandler = function(er) {
// as this would throw an error, make the process exit, and thus
// prevent the process 'uncaughtException' event from being emitted
// if a listener is set.
if (EventEmitter.listenerCount(this, 'error') > 0) {
if (this.listenerCount('error') > 0) {
// Clear the uncaughtExceptionCaptureCallback so that we know that, since
// the top-level domain is not active anymore, it would be ok to abort on
// an uncaught exception at this point