summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-22 00:47:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-22 00:47:13 +0800
commit533b04430eb34dbfb2e59f6f8d88f127e69ed133 (patch)
tree8a6a653a7ef4670a6e7631a7f3c8e6764e8bafea /script/vm
parentd16545d285de2451b3d2c0a03cc299ef18ac0ca0 (diff)
downloadlua-language-server-533b04430eb34dbfb2e59f6f8d88f127e69ed133.zip
only error in TEST
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua6
-rw-r--r--script/vm/node.lua6
2 files changed, 10 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index aee28366..c8dfaf9a 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1760,7 +1760,11 @@ end
---@return vm.node
function vm.compileNode(source)
if not source then
- error('Can not compile nil node')
+ if TEST then
+ error('Can not compile nil source')
+ else
+ log.error('Can not compile nil source')
+ end
end
if source.type == 'global' then
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 81d9f335..87fcc0c5 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -165,7 +165,11 @@ end
---@param cover? boolean
function vm.setNode(source, node, cover)
if not node then
- error('Can not set nil node')
+ if TEST then
+ error('Can not set nil node')
+ else
+ log.error('Can not set nil node')
+ end
end
if source.type == 'global' then
error('Can not set node to global')