Skip to content

Commit 2bf4697

Browse files
committed
repl: remove duplicate util binding
PR-URL: #22675 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 7e4b0a4 commit 2bf4697

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/repl.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const {
5454
const internalUtil = require('internal/util');
5555
const util = require('util');
5656
const { internalBinding } = require('internal/bootstrap/loaders');
57-
const utilBinding = internalBinding('util');
5857
const { inherits } = util;
5958
const Stream = require('stream');
6059
const vm = require('vm');
@@ -79,7 +78,9 @@ const {
7978
propertyFilter: {
8079
ALL_PROPERTIES,
8180
SKIP_SYMBOLS
82-
}
81+
},
82+
startSigintWatchdog,
83+
stopSigintWatchdog
8384
} = internalBinding('util');
8485

8586
// Lazy-loaded.
@@ -314,7 +315,7 @@ function REPLServer(prompt,
314315
if (self.breakEvalOnSigint) {
315316
// Start the SIGINT watchdog before entering raw mode so that a very
316317
// quick Ctrl+C doesn't lead to aborting the process completely.
317-
if (!utilBinding.startSigintWatchdog())
318+
if (!startSigintWatchdog())
318319
throw new ERR_CANNOT_WATCH_SIGINT();
319320
previouslyInRawMode = self._setRawMode(false);
320321
}
@@ -338,7 +339,7 @@ function REPLServer(prompt,
338339

339340
// Returns true if there were pending SIGINTs *after* the script
340341
// has terminated without being interrupted itself.
341-
if (utilBinding.stopSigintWatchdog()) {
342+
if (stopSigintWatchdog()) {
342343
self.emit('SIGINT');
343344
}
344345
}

0 commit comments

Comments
 (0)