4 ms·
Would be extremely hard, especially given we're not just talking about core APIs like fetch: React code uses closures like crazy, and you couldn't wrap and prob
by brundolf 5y ago
Would be extremely hard, especially given we're not just talking about core APIs like fetch: React code uses closures like crazy, and you couldn't wrap and probably couldn't eval-shadow every single object in scope that might get mutated
You might be able to catch some common cases, but that might give a false sense of security
Enforcing against side-effects in JavaScript is pretty much a lost cause. Even merely accessing a property can cause side-effects, thanks to getters and proxies