From e7766115f8615e30250febd2ea3cba9884b3326e Mon Sep 17 00:00:00 2001 From: Tobias Strebitzer Date: Wed, 19 Sep 2018 20:31:15 +0800 Subject: [PATCH] Add missing iterator initializer in classapplier Add missing a `var` initializer for iterator `i` in rangy-classapplier.js to resolve javascript error. --- lib/rangy-classapplier.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rangy-classapplier.js b/lib/rangy-classapplier.js index 9fe90d85..7ce08f83 100644 --- a/lib/rangy-classapplier.js +++ b/lib/rangy-classapplier.js @@ -331,7 +331,8 @@ function getRangeBoundaries(ranges) { var positions = [], i, range; - for (i = 0; range = ranges[i++]; ) { + for + 0; range = ranges[i++]; ) { positions.push( new DomPosition(range.startContainer, range.startOffset), new DomPosition(range.endContainer, range.endOffset) @@ -741,7 +742,7 @@ // Apply the merges if (merges.length) { - for (i = 0, len = merges.length; i < len; ++i) { + for (var i = 0, len = merges.length; i < len; ++i) { merges[i].doMerge(positionsToPreserve); }