From c14c12e6baf0c5f4910fc0c33ec610dc5119a0d9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 2 Feb 2016 16:20:44 -0800 Subject: [PATCH] tools: fix redeclared vars in doc/json.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/5047 Reviewed-By: Colin Ihrig Reviewed-By: Roman Reiss Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- tools/doc/json.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/doc/json.js b/tools/doc/json.js index b507c5412e9257..299c8ed9fd84ad 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -184,14 +184,13 @@ function processList(section) { var type = tok.type; if (type === 'space') return; if (type === 'list_item_start') { + var n = {}; if (!current) { - var n = {}; values.push(n); current = n; } else { current.options = current.options || []; stack.push(current); - var n = {}; current.options.push(n); current = n; } @@ -478,14 +477,14 @@ function deepCopy(src, dest) { function deepCopy_(src) { if (!src) return src; if (Array.isArray(src)) { - var c = new Array(src.length); + const c = new Array(src.length); src.forEach(function(v, i) { c[i] = deepCopy_(v); }); return c; } if (typeof src === 'object') { - var c = {}; + const c = {}; Object.keys(src).forEach(function(k) { c[k] = deepCopy_(src[k]); });