Skip to content

Commit

Permalink
tools: fix redeclared vars in doc/json.js
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and jasnell committed Feb 4, 2016
1 parent 34a5019 commit c14c12e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/doc/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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]);
});
Expand Down

0 comments on commit c14c12e

Please sign in to comment.