From c796d406329170e010590d7c9584b8483021cee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 9 Jan 2023 17:15:22 +0800 Subject: support trace for global --- script/vm/compiler.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'script/vm/compiler.lua') diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index a36904f8..663d7446 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1303,16 +1303,13 @@ local compilerSwitch = util.switch() end) : case 'setglobal' : call(function (source) + if bindDocs(source) then + return + end if source.node[1] ~= '_ENV' then return end - local key = guide.getKeyName(source) - vm.compileByParentNode(source.node, key, function (src) - if src.type == 'doc.type.field' - or src.type == 'doc.field' then - vm.setNode(source, vm.compileNode(src)) - end - end) + vm.setNode(source, vm.compileNode(source.value)) end) : case 'getglobal' : call(function (source) -- cgit v1.2.3