Making MsgPack work in IE10

This commit is contained in:
Pawel Kadluczka 2017-09-11 17:20:48 -07:00 committed by Pawel Kadluczka
parent 54c71c4c10
commit abd669849d
1 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,8 @@ export namespace TextMessageFormat {
export namespace BinaryMessageFormat {
export function write(output: Uint8Array): ArrayBuffer {
let size = output.byteLength;
// .byteLength does is undefined in IE10
let size = output.byteLength || output.length;
let buffer = new Uint8Array(size + 8);
// javascript bitwise operators only support 32-bit integers