use ScopedFastFlag

This commit is contained in:
LoganDark 2021-11-08 14:13:34 -08:00
parent 975f5a3bd0
commit 4a2472d56c
No known key found for this signature in database
GPG key ID: B8C37CEDE1AC60EA

View file

@ -3673,8 +3673,6 @@ RETURN R0 0
TEST_CASE("LuauGenericSpecialGlobals")
{
FFlag::LuauGenericSpecialGlobals.value = false;
const char* source = R"(
print()
Game.print()
@ -3687,6 +3685,9 @@ shared.print()
workspace.print()
)";
{
ScopedFastFlag genericSpecialGlobals{"LuauGenericSpecialGlobals", false};
// Check Roblox globals are here
CHECK_EQ("\n" + compileFunction0(source), R"(
GETIMPORT R0 1
@ -3717,8 +3718,9 @@ GETTABLEKS R0 R1 K0
CALL R0 0 0
RETURN R0 0
)");
}
FFlag::LuauGenericSpecialGlobals.value = true;
ScopedFastFlag genericSpecialGlobals{"LuauGenericSpecialGlobals", true};
// Check Roblox globals are no longer here
CHECK_EQ("\n" + compileFunction0(source), R"(