On 11/2/21 7:07 PM, Gabriel Ivăncescu wrote:
We don't hold a refcount to the location, but only a weak ref (as tests show).
To be honest, the test is not really interesting and I think that it would be better to hold the reference instead. What we observe in tests may be explained by some uninteresting internal details (like maybe the returned interface is just some sort of a wrapper), but current behaviour is broken for scripts. As an example like:
location.prop = "test";
var v = location.prop;
location may be released between those sentences, causing "prop" to be lost.
I think that we can just remove the reference count test if it causes problems.
Thanks,
Jacek