Your mistake appears to be in assuming that the elements of your array are 8-bit integers, but the result of bitwise operators in JavaScript are 32-bit integers and so the most significant bit remains when you do the left shift.
I believe that adding a bit mask by changing:
output[i] = b[i] << 1;
to:
output[i] = (b[i] << 1) & 0xFF;
should fix your issue.
As a side note, I think your fromOctal()
function should actually be named fromBinary()
.