From ef767a28b25b96b7936123c5c90182885a8297d9 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Mar 2019 22:36:30 +0800 Subject: [PATCH] repl: eliminate var in function _memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/26496 Reviewed-By: Ruben Bridgewater Reviewed-By: Michaël Zasso Reviewed-By: Anto Aravinth Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- lib/repl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index c93afbc5d69396..035229f08af52a 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -1319,7 +1319,7 @@ function _memory(cmd) { let up = cmd.match(/[})]/g); up = up ? up.length : 0; dw = dw ? dw.length : 0; - var depth = dw - up; + let depth = dw - up; if (depth) { (function workIt() { @@ -1338,9 +1338,9 @@ function _memory(cmd) { }); } else if (depth < 0) { // Going... up. - var curr = self.lines.level.pop(); + const curr = self.lines.level.pop(); if (curr) { - var tmp = curr.depth + depth; + const tmp = curr.depth + depth; if (tmp < 0) { // More to go, recurse depth += curr.depth;