darrachequesne / notepack

A fast Node.js implementation of the latest MessagePack spec
MIT License
75 stars 19 forks source link

Wrong buffer is used the browser decoder's constructor #10

Closed nkochakian closed 7 years ago

nkochakian commented 7 years ago

https://github.com/darrachequesne/notepack/blob/2.1.0/browser/decode.js#L12

It looks like this is supposed to be new DataView(this.buffer);

The current version uses the wrong buffer if !(buffer instanceof ArrayBuffer) and ArrayBuffer.isView(buffer) is true.