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/global.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'script/vm/global.lua') diff --git a/script/vm/global.lua b/script/vm/global.lua index 5f32cd87..f9090893 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -521,10 +521,15 @@ function vm.compileByGlobal(source) if global.cate == 'variable' then vm.setNode(source, global) if guide.isAssign(source) then - vm.setNode(source, vm.compileNode(source.value)) + if source.value then + vm.setNode(source, vm.compileNode(source.value)) + end return end - vm.traceNode(source) + local node = vm.traceNode(source) + if node then + vm.setNode(source, node, true) + end return end local globalBase = vm.getGlobalBase(source) -- cgit v1.2.3