Re: [w3c/FileAPI] Consider substituting optional BlobPart or sequence<BlobPart> for optional sequence<BlobPart> blobParts at constructor (#150)

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