summaryrefslogtreecommitdiff
path: root/server-beta/src/parser/compile.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/parser/compile.lua')
-rw-r--r--server-beta/src/parser/compile.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua
index 407b778f..8cfcd7a2 100644
--- a/server-beta/src/parser/compile.lua
+++ b/server-beta/src/parser/compile.lua
@@ -39,6 +39,16 @@ local vmMap = {
loc.ref[#loc.ref+1] = id
else
obj.type = 'getglobal'
+ if ENVMode == '_ENV' then
+ local node = guide.getLocal(Root, obj, '_ENV', obj.start)
+ if node then
+ if not node.ref then
+ node.ref = {}
+ end
+ node.ref[#node.ref+1] = id
+ obj.node = Cache[node]
+ end
+ end
end
return id
end,
@@ -267,6 +277,16 @@ local vmMap = {
loc.ref[#loc.ref+1] = id
else
obj.type = 'setglobal'
+ if ENVMode == '_ENV' then
+ local node = guide.getLocal(Root, obj, '_ENV', obj.start)
+ if node then
+ if not node.ref then
+ node.ref = {}
+ end
+ node.ref[#node.ref+1] = id
+ obj.node = Cache[node]
+ end
+ end
end
return id
end,