I was defining js objects permanently, whereupon they could not be deleted.

That's wrong.
And I think I was doing some of that in the old js machinery too.