diff options
author | fesily <fesil@foxmail.com> | 2023-06-01 08:44:55 +0800 |
---|---|---|
committer | fesily <fesil@foxmail.com> | 2023-06-01 08:44:55 +0800 |
commit | de98b5c16e0c54bcbbe12840b376273295845fdd (patch) | |
tree | 340ea55e129c17a0e137e11ae6cc3524c407c5c4 /script | |
parent | d35909dcf28a61f67c11c34216b31f85e4a05d1d (diff) | |
download | lua-language-server-de98b5c16e0c54bcbbe12840b376273295845fdd.zip |
getReturnOfSetMetaTable remove nil
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/compiler.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index f455d6da..3927e359 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -522,6 +522,17 @@ local function getReturnOfSetMetaTable(args) end end) end + --过滤nil + local len = #node + for i = len, 1, -1 do + local n = node[i] + if n.cate == 'type' then + if n.name == 'nil' then + table.remove(node, i) + break + end + end + end return node end |