diff --git a/protocol/src/main/resources/ecmascript/buffer/ByteBuffer.mjs b/protocol/src/main/resources/ecmascript/buffer/ByteBuffer.mjs index e8f109c7..779879b0 100644 --- a/protocol/src/main/resources/ecmascript/buffer/ByteBuffer.mjs +++ b/protocol/src/main/resources/ecmascript/buffer/ByteBuffer.mjs @@ -87,7 +87,7 @@ class ByteBuffer { if (writeIndex > this.buffer.byteLength) { throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset + ', writeOffset: ' + this.writeOffset + - '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ')'; + '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')'); } this.writeOffset = writeIndex; } @@ -100,7 +100,7 @@ class ByteBuffer { if (readIndex > this.writeOffset) { throw new Error('readIndex out of bounds exception: readOffset: ' + this.readOffset + ', writeOffset: ' + this.writeOffset + - '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ")"; + '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')'); } this.readOffset = readIndex; } diff --git a/protocol/src/test/ecmascript/zfooes/buffer/ByteBuffer.mjs b/protocol/src/test/ecmascript/zfooes/buffer/ByteBuffer.mjs index 48cd660f..779879b0 100644 --- a/protocol/src/test/ecmascript/zfooes/buffer/ByteBuffer.mjs +++ b/protocol/src/test/ecmascript/zfooes/buffer/ByteBuffer.mjs @@ -83,26 +83,26 @@ class ByteBuffer { return this.writeOffset; } - setWriteOffset(writeOffset) { - if (writeOffset > this.buffer.byteLength) { - throw new Error('index out of bounds exception: readerIndex: ' + this.readOffset + - ', writerIndex: ' + this.writeOffset + - '(expected: 0 <= readerIndex <= writerIndex <= capacity:' + this.buffer.byteLength); + setWriteOffset(writeIndex) { + if (writeIndex > this.buffer.byteLength) { + throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset + + ', writeOffset: ' + this.writeOffset + + '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')'); } - this.writeOffset = writeOffset; + this.writeOffset = writeIndex; } getReadOffset() { return this.readOffset; } - setReadOffset(readOffset) { - if (readOffset > this.writeOffset) { - throw new Error('index out of bounds exception: readerIndex: ' + this.readOffset + - ', writerIndex: ' + this.writeOffset + - '(expected: 0 <= readerIndex <= writerIndex <= capacity:' + this.buffer.byteLength); + setReadOffset(readIndex) { + if (readIndex > this.writeOffset) { + throw new Error('readIndex out of bounds exception: readOffset: ' + this.readOffset + + ', writeOffset: ' + this.writeOffset + + '(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')'); } - this.readOffset = readOffset; + this.readOffset = readIndex; } getCapacity() {