From b8ea176fb7925fbaea2b164ee5c4d3798a3bec7b Mon Sep 17 00:00:00 2001 From: Robin Lambertz Date: Fri, 17 Oct 2014 18:28:38 +0200 Subject: [PATCH] Use proper for loop in getField, fixes #103 some tools add custom functions to Array, which breaks for/in loops on array. --- lib/protocol.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protocol.js b/lib/protocol.js index 3d7756d..0d0cece 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -1180,7 +1180,7 @@ function sizeOfArray(value, typeArgs, rootNode) { function getField(countField, rootNode) { var countFieldArr = countField.split("."); var count = rootNode; - for (var index in countFieldArr) { + for (var index = 0; index < countFieldArr.length; index++) { count = count[countFieldArr[index]]; } return count;