From 3c610ca604f753f347f8b3fc58d7c69c5a954fbc Mon Sep 17 00:00:00 2001 From: Paul An Date: Mon, 14 Oct 2019 16:16:42 +0900 Subject: [PATCH] change variable name --- lib/cli/watch-run.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cli/watch-run.js b/lib/cli/watch-run.js index 65bad013d3..d5611f49cd 100644 --- a/lib/cli/watch-run.js +++ b/lib/cli/watch-run.js @@ -85,15 +85,15 @@ const createRerunner = (mocha, beforeRun) => { let rerunScheduled = false; - let defaultGlobals = null; + let initialGlobals = null; const run = () => { try { beforeRun(); resetMocha(mocha); - if (!defaultGlobals) { - defaultGlobals = Object.keys(global); + if (!initialGlobals) { + initialGlobals = Object.keys(global); } runner = mocha.run(() => { @@ -121,13 +121,13 @@ const createRerunner = (mocha, beforeRun) => { }; const rerun = () => { - if (defaultGlobals) { + if (initialGlobals) { Object.keys(global).forEach(k => { - if (defaultGlobals.indexOf(k) === -1) { + if (initialGlobals.indexOf(k) === -1) { delete global[k]; } }); - defaultGlobals = null; + initialGlobals = null; } rerunScheduled = false;