mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
remove kSpecialGlobals entirely
This commit is contained in:
parent
87ac5efb77
commit
4d630bed58
1 changed files with 1 additions and 4 deletions
|
@ -22,8 +22,6 @@ static const uint32_t kMaxRegisterCount = 255;
|
||||||
static const uint32_t kMaxUpvalueCount = 200;
|
static const uint32_t kMaxUpvalueCount = 200;
|
||||||
static const uint32_t kMaxLocalCount = 200;
|
static const uint32_t kMaxLocalCount = 200;
|
||||||
|
|
||||||
static const char* kSpecialGlobals[] = {"_G"};
|
|
||||||
|
|
||||||
CompileError::CompileError(const Location& location, const std::string& message)
|
CompileError::CompileError(const Location& location, const std::string& message)
|
||||||
: location(location)
|
: location(location)
|
||||||
, message(message)
|
, message(message)
|
||||||
|
@ -3704,9 +3702,8 @@ void compileOrThrow(BytecodeBuilder& bytecode, AstStatBlock* root, const AstName
|
||||||
Compiler compiler(bytecode, options);
|
Compiler compiler(bytecode, options);
|
||||||
|
|
||||||
// since access to some global objects may result in values that change over time, we block imports from non-readonly tables
|
// since access to some global objects may result in values that change over time, we block imports from non-readonly tables
|
||||||
for (const char* global : kSpecialGlobals)
|
|
||||||
{
|
{
|
||||||
AstName name = names.get(global);
|
AstName name = names.get("_G");
|
||||||
|
|
||||||
if (name.value)
|
if (name.value)
|
||||||
compiler.globals[name].writable = true;
|
compiler.globals[name].writable = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue