From 2bf4697ff4be6a510410be1f1e67549be347614b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 3 Sep 2018 11:28:38 -0400 Subject: [PATCH] repl: remove duplicate util binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/22675 Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Gus Caplan Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/repl.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index a7e8b4cd27969f..3f3d33175c57f2 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -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'); } }