kaitai-io / kaitai_struct_javascript_runtime

Kaitai Struct: runtime for JavaScript
Apache License 2.0
37 stars 22 forks source link

Different EOF error exceptions #1

Closed GreyCat closed 4 years ago

GreyCat commented 8 years ago

Currently, in JavaScript runtime, reading more bytes than there are in the stream using readBytes(...) results in KaitaiEOFError being thrown. However, doing the same (i.e. reading past end of buffer) with other primitive reading functions, such as readU4le(), results in RangeError: Offset is outside the bounds of the DataView.

Shall we make it straight and uniform and fix it to adhere to the same standard (for example, RangeError everywhere)?

cherue commented 4 years ago

This has been fixed in a019595a177ce40636e26492b1a0d55c68582728 and can be closed.

GreyCat commented 4 years ago

Thanks for checking, closing :)