File tree 3 files changed +9
-2
lines changed
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
659
659
* ` id ` {string} A ` 'blob:nodedata:... ` URL string returned by a prior call to
660
660
` URL.createObjectURL() ` .
661
661
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.
663
664
664
665
### Class: ` URLSearchParams `
665
666
Original file line number Diff line number Diff line change @@ -444,7 +444,9 @@ void BlobBindingData::store_data_object(
444
444
}
445
445
446
446
void 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
+ }
448
450
data_objects_.erase (uuid);
449
451
CHECK_EQ (data_objects_.find (uuid), data_objects_.end ());
450
452
}
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ const assert = require('assert');
29
29
Buffer . from ( await otherBlob . arrayBuffer ( ) ) . toString ( ) ,
30
30
'hello' ) ;
31
31
URL . revokeObjectURL ( id ) ;
32
+
33
+ // should do nothing
34
+ URL . revokeObjectURL ( id ) ;
35
+
32
36
assert . strictEqual ( resolveObjectURL ( id ) , undefined ) ;
33
37
34
38
// Leaving a Blob registered should not cause an assert
You can’t perform that action at this time.
0 commit comments