zhipeng-jia / snappyjs

JavaScript implementation of Google's Snappy compression library
MIT License
151 stars 30 forks source link

IE11 support #9

Closed arenevier closed 3 years ago

arenevier commented 4 years ago

TypedArray.slice is not supported in IE

Currently, snappyjs compress method throws in IE

In this patch, if TypedArray.slice isn't defined, we use new Uint8Array(Array.prototype.slice.call(compressed, 0, length));

arenevier commented 4 years ago

I've modified index.js and then ran node ./build_browser_version.js

Please let me know if I need to perform another step to build the project.

kripton commented 3 years ago

Hm, you are changing files in the dist folder without changing the actual source? On the next run of build_browser_version.js (which generates the files in dist from the actual source), your changes will be overwritten. You should most probably do your changes in snappy_compressor.js and snappy_decompressor.js and then run build_browser_version.js to update the files in the dist folder