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]> Tue, 23 Feb 2021 10:52:36 +0100
| Newsgroups | gmane.comp.mozilla.general |
|---|---|
| Message-ID | <[email protected]> |
Dave, I forgot to mention that I also tried to go the JSON.stringify() road using a "replacer" function (pretty-much copy-pasting it). It it also used a WeakList, and again barfed throwing the same error. IOW, its not something related to my coding if you might think that. :-) With the absense of someone recognising the problem I just did a few more tests. I ran, inside the addon, the "examples" code I found here : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet , which worked. Jay! However, when I try to add, in that same code, the object as provided as the "http-on-examine-response" callbacks first argument I get a "TypeError: cannot use the given object as a weak map key". It simply looks like that the object delivered by FF isn't quite compatible with JS. Which is a bit of a WTF? to me ... It could also be the reason why the "var value = arr[item]" assignment sometimes fails (on specific "item" fields). The new question now is : is there a way with which I can convince a WeakList to accept the FF object ? Without trying to alter the FF object itself ofcourse. Regards, Rudy Wieser