0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00

repl: remove duplicate util binding

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
cjihrig 2018-09-03 11:28:38 -04:00
parent 7e4b0a4850
commit 2bf4697ff4
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -54,7 +54,6 @@ const {
const internalUtil = require('internal/util');
const util = require('util');
const { internalBinding } = require('internal/bootstrap/loaders');
const utilBinding = internalBinding('util');
const { inherits } = util;
const Stream = require('stream');
const vm = require('vm');
@ -79,7 +78,9 @@ const {
propertyFilter: {
ALL_PROPERTIES,
SKIP_SYMBOLS
}
},
startSigintWatchdog,
stopSigintWatchdog
} = internalBinding('util');
// Lazy-loaded.
@ -314,7 +315,7 @@ function REPLServer(prompt,
if (self.breakEvalOnSigint) {
// Start the SIGINT watchdog before entering raw mode so that a very
// quick Ctrl+C doesn't lead to aborting the process completely.
if (!utilBinding.startSigintWatchdog())
if (!startSigintWatchdog())
throw new ERR_CANNOT_WATCH_SIGINT();
previouslyInRawMode = self._setRawMode(false);
}
@ -338,7 +339,7 @@ function REPLServer(prompt,
// Returns true if there were pending SIGINTs *after* the script
// has terminated without being interrupted itself.
if (utilBinding.stopSigintWatchdog()) {
if (stopSigintWatchdog()) {
self.emit('SIGINT');
}
}