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 <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and rvagg committed Feb 8, 2016
1 parent e5254c1 commit 7fa5959
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 7fa5959

Please sign in to comment.