after refactor - some tests are working again

This commit is contained in:
Kevin Jahns
2019-04-05 00:37:09 +02:00
parent 30bf3742c9
commit e56899a02c
23 changed files with 234 additions and 152 deletions

View File

@@ -25,11 +25,12 @@ export class GC extends AbstractStruct {
/**
* @type {number}
*/
this.length = length
this._len = length
this.deleted = true
}
get deleted () {
return true
get length () {
return this._len
}
/**
@@ -37,7 +38,7 @@ export class GC extends AbstractStruct {
* @return {boolean}
*/
mergeWith (right) {
this.length += right.length
this._len += right.length
return true
}
@@ -52,7 +53,7 @@ export class GC extends AbstractStruct {
} else {
writeID(encoder, createID(this.id.client, this.id.clock + offset))
}
encoding.writeVarUint(encoder, this.length)
encoding.writeVarUint(encoder, this._len)
}
}
@@ -71,7 +72,10 @@ export class GCRef extends AbstractRef {
/**
* @type {number}
*/
this.length = decoding.readVarUint(decoder)
this._len = decoding.readVarUint(decoder)
}
get length () {
return this._len
}
missing () {
return [
@@ -84,7 +88,7 @@ export class GCRef extends AbstractRef {
toStruct () {
return new GC(
this.id,
this.length
this._len
)
}
}