summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 33184569..254320e4 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -7,9 +7,12 @@ local vm = require 'vm'
rawset(_G, 'TEST', true)
local function getSource(pos)
- local ast = files.getState('')
+ local state = files.getState('')
+ if not state then
+ return
+ end
local result
- guide.eachSourceContain(ast.ast, pos, function (source)
+ guide.eachSourceContain(state.ast, pos, function (source)
if source.type == 'local'
or source.type == 'getlocal'
or source.type == 'setlocal'