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:
parent
05108efdfa
commit
4ba68eb2bf
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ var transform = Patch.transform = function (origToTransform, transformBy, doc, t
|
||||||
Common.assert(origToTransform.parentHash === transformBy.parentHash);
|
Common.assert(origToTransform.parentHash === transformBy.parentHash);
|
||||||
var resultOfTransformBy = apply(transformBy, doc);
|
var resultOfTransformBy = apply(transformBy, doc);
|
||||||
|
|
||||||
toTransform = clone(origToTransform);
|
var toTransform = clone(origToTransform);
|
||||||
var text = doc;
|
var text = doc;
|
||||||
for (var i = toTransform.operations.length-1; i >= 0; i--) {
|
for (var i = toTransform.operations.length-1; i >= 0; i--) {
|
||||||
/* this line caused diffs to be applied against the incorrect text
|
/* this line caused diffs to be applied against the incorrect text
|
||||||
|
|
Loading…
Reference in a new issue