fix leaky variable in chainpad

Patch.transform declared a 'toTransform' variable without using 'var'
this caused it to leak onto the window during operational transformations
This commit is contained in:
ansuz 2016-04-12 09:52:36 +02:00
parent 05108efdfa
commit 4ba68eb2bf

View file

@ -220,7 +220,7 @@ var transform = Patch.transform = function (origToTransform, transformBy, doc, t
Common.assert(origToTransform.parentHash === transformBy.parentHash);
var resultOfTransformBy = apply(transformBy, doc);
toTransform = clone(origToTransform);
var toTransform = clone(origToTransform);
var text = doc;
for (var i = toTransform.operations.length-1; i >= 0; i--) {
/* this line caused diffs to be applied against the incorrect text