diff options
Diffstat (limited to 'script/vm/value.lua')
-rw-r--r-- | script/vm/value.lua | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/script/vm/value.lua b/script/vm/value.lua index 83265603..c4f8e96d 100644 --- a/script/vm/value.lua +++ b/script/vm/value.lua @@ -22,24 +22,16 @@ function vm.testCondition(source) if n[1] == false then hasFalse = true end - end - if n.type == 'global' and n.cate == 'type' then - if n.name == 'true' then - hasTrue = true - end + elseif n.type == 'global' and n.cate == 'type' then if n.name == 'false' or n.name == 'nil' then hasFalse = true + else + hasTrue = true end - end - if n.type == 'nil' then + elseif n.type == 'nil' then hasFalse = true - end - if n.type == 'string' - or n.type == 'number' - or n.type == 'integer' - or n.type == 'table' - or n.type == 'function' then + elseif guide.isLiteral(n) then hasTrue = true end end |