diff --git a/Compiler/include/Luau/Compiler.h b/Compiler/include/Luau/Compiler.h index 51588cb4..2935f595 100644 --- a/Compiler/include/Luau/Compiler.h +++ b/Compiler/include/Luau/Compiler.h @@ -39,7 +39,7 @@ struct CompileOptions // array of globals that are mutable; disables the import optimization for fields accessed through them // use NULL to end the array - const char** mutableGlobalNames = nullptr; + const char** mutableGlobals = nullptr; }; class CompileError : public std::exception diff --git a/Compiler/src/Compiler.cpp b/Compiler/src/Compiler.cpp index e51b2363..120c107f 100644 --- a/Compiler/src/Compiler.cpp +++ b/Compiler/src/Compiler.cpp @@ -3710,8 +3710,8 @@ void compileOrThrow(BytecodeBuilder& bytecode, AstStatBlock* root, const AstName if (AstName name = names.get("_G"); name.value) compiler.globals[name].writable = true; - if (options.mutableGlobalNames) - for (const char** ptr = options.mutableGlobalNames; *ptr != NULL; ++ptr) + if (options.mutableGlobals) + for (const char** ptr = options.mutableGlobals; *ptr != NULL; ++ptr) { if (AstName name = names.get(*ptr); name.value) compiler.globals[name].writable = true; diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index d3962481..cbc91d6f 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -3749,7 +3749,7 @@ RETURN R0 0 bcb.setDumpFlags(Luau::BytecodeBuilder::Dump_Code); Luau::CompileOptions options; const char* mutableGlobals[] = {"Game", "Workspace", "game", "plugin", "script", "shared", "workspace", NULL}; - options.mutableGlobalNames = &mutableGlobals[0]; + options.mutableGlobals = &mutableGlobals[0]; Luau::compileOrThrow(bcb, source, options); CHECK_EQ("\n" + bcb.dumpFunction(0), R"(