tools: fix redeclared vars in doc/json.js
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
34a5019b6b
commit
c14c12e6ba
@ -184,14 +184,13 @@ function processList(section) {
|
|||||||
var type = tok.type;
|
var type = tok.type;
|
||||||
if (type === 'space') return;
|
if (type === 'space') return;
|
||||||
if (type === 'list_item_start') {
|
if (type === 'list_item_start') {
|
||||||
|
var n = {};
|
||||||
if (!current) {
|
if (!current) {
|
||||||
var n = {};
|
|
||||||
values.push(n);
|
values.push(n);
|
||||||
current = n;
|
current = n;
|
||||||
} else {
|
} else {
|
||||||
current.options = current.options || [];
|
current.options = current.options || [];
|
||||||
stack.push(current);
|
stack.push(current);
|
||||||
var n = {};
|
|
||||||
current.options.push(n);
|
current.options.push(n);
|
||||||
current = n;
|
current = n;
|
||||||
}
|
}
|
||||||
@ -478,14 +477,14 @@ function deepCopy(src, dest) {
|
|||||||
function deepCopy_(src) {
|
function deepCopy_(src) {
|
||||||
if (!src) return src;
|
if (!src) return src;
|
||||||
if (Array.isArray(src)) {
|
if (Array.isArray(src)) {
|
||||||
var c = new Array(src.length);
|
const c = new Array(src.length);
|
||||||
src.forEach(function(v, i) {
|
src.forEach(function(v, i) {
|
||||||
c[i] = deepCopy_(v);
|
c[i] = deepCopy_(v);
|
||||||
});
|
});
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
if (typeof src === 'object') {
|
if (typeof src === 'object') {
|
||||||
var c = {};
|
const c = {};
|
||||||
Object.keys(src).forEach(function(k) {
|
Object.keys(src).forEach(function(k) {
|
||||||
c[k] = deepCopy_(src[k]);
|
c[k] = deepCopy_(src[k]);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user