Re: Rw-asking: a weaklist that doesn't work and an object with elements that can't be copied or queried
"R.Wieser" <[email protected]> Mon, 22 Feb 2021 19:47:42 +0100
| Newsgroups | gmane.comp.mozilla.general |
|---|---|
| Message-ID | <[email protected]> |
Dave, > Is 'seen' actually a WeakSet? Yes. I created it myself. > Does the 'weak' make any difference? Are you suggesting that *in this case* I should just use something else ? I already did that (see below). :-) But that doesn't mean I do not need an answer to my "why doesn't the WeakList work when it should" question. Either so I know I made a mistake and it actually does work (and how), or so I do not waste any time and energy in trying to make it work the next time I have use for it. > How is 'seen' declared, and where (scope)? Just before the function, and provided as an argument. Also, 1) the error message was explicit about the WeakList being the culprit. 2) when I use a normal array instead it works. > Is the extra ) in the .add statement a typo in the post? Yeah. :-\ Copy-pasted it from the initial message in the other thread. > Perhaps 'arr' is empty? In that case I would not have gotten an "item", as that is retieved by way of a "for(var item in arr)" loop :-) (see the linked-to "mydump" routine). Regards, Rudy Wieser