function f(){
let a = {};
return function(){};
}
In all (IIRC) major implementations, the object allocated for `a` will be held on to after the function returns because it exists in the lexical scope of the function returned (even though it isn't—and never can be—reached, as static analysis can prove).Basically all the other bugs I'm aware of are cases of C++ code not treating things as roots when necessary, mostly in DOM code.