Skip to content

buffer and slice #143

@DavidApfel

Description

@DavidApfel

Not sure if this is a bug or just different behaviour than with node, but when using for example the bn.js module with trireme it's a problem.

When using trireme and create a buffer and try to get a minus index [-1] of the buffer it gives an ArrayIndexOutOfBoundsException. When I create then a second buffer with slice() from the first buffer and then try to get a minus index it gives a value. While using node I get undefined in both cases:

var buf1 = new Buffer("1111", "hex");
var buf2 = buf1.slice(1);

trireme:

console.log(buf1[-1]); // java.lang.ArrayIndexOutOfBoundsException: -1
console.log(buf2[-1]); // 17

node:

console.log(buf1[-1]); // undefined
console.log(buf2[-1]); // undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions