Skip to content

Commit 3c499db

Browse files
keithbentrupnmalevanec
authored and
nmalevanec
committed
declare var to fix scope error
1 parent 9d6399e commit 3c499db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/category-checkbox-tree.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ define([
3333
data = {},
3434
parameters = {},
3535
root = {},
36-
len = 0,
3736
key = '';
3837

3938
/**
@@ -160,15 +159,15 @@ define([
160159
* @returns {void}
161160
*/
162161
categoryLoader.buildCategoryTree = function (parent, nodeConfig) {
163-
var j = 0;
162+
var i = 0;
164163

165164
if (!nodeConfig) {
166165
return null;
167166
}
168167

169168
if (parent && nodeConfig && nodeConfig.length) {
170-
for (j = 0; j < nodeConfig.length; j++) {
171-
categoryLoader.processCategoryTree(parent, nodeConfig, j);
169+
for (i; i < nodeConfig.length; i++) {
170+
categoryLoader.processCategoryTree(parent, nodeConfig, i);
172171
}
173172
}
174173
};
@@ -180,14 +179,15 @@ define([
180179
* @returns {Object}
181180
*/
182181
categoryLoader.buildHashChildren = function (hash, node) {
183-
var j = 0;
182+
var i = 0,
183+
len;
184184

185185
if (node.childNodes.length > 0 || node.loaded === false && node.loading === false) {
186186
hash.children = [];
187187

188-
for (j = 0, len = node.childNodes.length; j < len; j++) {
188+
for (i, len = node.childNodes.length; i < len; i++) {
189189
hash.children = hash.children ? hash.children : [];
190-
hash.children.push(this.buildHash(node.childNodes[j]));
190+
hash.children.push(this.buildHash(node.childNodes[i]));
191191
}
192192
}
193193

0 commit comments

Comments
 (0)