-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Roblox-specific mutable globals #185
Conversation
Yeah this was on my list. This change would need to have a fast flag though because otherwise there's not going to be a safe way for us to deploy it, as it also requires associated changes in Roblox specific code. |
@zeux Here you go, all tests passing (about to pass on CI too). Sorry for the bumpy ride. :) lmk if you'd like the LuauGenericSpecialGlobals=false and LuauGenericSpecialGlobals=true tests to be separated. |
Checks passed, ready for merge |
kSpecialGlobals
is used by the compiler to disable the import optimization for values that are fetched from a mutable source (for example,_G.xd
). Not only does this currently include Roblox-specific globals that might mean totally different things in other applications, but there's no way for embedding applications to specify if they have their own globals that act this way, which means that the import optimization may misbehave in those cases.In vanilla Luau, only the
_G
global is mutable. Roblox can use the newly-implementedmutableGlobalNames
compile option to specify its own globals - and crucially, third-party applications can as well.