cbor-x icon indicating copy to clipboard operation
cbor-x copied to clipboard

Fix browsers that don't support BigInt TypedArray

Open ambyjkl opened this issue 2 years ago • 1 comments

Decoding currently errors out on Safari 14 and below because they don't have BigUint64Array

ambyjkl avatar May 20 '22 17:05 ambyjkl

Thank you for the PR!

So the code is actually intended to throw an error when decoding of a non-existent typed array occurs, as seen on line 1025 and 1030, but they still need to be registered for that to occur. The issue here is accessing the TypedArray before registering it, on line 1018 (which was introduced to handle different endians). So think we need to alter to 1018 to check TypedArray before accessing its property (rather than returning).

kriszyp avatar May 20 '22 18:05 kriszyp