Changeset: Turn newOp() into a real class

This commit is contained in:
Richard Hansen 2021-10-25 01:21:19 -04:00
parent fba0bb6dff
commit 657492e191
7 changed files with 99 additions and 61 deletions

View file

@ -57,7 +57,7 @@ describe('easysync', function () {
const mutationsToChangeset = (oldLen, arrayOfArrays) => {
const assem = Changeset.smartOpAssembler();
const op = Changeset.newOp();
const op = new Changeset.Op();
const bank = Changeset.stringAssembler();
let oldPos = 0;
let newLen = 0;
@ -507,7 +507,7 @@ describe('easysync', function () {
const opAssem = Changeset.smartOpAssembler();
const oldLen = origText.length;
const nextOp = Changeset.newOp();
const nextOp = new Changeset.Op();
const appendMultilineOp = (opcode, txt) => {
nextOp.opcode = opcode;
@ -651,7 +651,7 @@ describe('easysync', function () {
const testSplitJoinAttributionLines = (randomSeed) => {
const stringToOps = (str) => {
const assem = Changeset.mergingOpAssembler();
const o = Changeset.newOp('+');
const o = new Changeset.Op('+');
o.chars = 1;
for (let i = 0; i < str.length; i++) {
const c = str.charAt(i);