Skip to content

Commit ebea02c

Browse files
authored
Merge pull request #24 from mfalkvidd/es5_compatibility
Make compatible with ES5
2 parents 2de2c43 + 1c88c55 commit ebea02c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

KaitaiStream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ KaitaiStream.prototype.alignToByte = function() {
419419
KaitaiStream.prototype.readBitsIntBe = function(n) {
420420
// JS only supports bit operations on 32 bits
421421
if (n > 32) {
422-
throw new Error(`readBitsIntBe: the maximum supported bit length is 32 (tried to read ${n} bits)`);
422+
throw new Error("readBitsIntBe: the maximum supported bit length is 32 (tried to read " + n + " bits)");
423423
}
424424
var bitsNeeded = n - this.bitsLeft;
425425
if (bitsNeeded > 0) {
@@ -458,7 +458,7 @@ KaitaiStream.prototype.readBitsInt = KaitaiStream.prototype.readBitsIntBe;
458458
KaitaiStream.prototype.readBitsIntLe = function(n) {
459459
// JS only supports bit operations on 32 bits
460460
if (n > 32) {
461-
throw new Error(`readBitsIntLe: the maximum supported bit length is 32 (tried to read ${n} bits)`);
461+
throw new Error("readBitsIntLe: the maximum supported bit length is 32 (tried to read " + n + " bits)");
462462
}
463463
var bitsNeeded = n - this.bitsLeft;
464464
if (bitsNeeded > 0) {

0 commit comments

Comments
 (0)