File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,8 @@ added: v16.7.0
659659* ` id ` {string} A ` 'blob:nodedata:... ` URL string returned by a prior call to
660660 ` URL.createObjectURL() ` .
661661
662- Removes the stored {Blob} identified by the given ID.
662+ Removes the stored {Blob} identified by the given ID. Attempting to revoke a
663+ ID that isn’t registered will silently fail.
663664
664665### Class: ` URLSearchParams `
665666
Original file line number Diff line number Diff line change @@ -444,7 +444,9 @@ void BlobBindingData::store_data_object(
444444}
445445
446446void BlobBindingData::revoke_data_object (const std::string& uuid) {
447- CHECK_NE (data_objects_.find (uuid), data_objects_.end ());
447+ if (data_objects_.find (uuid) == data_objects_.end ()) {
448+ return ;
449+ }
448450 data_objects_.erase (uuid);
449451 CHECK_EQ (data_objects_.find (uuid), data_objects_.end ());
450452}
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ const assert = require('assert');
2929 Buffer . from ( await otherBlob . arrayBuffer ( ) ) . toString ( ) ,
3030 'hello' ) ;
3131 URL . revokeObjectURL ( id ) ;
32+
33+ // should do nothing
34+ URL . revokeObjectURL ( id ) ;
35+
3236 assert . strictEqual ( resolveObjectURL ( id ) , undefined ) ;
3337
3438 // Leaving a Blob registered should not cause an assert
You can’t perform that action at this time.
0 commit comments