Use latest chainpad without mutations

pull/1/head
ansuz 9 years ago
parent d5772c6315
commit 96e03fcfa4

@ -1443,7 +1443,13 @@ var rebase = Operation.rebase = function (oldOp, newOp) {
* @param transformBy an existing operation which also has the same base. * @param transformBy an existing operation which also has the same base.
* @return toTransform *or* null if the result is a no-op. * @return toTransform *or* null if the result is a no-op.
*/ */
var transform0 = Operation.transform0 = function (text, toTransform, transformBy) {
var transform0 = Operation.transform0 = function (text, toTransformOrig, transformByOrig) {
// Cloning the original transformations makes this algorithm such that it
// **DOES NOT MUTATE ANYMORE**
var toTransform = Operation.clone(toTransformOrig);
var transformBy = Operation.clone(transformByOrig);
if (toTransform.offset > transformBy.offset) { if (toTransform.offset > transformBy.offset) {
if (toTransform.offset > transformBy.offset + transformBy.toRemove) { if (toTransform.offset > transformBy.offset + transformBy.toRemove) {
// simple rebase // simple rebase

Loading…
Cancel
Save