Closed jhmaster2000 closed 6 months ago
Thanks, it's a good catch. However, let's take a look at Set#deleteAll
draft text - that returns a boolean, but they should be consistent. It seems it's need to raise this issue in the proposal repo.
See this issue https://github.com/tc39/proposal-collection-methods/issues/53 - it seems the current semantic is correct and it should be fixed in the spec text.
Oh I missed that inconsistency, I did find it odd to return this
as the boolean return does feel way more helpful too. I'll leave it up to you if you want to close this already or wait until there's an official resolution on the proposal issue, either works for me.
I did find it odd to return
this
as the boolean return does feel way more helpful too.
If you think so, you can speak out in the above-mentioned issue -)
I don't think that we will have the answer to https://github.com/tc39/proposal-collection-methods/issues/53 soon, but it seems we can consider https://github.com/tc39/proposal-collection-methods/issues/2 as that, so I think that we can close this PR.
Currently the
Map#deleteAll
polyfill is returning a boolean whether it deleted everything successfully or not, this is not the correct behavior of the current ES proposal: https://tc39.es/proposal-collection-methods/#Map.prototype.deleteAllThe expected behavior is to return the map itself (
this
), so I've also removed all the successful deletion tracking code as it was no longer needed.