Operating System: MacOS 10.14.6
Browsers:
- Chrome 85.0.4183.121 (Official Build) (64-bit)
- Firefox 81.0 (64-bit)
Reproduce Steps:
- Open a new tab
- Open Console (F12 or CMD+ALT+I)
- Create new ArrayBuffer
new ArrayBuffer(Math.pow(2,32)-1)
- Get error:
Uncaught RangeError: Array buffer allocation failed
According to page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length The above ArrayBuffer allocation should be a valid case for 64 bit browsers.
Creating of Array of same size works. It seems ArrayBuffer length is using signed int32 while creating Array is using uint32.
Anyone has any idea?
Aucun commentaire:
Enregistrer un commentaire