summaryrefslogtreecommitdiff
path: root/script-beta/vm
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/vm')
-rw-r--r--script-beta/vm/eachDef.lua2
-rw-r--r--script-beta/vm/eachField.lua2
-rw-r--r--script-beta/vm/eachRef.lua2
-rw-r--r--script-beta/vm/getInfer.lua8
4 files changed, 7 insertions, 7 deletions
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua
index 8b3c6a9b..46d1887e 100644
--- a/script-beta/vm/eachDef.lua
+++ b/script-beta/vm/eachDef.lua
@@ -33,7 +33,7 @@ function vm.getDefs(source, deep)
or eachDef(source, deep)
vm.getCache('eachDefOfGlobal')[name] = cache
return cache
- elseif deep then
+ elseif not deep then
return eachDef(source, deep)
else
local cache = vm.getCache('eachDef')[source]
diff --git a/script-beta/vm/eachField.lua b/script-beta/vm/eachField.lua
index 9075bf36..b644cbd9 100644
--- a/script-beta/vm/eachField.lua
+++ b/script-beta/vm/eachField.lua
@@ -54,7 +54,7 @@ function vm.getFields(source, deep)
or eachField(source, deep)
vm.getCache('eachFieldOfGlobal')[name] = cache
return cache
- elseif deep then
+ elseif not deep then
return eachField(source, deep)
else
local cache = vm.getCache('eachField')[source]
diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua
index 8391d89d..8df45c67 100644
--- a/script-beta/vm/eachRef.lua
+++ b/script-beta/vm/eachRef.lua
@@ -32,7 +32,7 @@ function vm.getRefs(source, deep)
or getRefs(source, deep)
vm.getCache('eachRefOfGlobal')[name] = cache
return cache
- elseif deep then
+ elseif not deep then
return getRefs(source, deep)
else
local cache = vm.getCache('eachRef')[source]
diff --git a/script-beta/vm/getInfer.lua b/script-beta/vm/getInfer.lua
index db3b240c..c0f2d118 100644
--- a/script-beta/vm/getInfer.lua
+++ b/script-beta/vm/getInfer.lua
@@ -5,8 +5,8 @@ local util = require 'utility'
NIL = setmetatable({'<nil>'}, { __tostring = function () return 'nil' end })
--- 是否包含某种类型
-function vm.hasType(source, type)
- local defs = vm.getDefs(source)
+function vm.hasType(source, type, deep)
+ local defs = vm.getDefs(source, deep)
for i = 1, #defs do
local def = defs[i]
local value = guide.getObjectValue(def) or def
@@ -18,8 +18,8 @@ function vm.hasType(source, type)
end
--- 是否包含某种类型
-function vm.hasInferType(source, type)
- local infers = vm.getInfers(source)
+function vm.hasInferType(source, type, deep)
+ local infers = vm.getInfers(source, deep)
for i = 1, #infers do
local infer = infers[i]
if infer.type == type then