Skip to content

Commit

Permalink
repl: remove duplicate util binding
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cjihrig committed Sep 6, 2018
1 parent 7e4b0a4 commit 2bf4697
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -79,7 +78,9 @@ const {
propertyFilter: {
ALL_PROPERTIES,
SKIP_SYMBOLS
}
},
startSigintWatchdog,
stopSigintWatchdog
} = internalBinding('util');

// Lazy-loaded.
Expand Down Expand Up @@ -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);
}
Expand All @@ -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');
}
}
Expand Down

0 comments on commit 2bf4697

Please sign in to comment.