Operational-Transformation / ot.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError in TextOperation

alanhong902 opened this issue · comments

TypeError: this is undefined

TextOperation.prototype.equals = function (other) {
if (this.baseLength !== other.baseLength) { return false; }
if (this.targetLength !== other.targetLength) { return false; }
if (this.ops.length !== other.ops.length) { return false; }
for (var i = 0; i < this.ops.length; i++) {
if (this.ops[i] !== other.ops[i]) { return false; }
}
return true;
};

I'm using combined script for browser and get this error.

Do you have a stack trace for that? I'd try to help but I have no idea what the context of the error is.

Hi @alanhong902, did you manage to fix the issue? We encountered a TypeError: Cannot read property 'baseLength' of undefined, and it seems to be related to the code block at:

if (operation1.baseLength !== operation2.baseLength) {

If you have any updates or solutions, please let us know. Thanks!