Wrap script in IIFE
Closed this issue · 4 comments
weizman commented
Should be rather easy to support scripts as well as modules and might be relevant for users (just make sure to wrap entire code in new scope to not leak variables to global scope)
(function(){
<tachyon-code>
}())
weebney commented
Is there a specific use-case you had in mind for this?
weizman commented
I think that the cost of "fixing" this is literally as close as possible to 0, so why not really? hard to tell what web app builders need or might do in this web jungle.. in this case it's just about wrapping your output code with a scope (I think in general code should always be wrapped in a scope so it's clear it should not leak)
weebney commented
Valid point. I'll put it in the milestone for the next version 👍