fix first y-array test
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Item from './Item.js'
|
||||
import { splitHelper, default as Item } from './Item.js'
|
||||
|
||||
export default class ItemString extends Item {
|
||||
constructor () {
|
||||
@@ -13,12 +13,24 @@ export default class ItemString extends Item {
|
||||
this._content = decoder.readVarString()
|
||||
return missing
|
||||
}
|
||||
_toBinary (y, encoder) {
|
||||
super._toBinary(y, encoder)
|
||||
_toBinary (encoder) {
|
||||
super._toBinary(encoder)
|
||||
encoder.writeVarString(this._content)
|
||||
}
|
||||
_logString () {
|
||||
let s = super._logString()
|
||||
return 'ItemString: ' + s
|
||||
}
|
||||
_splitAt (y, diff) {
|
||||
if (diff === 0) {
|
||||
return this
|
||||
} else if (diff >= this._length) {
|
||||
return this._right
|
||||
}
|
||||
let item = new ItemString()
|
||||
item._content = this._content.slice(diff)
|
||||
this._content = this._content.slice(0, diff)
|
||||
splitHelper(y, this, item, diff)
|
||||
return item
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user