Skip to content

Commit 7fa5959

Browse files
Trottrvagg
authored andcommitted
tools: fix redeclared vars in doc/json.js
PR-URL: #5047 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e5254c1 commit 7fa5959

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/doc/json.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,13 @@ function processList(section) {
184184
var type = tok.type;
185185
if (type === 'space') return;
186186
if (type === 'list_item_start') {
187+
var n = {};
187188
if (!current) {
188-
var n = {};
189189
values.push(n);
190190
current = n;
191191
} else {
192192
current.options = current.options || [];
193193
stack.push(current);
194-
var n = {};
195194
current.options.push(n);
196195
current = n;
197196
}
@@ -478,14 +477,14 @@ function deepCopy(src, dest) {
478477
function deepCopy_(src) {
479478
if (!src) return src;
480479
if (Array.isArray(src)) {
481-
var c = new Array(src.length);
480+
const c = new Array(src.length);
482481
src.forEach(function(v, i) {
483482
c[i] = deepCopy_(v);
484483
});
485484
return c;
486485
}
487486
if (typeof src === 'object') {
488-
var c = {};
487+
const c = {};
489488
Object.keys(src).forEach(function(k) {
490489
c[k] = deepCopy_(src[k]);
491490
});

0 commit comments

Comments
 (0)