You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!DOCTYPE html><html><head><metacharset="utf-8"></head><body><scriptsrc="https://dl.dropboxusercontent.com/s/r55397ld512etib/EncoderDecoderTogether.min.js?dl=0" nomodule="" type="text/javascript"></script><scripttype="text/javascript">constbytes=[50,65,113,117,121,81,111,98,118,68,76,43,77,110,73,90,49,100,43,77,65,71,119,87,68,82,115,57,74,54,117,97,79,78,120,74,119,54,88,113,120,86,99];varallBytes=newUint8Array(16777216);// write some A's to the beginningfor(vari=100-1;i>=0;i--){allBytes[i]=65;}constoffset=242839;for(vari=bytes.length-1;i>=0;i--){allBytes[i+offset]=bytes[i];}constslice=allBytes.subarray(offset,offset+bytes.length);console.log("slice",slice.length,slice[0],slice);conststr=newTextDecoder().decode(slice);console.log("str",str.length,str);</script></body></html>
As you can see, on IE11, the slice returned from subarray has the correct length and correct first byte, but somehow decode decodes the entire allBytes array (until it finds a 0 byte?).
The text was updated successfully, but these errors were encountered:
bwindels
changed the title
Subslice decodes to entire array in IE11
Subslice decodes entire array in IE11
Sep 18, 2020
Output on IE11:
Output in Firefox 80 (expected output):
As you can see, on IE11, the slice returned from
subarray
has the correct length and correct first byte, but somehowdecode
decodes the entireallBytes
array (until it finds a0
byte?).The text was updated successfully, but these errors were encountered: