From bf67d802fc2ed02831f2fd0aa5c8e0f3488d7b56 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Fri, 7 Jul 2017 15:13:18 -0700 Subject: [PATCH] Begin changing `ProgressBarRenderer` to an ES `class`. --- tools/console/console.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/console/console.js b/tools/console/console.js index c751e3d6d9..7637746fcc 100644 --- a/tools/console/console.js +++ b/tools/console/console.js @@ -241,20 +241,22 @@ class SpinnerRenderer { } // Renders a progressbar. Based on the npm 'progress' module, but tailored to our needs (i.e. renders to string) -var ProgressBarRenderer = function (format, options) { - var self = this; +class ProgressBarRenderer { + constructor(format, options) { + var self = this; - options = options || {}; + options = options || {}; - self.fmt = format; - self.curr = 0; - self.total = 100; - self.maxWidth = options.maxWidth || self.total; - self.chars = { - complete : '=', - incomplete : ' ' - }; -}; + self.fmt = format; + self.curr = 0; + self.total = 100; + self.maxWidth = options.maxWidth || self.total; + self.chars = { + complete : '=', + incomplete : ' ' + }; + } +} _.extend(ProgressBarRenderer.prototype, { asString: function (availableSpace) {