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.
Status: RESOLVED FIXED
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
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 21:10 UTC by Arun
Modified: 2014-05-07 15:06 UTC (History)
3 users (show)

See Also:


Attachments

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();
xhr.open("GET", "/foo");
xhr.onloadend = function() { blob.close(); console.log("XHR finished"); }
xhr.onload = function() { finishWorking(); }
xhr.onerror = function() { blob.close(); }
xhr.send(blob);

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:

http://dev.w3.org/2006/webapi/FileAPI/#close-method
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
Done: http://dev.w3.org/2006/webapi/FileAPI/#dfn-close