This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25240 - Blob.close() shouldn't throw when invoked more than once.
Summary: Blob.close() shouldn't throw when invoked more than once.
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: File API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Arun
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2014-04-02 21:10 UTC by Arun
Modified: 2014-05-07 15:06 UTC (History)
3 users (show)

See Also:


Description Arun 2014-04-02 21:10:24 UTC
See Bug 24576 Comment 11.

Blob.close() should, if invoked more than once, be a no-op.
Comment 1 Glenn Maynard 2014-04-02 23:58:33 UTC
For example,

var xhr = new XMLHttpRequest();"GET", "/foo");
xhr.onloadend = function() { blob.close(); console.log("XHR finished"); }
xhr.onload = function() { finishWorking(); }
xhr.onerror = function() { blob.close(); }

would result in onloadend throwing and not doing anything after blob.close() on the onerror path, since onerror already closed the blob, even though it's in exactly the state the developer wanted--the blob is closed.

(The above isn't the best way to do this, of course--you should just call blob.close() immediately after xhr.send--it's just an example of something harmless being turned into a bug.)
Comment 2 Arun 2014-05-07 03:06:57 UTC
Blob.close() no longer throws when invoked more than once:
Comment 3 Simon Pieters 2014-05-07 07:23:12 UTC
Can you remove "do nothing, since context object is already closed, and "?
Comment 4 Arun 2014-05-07 15:06:46 UTC