rename mutableGlobalNames back to mutableGlobals

This commit is contained in:
LoganDark 2021-11-08 14:06:27 -08:00
parent 81b28ff6c5
commit 975f5a3bd0
No known key found for this signature in database
GPG key ID: B8C37CEDE1AC60EA
3 changed files with 4 additions and 4 deletions

View file

@ -39,7 +39,7 @@ struct CompileOptions
// array of globals that are mutable; disables the import optimization for fields accessed through them // array of globals that are mutable; disables the import optimization for fields accessed through them
// use NULL to end the array // use NULL to end the array
const char** mutableGlobalNames = nullptr; const char** mutableGlobals = nullptr;
}; };
class CompileError : public std::exception class CompileError : public std::exception

View file

@ -3710,8 +3710,8 @@ void compileOrThrow(BytecodeBuilder& bytecode, AstStatBlock* root, const AstName
if (AstName name = names.get("_G"); name.value) if (AstName name = names.get("_G"); name.value)
compiler.globals[name].writable = true; compiler.globals[name].writable = true;
if (options.mutableGlobalNames) if (options.mutableGlobals)
for (const char** ptr = options.mutableGlobalNames; *ptr != NULL; ++ptr) for (const char** ptr = options.mutableGlobals; *ptr != NULL; ++ptr)
{ {
if (AstName name = names.get(*ptr); name.value) if (AstName name = names.get(*ptr); name.value)
compiler.globals[name].writable = true; compiler.globals[name].writable = true;

View file

@ -3749,7 +3749,7 @@ RETURN R0 0
bcb.setDumpFlags(Luau::BytecodeBuilder::Dump_Code); bcb.setDumpFlags(Luau::BytecodeBuilder::Dump_Code);
Luau::CompileOptions options; Luau::CompileOptions options;
const char* mutableGlobals[] = {"Game", "Workspace", "game", "plugin", "script", "shared", "workspace", NULL}; const char* mutableGlobals[] = {"Game", "Workspace", "game", "plugin", "script", "shared", "workspace", NULL};
options.mutableGlobalNames = &mutableGlobals[0]; options.mutableGlobals = &mutableGlobals[0];
Luau::compileOrThrow(bcb, source, options); Luau::compileOrThrow(bcb, source, options);
CHECK_EQ("\n" + bcb.dumpFunction(0), R"( CHECK_EQ("\n" + bcb.dumpFunction(0), R"(