From eef2297935ebbe56a2705dca5c93e29aa1b080b0 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 4 Nov 2016 15:09:28 +0100 Subject: [PATCH] Fix two issues in compare() Variable `count` was never initialized, so incrementing resulted in a NaN. Creating `paths2` failed if `path._children` was `undefined`. --- src/path/PathItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/path/PathItem.js b/src/path/PathItem.js index 39a30308..1de2b798 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -776,11 +776,11 @@ var PathItem = Item.extend(/** @lends PathItem# */{ var ok = false; if (path) { var paths1 = this._children || [this], - paths2 = path._children.slice() || [path], + paths2 = path._children ? path._children.slice() : [path], length1 = paths1.length, length2 = paths2.length, matched = [], - count; + count = 0; ok = true; for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) { var path1 = paths1[i1];