[webkit-reviews] review granted: [Bug 237141] Web Inspector: add `IterableWeakSet` : [Attachment 453154] [fast-cq] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 25 13:35:25 PST 2022


Patrick Angle <pangle at apple.com> has granted Devin Rousso <drousso at apple.com>'s
request for review:
Bug 237141: Web Inspector: add `IterableWeakSet`
https://bugs.webkit.org/show_bug.cgi?id=237141

Attachment 453154: [fast-cq] Patch

https://bugs.webkit.org/attachment.cgi?id=453154&action=review




--- Comment #3 from Patrick Angle <pangle at apple.com> ---
Comment on attachment 453154
  --> https://bugs.webkit.org/attachment.cgi?id=453154
[fast-cq] Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453154&action=review

rs=me Nice!

> Source/WebInspectorUI/UserInterface/Base/IterableWeakSet.js:130
> +	   return Array.from(this);

It seems a bit strange to me that it should be possible to mutate the result of
`toJSON` as an array (even if those mutations won't affect the underlying
backing). Any reason not to call `toJSON` on the created array to avoid that
side effect? (`copy()` would need to change slightly if this does, though)

> LayoutTests/inspector/unit-tests/iterableweakset-expected.txt:13
> +PASS: has should return true if a key exists.

Nit: can we enclose `has` inside back-ticks or some other quote-like character.
I read this sentence several times before I realized `has` was a function name,
despite the test case header hinting at that ��. Same throughout below.


More information about the webkit-reviews mailing list