From c50690349b4cd40643530deeef5074527d5d41b2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 1 Apr 2016 10:46:54 +0200 Subject: [PATCH] comments describing the role of each argument --- www/common/json-ot.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/json-ot.js b/www/common/json-ot.js index 41a628dc4..98e1af4ec 100644 --- a/www/common/json-ot.js +++ b/www/common/json-ot.js @@ -6,6 +6,11 @@ define([ var validate = JsonOT.validate = function (text, toTransform, transformBy) { try { + // text = O (mutual common ancestor) + // toTransform = A (the first incoming operation) + // transformBy = B (the second incoming operation) + // threeway merge (0, A, B) + var resultOp = ChainPad.Operation.transform0(text, toTransform, transformBy); var text2 = ChainPad.Operation.apply(transformBy, text); var text3 = ChainPad.Operation.apply(resultOp, text2);