Closed Bug 937348 Opened 7 years ago Closed 6 years ago

Blob constructor does not accept non-Array blob parts


(Core :: General, defect)

28 Branch
Not set





(Reporter: costan, Unassigned)



User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131030203622

Steps to reproduce:

1. Call the Blob constructor with a sequence object.

Test case:

Actual results:

The constructor throws an exception.

Expected results:

The constructor should return a Blob.
This bug was recently fixed in Chrome:
Fwiw, there is a proposal right now that this testcase should in fact not work, since this is not an iterable object.  See

That said, if nothing else changes it'll start working once Blob is switched to WebIDL bindings.
Depends on: 827823
Thank you!

Please let me know if something changes, and I'll update the Blink and WebKit code to implement what the spec ends up mandating.
Flags: needinfo?(annevk)
Not sure why I'm needsinfo'd, but yeah, I think the plan still is to only allow iterables.
Flags: needinfo?(annevk)
You were needinfo'd because this is an example of people in the wild using non-iterables with sequence, which browsers are working on supporting.  So if we're going to change how sequence behaves, we better do it asap....
Victor, consensus seems to be that sequence should take iterables; I will be working on implementing that in Gecko.  It would be good to not ship something different in Chrome...
Thank you, Boris!

So, until the meaning of iterable is spec'd, should I remove the support for objects with length+index properties? Is there anything else/better I can do?
My current plan is to define "iterable" as "an object and GetProperty(obj, @@iterator) returns a callable object", I think.  The discussion on exactly how this should work died down.  :(

Note that in Gecko DOM nodelists are iterable in this sense, as are arrays and String objects...
I filed bug 952890 to track implementing sequences as iterables.
Thank you for pointing me to it, Boris! I'll try to find some time soon to investigate matching what you're doing in Blink and WebKit.
Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
The result in latest Nightly build (20140109030203) is "FAIL! The method parameter is missing or invalid."
Marking New as per above comments and bug 952890.
Ever confirmed: true
The point is, this isn't supposed to work.
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.