see if I can understand how it’s blocking generators
Well first of all, they didn’t, at first: https://blog.bentkowski.info/2017/11/yet-another-google-caja-bypasses-hat.html
But to be clear, they don’t just eval(new Function())
the code like you do. They do a full parse (with Acorn), static analysis, and source-to-source compile. So they control a lot more about the environment their sandboxed JS runs in than the apparent global scope.
Nonetheless, I actually agree with you that not using iframe or worker is a fool’s errand (as demonstrated by that blogpost) — I’m planning to use a JS sandbox only as an additional defense-in-depth against untrusted JS inside a worker in an iframe (if I’m going to run untrusted code in my customer’s browsers, I better be paranoid).