From 3c7c584444873221521a3154571630bfdd62f0e6 Mon Sep 17 00:00:00 2001 From: Rahat Ahmed Date: Sun, 19 Jun 2016 02:34:48 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Don't=20load=20'repl'=20unless?= =?UTF-8?q?=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git bisect revealed that process.stdout failed to initiate (and was replaced with a write stream that does nothing) when the 'repl' module was loaded. This commit moves `require('repl')` so that it is only loaded when the --interactive flag is present. Fixes #5051 --- default_app/main.js | 2 +- spec/node-spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default_app/main.js b/default_app/main.js index 9c6636389c9e..4e5ea96b03eb 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -3,7 +3,6 @@ const {app, dialog, shell, Menu} = require('electron') const fs = require('fs') const Module = require('module') const path = require('path') -const repl = require('repl') const url = require('url') // Parse command line options. @@ -315,6 +314,7 @@ function startRepl () { return } + const repl = require('repl') repl.start('> ').on('exit', () => { process.exit(0) }) diff --git a/spec/node-spec.js b/spec/node-spec.js index 93a247ef4ff6..443b9be5624b 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -225,7 +225,7 @@ describe('node feature', function () { process.stdout.write('test') }) - xit('should have isTTY defined', function () { + it('should have isTTY defined', function () { assert.equal(typeof process.stdout.isTTY, 'boolean') }) })