Skip to content

Commit

Permalink
repl: eliminate var in function _memory
Browse files Browse the repository at this point in the history
PR-URL: nodejs#26496
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
gengjiawen authored and BridgeAR committed Mar 13, 2019
1 parent 2c1a8c8 commit 024842f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,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() {
Expand All @@ -1360,9 +1360,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;
Expand Down

0 comments on commit 024842f

Please sign in to comment.