ex.
var root = document.createElement("div");
var observer = new IntersectionObserver(() => {}, {root:root});
root = null; // allow root to be collected since IO doesn't keep it alive.
while (true) {
doSomething();
try {
observer.observe(null);
} {
// GC happened and not isRootValid() is false.
break;
}
}
You just need to make doSomething() do some work to potentially trigger a GC. This can also be used async, any time a method throws for an invalid root it leaks knowledge that a GC happened to the page.
Comment 1 by e...@chromium.org
, Jan 17 2017Status: Assigned (was: Untriaged)