Editorial: use idiomatic phrasing in CleanupFinalizationRegistry#3829
Editorial: use idiomatic phrasing in CleanupFinalizationRegistry#3829michaelficarra wants to merge 3 commits intomainfrom
Conversation
|
I find this more awkward to read FWIW. |
|
@bakkot How about this? |
|
The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/3829 and as multiple pages at https://tc39.es/ecma262/pr/3829/multipage . |
|
Still just as awkward. Compare the before and after as prose rather than pretending it's a computer program. The earlier prose is much easier to understand. |
|
The step |
|
The phrasing is fine. It's just in this case it's referring to an alias that I don't think it should be able to refer to. I don't consider the form in the |
|
Well, that is how prose works. |
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
The phrasing is fine. It's just in this case it's referring to an alias that I don't think it should be able to refer to. I don't consider the form in the while step to be declaring an alias that is visible to later steps.
Instead of Choose any such _cell_ we could use Let _cell_ be any of such Records, so that it's declaring _cell_ and not referencing the one "declared" in the While prose that has not one value but many possible values.
| 1. Let _candidates_ be a List whose elements are the elements of _finalizationRegistry_.[[Cells]] whose [[WeakRefTarget]] is ~empty~. | ||
| 1. If _candidates_ is empty, return ~unused~. |
There was a problem hiding this comment.
| 1. Let _candidates_ be a List whose elements are the elements of _finalizationRegistry_.[[Cells]] whose [[WeakRefTarget]] is ~empty~. | |
| 1. If _candidates_ is empty, return ~unused~. | |
| 1. Let _cell_ be either ~none~ or one of the elements of _finalizationRegistry_.[[Cells]] whose [[WeakRefTarget]] is ~empty~, chosen in an implementation-defined manner. | |
| 1. If _cell_ is ~none~, return ~unused~. | |
| 1. Remove _cell_ from _finalizationRegistry_.[[Cells]]. | |
| 1. Perform ? HostCallJobCallback(_callback_, *undefined*, « _cell_.[[HeldValue]] »). |
Would this make it easier to follow, with a similar readability as the original prose?
No description provided.