- From: guest271314 <notifications@github.com>
- Date: Sun, 05 Apr 2020 12:37:53 -0700
- To: w3c/FileAPI <FileAPI@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/FileAPI/issues/150/609470655@github.com>
Use case
If `new Blob(undefined)` https://github.com/w3c/FileAPI/issues/33 can be handled to output
`Blob {size: 0, type: ""}`
Similarly
```new Blob(new Float32Array([0.00005549501292989589, 0.00006459458381868899, 0.000058644378441385925, 0.00006201512587722391]))```
should be handled to output
```
file.arrayBuffer().then(b => console.log(new Float32Array(b))).catch(console.error);
Promise {<pending>}
Float32Array(4) [0.00005549501292989589, 0.00006459458381868899, 0.000058644378441385925, 0.00006201512587722391]
```
rather than `RangeError` (Chromium `RangeError: byte length of Float32Array should be a multiple of 4`; Nightly `RangeError: "attempting to construct out-of-bounds TypedArray on ArrayBuffer"`) due to
```
file.text().then(console.log).catch(console.error); // new Blob(TypedArray)
Promise {<pending>}
0.000055495012929895890.000064594583818688990.0000586443784413859250.00006201512587722391
```
instead of
```
file.text().then(console.log).catch(console.error); // new Blob([TypedArray])
Promise {<pending>}
Q�h8�v�8��u8���8
```
Will the suggested change break any existing API or be incompatible with implementation that uses File API expecting `new Blob(TypedArray)` to output a concatenated string of the members of the passed `TypedArray`?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/150#issuecomment-609470655
Received on Sunday, 5 April 2020 19:38:08 UTC