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
pull/1/head
ansuz 9 years ago
parent 05108efdfa
commit 4ba68eb2bf

@ -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

Loading…
Cancel
Save